Changeset 8351 for code/trunk/src/external/bullet/BulletDynamics/Character/btKinematicCharacterController.h
- Timestamp:
- Apr 28, 2011, 7:15:14 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/external/bullet/BulletDynamics/Character/btKinematicCharacterController.h
r5781 r8351 14 14 */ 15 15 16 16 17 #ifndef KINEMATIC_CHARACTER_CONTROLLER_H 17 18 #define KINEMATIC_CHARACTER_CONTROLLER_H … … 20 21 21 22 #include "btCharacterControllerInterface.h" 23 24 #include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" 25 22 26 23 27 class btCollisionShape; … … 33 37 { 34 38 protected: 39 35 40 btScalar m_halfHeight; 36 41 … … 38 43 btConvexShape* m_convexShape;//is also in m_ghostObject, but it needs to be convex, so we store it here to avoid upcast 39 44 45 btScalar m_verticalVelocity; 46 btScalar m_verticalOffset; 40 47 btScalar m_fallSpeed; 41 48 btScalar m_jumpSpeed; 42 49 btScalar m_maxJumpHeight; 50 btScalar m_maxSlopeRadians; // Slope angle that is set (used for returning the exact value) 51 btScalar m_maxSlopeCosine; // Cosine equivalent of m_maxSlopeRadians (calculated once when set, for optimization) 52 btScalar m_gravity; 43 53 44 54 btScalar m_turnAngle; … … 50 60 ///this is the desired walk direction, set by the user 51 61 btVector3 m_walkDirection; 62 btVector3 m_normalizedDirection; 52 63 53 64 //some internal variables … … 62 73 btVector3 m_touchingNormal; 63 74 75 bool m_wasOnGround; 76 bool m_wasJumping; 64 77 bool m_useGhostObjectSweepTest; 78 bool m_useWalkDirection; 79 btScalar m_velocityTimeInterval; 80 int m_upAxis; 65 81 66 int m_upAxis;67 82 static btVector3* getUpAxisDirections(); 83 68 84 btVector3 computeReflectionDirection (const btVector3& direction, const btVector3& normal); 69 85 btVector3 parallelComponent (const btVector3& direction, const btVector3& normal); … … 99 115 } 100 116 101 virtual void setWalkDirection(const btVector3& walkDirection) 102 { 103 m_walkDirection = walkDirection; 104 } 117 /// This should probably be called setPositionIncrementPerSimulatorStep. 118 /// This is neither a direction nor a velocity, but the amount to 119 /// increment the position each simulation iteration, regardless 120 /// of dt. 121 /// This call will reset any velocity set by setVelocityForTimeInterval(). 122 virtual void setWalkDirection(const btVector3& walkDirection); 123 124 /// Caller provides a velocity with which the character should move for 125 /// the given time period. After the time period, velocity is reset 126 /// to zero. 127 /// This call will reset any walk direction set by setWalkDirection(). 128 /// Negative time intervals will result in no motion. 129 virtual void setVelocityForTimeInterval(const btVector3& velocity, 130 btScalar timeInterval); 105 131 106 132 void reset (); … … 114 140 void setMaxJumpHeight (btScalar maxJumpHeight); 115 141 bool canJump () const; 142 116 143 void jump (); 144 145 void setGravity(btScalar gravity); 146 btScalar getGravity() const; 147 148 /// The max slope determines the maximum angle that the controller can walk up. 149 /// The slope angle is measured in radians. 150 void setMaxSlope(btScalar slopeRadians); 151 btScalar getMaxSlope() const; 117 152 118 153 btPairCachingGhostObject* getGhostObject();
Note: See TracChangeset
for help on using the changeset viewer.