24 #ifndef RADIX_KINEMATIC_CHARACTER_CONTROLLER_HPP
25 #define RADIX_KINEMATIC_CHARACTER_CONTROLLER_HPP
27 #include <bullet/LinearMath/btVector3.h>
28 #include <bullet/BulletDynamics/Character/btCharacterControllerInterface.h>
29 #include <bullet/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h>
32 class btCollisionShape;
35 class btCollisionWorld;
36 class btCollisionDispatcher;
37 class btPairCachingGhostObject;
103 void stepUp(btCollisionWorld* collisionWorld);
105 btScalar tangentMag = btScalar(0.0), btScalar normalMag = btScalar(1.0));
107 void stepDown(btCollisionWorld* collisionWorld, btScalar dt);
113 btScalar stepHeight,
int upAxis = 1);
118 virtual void updateAction(btCollisionWorld* collisionWorld, btScalar deltaTime) {
124 void debugDraw(btIDebugDraw* debugDrawer);
129 }
else if (axis > 2) {
148 btScalar timeInterval);
150 void reset(btCollisionWorld* collisionWorld );
151 void warp(
const btVector3& origin);
153 void preStep( btCollisionWorld* collisionWorld);
154 void playerStep(btCollisionWorld* collisionWorld, btScalar dt);
161 void jump(
const btVector3& dir = btVector3());
173 m_useGhostObjectSweepTest = useGhostObjectSweepTest;
bool m_wasJumping
Definition: KinematicCharacterController.hpp:87
bool m_useGhostObjectSweepTest
Definition: KinematicCharacterController.hpp:88
Definition: GameController.hpp:7
bool m_touchingContact
Definition: KinematicCharacterController.hpp:83
btScalar m_halfHeight
Definition: KinematicCharacterController.hpp:49
KinematicCharacterController(btPairCachingGhostObject *ghostObject, btConvexShape *convexShape, btScalar stepHeight, int upAxis=1)
Definition: KinematicCharacterController.cpp:160
~KinematicCharacterController()
Definition: KinematicCharacterController.cpp:188
bool onGround() const
Definition: KinematicCharacterController.cpp:724
int m_upAxis
Definition: KinematicCharacterController.hpp:91
btScalar m_maxSlopeRadians
Definition: KinematicCharacterController.hpp:60
virtual void setVelocityForTimeInterval(const btVector3 &velocity, btScalar timeInterval)
Caller provides a velocity with which the character should move for the given time period...
Definition: KinematicCharacterController.cpp:591
virtual void setWalkDirection(const btVector3 &walkDirection)
This should probably be called setPositionIncrementPerSimulatorStep.
Definition: KinematicCharacterController.cpp:585
btVector3 m_normalizedDirection
Definition: KinematicCharacterController.hpp:73
btScalar m_addedMargin
Definition: KinematicCharacterController.hpp:69
btScalar getGravity() const
Definition: KinematicCharacterController.cpp:711
bool m_interpolateUp
Definition: KinematicCharacterController.hpp:94
void updateTargetPositionBasedOnCollision(const btVector3 &hit_normal, btScalar tangentMag=btScalar(0.0), btScalar normalMag=btScalar(1.0))
Definition: KinematicCharacterController.cpp:331
static btVector3 * getUpAxisDirections()
Definition: KinematicCharacterController.cpp:729
btScalar m_verticalVelocity
Definition: KinematicCharacterController.hpp:55
btVector3 m_walkDirection
this is the desired walk direction, set by the user
Definition: KinematicCharacterController.hpp:72
btScalar m_jumpSpeed
Definition: KinematicCharacterController.hpp:58
void preStep(btCollisionWorld *collisionWorld)
Definition: KinematicCharacterController.cpp:624
void setUpAxis(int axis)
Definition: KinematicCharacterController.hpp:126
btVector3 perpindicularComponent(const btVector3 &direction, const btVector3 &normal)
Definition: KinematicCharacterController.cpp:154
void warp(const btVector3 &origin)
Definition: KinematicCharacterController.cpp:616
bool m_useWalkDirection
Definition: KinematicCharacterController.hpp:89
btVector3 parallelComponent(const btVector3 &direction, const btVector3 &normal)
Definition: KinematicCharacterController.cpp:144
btScalar m_velocityTimeInterval
Definition: KinematicCharacterController.hpp:90
btScalar m_turnAngle
Definition: KinematicCharacterController.hpp:65
btScalar getMaxSlope() const
Definition: KinematicCharacterController.cpp:720
void playerStep(btCollisionWorld *collisionWorld, btScalar dt)
Definition: KinematicCharacterController.cpp:639
btScalar m_fallSpeed
Definition: KinematicCharacterController.hpp:57
void setFallSpeed(btScalar fallSpeed)
Definition: KinematicCharacterController.cpp:682
btScalar m_maxJumpHeight
Definition: KinematicCharacterController.hpp:59
void debugDraw(btIDebugDraw *debugDrawer)
btActionInterface interface
Definition: KinematicCharacterController.cpp:736
btScalar m_maxSlopeCosine
Definition: KinematicCharacterController.hpp:61
BT_DECLARE_ALIGNED_ALLOCATOR()
bool full_drop
Definition: KinematicCharacterController.hpp:95
void stepForwardAndStrafe(btCollisionWorld *collisionWorld, const btVector3 &walkMove)
Definition: KinematicCharacterController.cpp:364
btVector3 m_targetPosition
Definition: KinematicCharacterController.hpp:78
void setGravity(btScalar gravity)
Definition: KinematicCharacterController.cpp:707
btVector3 m_touchingNormal
Definition: KinematicCharacterController.hpp:84
btScalar m_stepHeight
Definition: KinematicCharacterController.hpp:67
void setMaxSlope(btScalar slopeRadians)
The max slope determines the maximum angle that the controller can walk up.
Definition: KinematicCharacterController.cpp:715
btScalar m_currentStepOffset
Definition: KinematicCharacterController.hpp:77
bool bounce_fix
Definition: KinematicCharacterController.hpp:96
void setJumpSpeed(btScalar jumpSpeed)
Definition: KinematicCharacterController.cpp:686
void setUpInterpolate(bool value)
Definition: KinematicCharacterController.cpp:739
btPairCachingGhostObject * m_ghostObject
Definition: KinematicCharacterController.hpp:51
void setUseGhostSweepTest(bool useGhostObjectSweepTest)
Definition: KinematicCharacterController.hpp:172
void stepUp(btCollisionWorld *collisionWorld)
Definition: KinematicCharacterController.cpp:272
btScalar m_gravity
Definition: KinematicCharacterController.hpp:63
bool canJump() const
Definition: KinematicCharacterController.cpp:694
btVector3 m_currentPosition
Definition: KinematicCharacterController.hpp:76
bool m_wasOnGround
Definition: KinematicCharacterController.hpp:86
btVector3 computeReflectionDirection(const btVector3 &direction, const btVector3 &normal)
Definition: KinematicCharacterController.cpp:135
btPairCachingGhostObject * getGhostObject()
Definition: KinematicCharacterController.cpp:191
virtual void updateAction(btCollisionWorld *collisionWorld, btScalar deltaTime)
btActionInterface interface
Definition: KinematicCharacterController.hpp:118
void jump(const btVector3 &dir=btVector3())
Definition: KinematicCharacterController.cpp:698
btManifoldArray m_manifoldArray
keep track of the contact manifolds
Definition: KinematicCharacterController.hpp:81
void stepDown(btCollisionWorld *collisionWorld, btScalar dt)
Definition: KinematicCharacterController.cpp:448
btConvexShape * m_convexShape
Definition: KinematicCharacterController.hpp:52
void reset(btCollisionWorld *collisionWorld)
Definition: KinematicCharacterController.cpp:599
KinematicCharacterController is an object that supports a sliding motion in a world.
Definition: KinematicCharacterController.hpp:46
bool recoverFromPenetration(btCollisionWorld *collisionWorld)
Definition: KinematicCharacterController.cpp:195
btScalar m_verticalOffset
Definition: KinematicCharacterController.hpp:56
void setMaxJumpHeight(btScalar maxJumpHeight)
Definition: KinematicCharacterController.cpp:690