角色控制讲的很少,基本没有实质性内容。
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.
- github上有一个角色控制器的用法示例:
https://github.com/1vanK/Urho3DKinematicCharacterController/blob/master/CharacterController.cpp - panda引擎也直接暴露了角色控制器的API:
https://docs.panda3d.org/1.10/python/programming/physics/bullet/character-controller