bullet物理引擎(5) 角色控制器(Charactor Controller)


A player or NPC character can be constructed using a capsule shape, sphere or other shape. To avoid
rotation, you can set the ‘angular factor’ to zero, which disables the angular rotation effect during
collisions and other constraints. See btRigidBody::setAngularFactor. Other options (that are
less recommended) include setting the inverse inertia tensor to zero for the up axis, or using a
angular-only hinge constraint.

There is also an experimental3 btKinematicCharacterController as an example a non-physical
character controller. It uses a btGhostShape to perform collision queries to create a character that
can climb stairs, slide smoothly along walls etc. See src/BulletDynamics/Character and
Demos/CharacterDemo for its usage.




26 − = 24