编程文汇

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.