-
Notifications
You must be signed in to change notification settings - Fork 0
Physics World
Description of the PhysicsWorld
manager. Uses the Bullet Physics Engine.
Currently only rigid bodies are supported. If a rigid body has a mass of 0 it will act as a static body. This means that other physics objects will be able to collide in it, but it will not move. A RigidBody
can have different collision shapes: a box, a sphere, a cylinder, a capsule, a cone, a convex hull (loaded from a model file) or a concave hull (loaded from a model file).
More functionality will be added on the future such as infinite planes, height maps, soft bodies and more.
Note: currently the concave hull crashes! Needs to be fixed, use a convex hull instead (and is faster too)
For more information please refer to the Official Bullet Physics site.
It creates a btDbvtBroadphase
, btDefaultCollisionConfiguration
, btCollisionDispatcher
, btSequentialImpulseConstraintSolver
finally a btDiscreteDynamicsWorld
. All the btCollisionShape
s and btRigidBody
s are added by each Component
when created.
It iterates over all the stored btRigidBody
s and btCollisionShape
s and destroys them. It then destroys the rest of the allocated memory used to create the btDiscreteDynamicsWorld
.
Each frame, the stepSimulation
function is called. It updates the internal physics simulation by the elapsed time. It then has to iterate over all the btRigidBody
s and update the corresponding Entity
's absolute position and absolute orientation. It only updates it if the btRigidBody
is active, if it is asleep it skips it.