Actors come in three flavours:
Static actors represent containers of collision shapes. Movable actors represent positionable containers of collision shapes. Dynamic actors represent physical bodies that react to collisions while both static and movable actors take part in collisions but do not react to them.
Static and movable actors are often used for the static environment (terrain, buildings etc) while movable actors can be used for representing moving objects that do not have to react to collisions (e.g. elevators). They are also used to simulate moving objects of very large masses. Dynamic actors are often used for small and mid-scale objects (e.g. vehicles, small objects like boxes etc).
Example: Let's create a dynamic actor.
IActorPtr pActor = pPhysicsWorld->createActor( ACTOR_DYNAMIC );
Example: Let's move it. We set a linear velocity of 2 units / second along the global x axis.
pActor->getBody().setLinearVelocity( Vector3::kUnitX * 2. );
Example: Let's apply a force.
// We use Y as our global "up" vector and thus add a force "downwards" like gravity. // Note that you can control the global gravity via physics::IWorld! pActor->getBody().addForce( Vector3::kUnitY * (-9.81) );
Of course you can execute various operations on dynamic actors (apply forces, apply torques etc). Have a look at the API for the details.
Shapes are geometric objects which are used for the spatial representation of physical bodies (aka actors).
The most common ones are spheres, boxes, cylinders (in various flavours), planes and triangle meshes. Some physics engines provide additional types like voxel objects (Novodex, for example).
Shapes are managed by the actor they belong to. You can access them to retrieve information, though.
Example: Add a sphere shape to an actor.
IShapePtr pShape = pActor->createShape( IShape::SphereDesc( 1.4 /*radius*/ ) );
Example: Add a sphere shape to an actor, use a non-default material and offset it relative to the actor.
IShapePtr pShape = pActor->createShape( IShape::SphereDesc( 1.4 /*radius*/, "softMaterial", Vector3(0,1,0) ) );