| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #ifndef ANKI_PHYSICS_CHARACTER_H
- #define ANKI_PHYSICS_CHARACTER_H
- #include "anki/Math.h"
- #include <memory>
- class btPairCachingGhostObject;
- class btConvexShape;
- class btKinematicCharacterController;
- class btGhostPairCallback;
- namespace anki {
- class MoveComponent;
- class PhysWorld;
- class MotionState;
- /// Its basically a wrapper around bullet character
- class Character
- {
- friend class PhysWorld;
- public:
- /// Initializer class
- struct Initializer
- {
- F32 characterHeight;
- F32 characterWidth;
- F32 stepHeight;
- F32 jumpSpeed;
- F32 maxJumpHeight;
- MoveComponent* movable; ///< For the MotionState
- Transform startTrf;
- Initializer();
- };
- Character(PhysWorld* masterContainer, const Initializer& init);
- ~Character();
- void rotate(F32 angle);
- void moveForward(F32 distance);
- void jump();
- private:
- PhysWorld* masterContainer; ///< Know your father
- btPairCachingGhostObject* ghostObject;
- btConvexShape* convexShape;
- btKinematicCharacterController* character;
- btGhostPairCallback* ghostPairCallback;
- std::unique_ptr<MotionState> motionState;
- };
- } // end namespace
- #endif
|