Description

3D physics engine

Package Information

Version0.3.0 (2017-Jan-03)
Homepage http://github.com/gecko0307/dmech
Repository https://github.com/gecko0307/dmech
LicenseBoost
AuthorsTimur Gafarov
Registered byTimur Gafarov
Dependencies

dlib

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

Build Status dmech

dmech stands for "D mechanics": it is a real-time 3D physics engine written in D language, capable of simulating rigid body dynamics. It is more suitable for computer games than scientific simulations: the goal is to convince a player, rather than giving accurate results. dmech is GC-free and fully platform-independent, it can be used with any API or graphics engine.

Screenshots

Screenshot1 Screenshot2 Screenshot3 Screenshot4 Screenshot4

Features

Already implemented:

  • Impulse-based rigid body dynamics with iterative SI solver
  • High-performance collision detection (MPR algorithm)
  • Basic geometry shapes (sphere, box, cylinder, cone, ellipsoid)
  • Support for any convex shape defined by support mapping
  • Multiple geometries per body
  • Arbitrary static trimeshes (collision detection is optimized via BVH)
  • Body constraints: distance, angular, slider, ball-socket, prismatic, hinge
  • Persistent contact cache
  • Ray cast support
  • Partial C API (will be finished soon)

Planned in future:

  • More shapes (capsule, plane, convex hull, etc.)
  • Minkowski sum shape
  • Force fields
  • Convex cast
  • In long-term: vehicle engine, particles, soft-body physics, OpenCL support

Dependencies

dmech heavily relies on dlib - a collection of utility libraries for D, including linear math and computational geometry functionality (it is recommended to use master, because dmech usually depends on latest repository changes).

Documentation

See tutorials.

Usage examples

See demos/new directory. All examples use DGL for rendering.

For real-world usage demo, check out Atrium, a physics-based action game.

License

Copyright (c) 2013-2015 Timur Gafarov. Distributed under the Boost Software License, Version 1.0. (See accompanying file COPYING or at http://www.boost.org/LICENSE10.txt)

Available versions

0.3.0 0.2.6 0.2.5 0.2.4 0.2.3 0.2.2 0.2.1 0.2.0 0.1.1 0.0.1 ~master