Blender  V3.3
Functions | Variables
btKinematicCharacterController.h File Reference
#include "LinearMath/btVector3.h"
#include "btCharacterControllerInterface.h"
#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"

Go to the source code of this file.

Functions

static btVector3getUpAxisDirections ()
 
btVector3 computeReflectionDirection (const btVector3 &direction, const btVector3 &normal)
 
btVector3 parallelComponent (const btVector3 &direction, const btVector3 &normal)
 
btVector3 perpindicularComponent (const btVector3 &direction, const btVector3 &normal)
 
bool recoverFromPenetration (btCollisionWorld *collisionWorld)
 
void stepUp (btCollisionWorld *collisionWorld)
 
void updateTargetPositionBasedOnCollision (const btVector3 &hit_normal, btScalar tangentMag=btScalar(0.0), btScalar normalMag=btScalar(1.0))
 
void stepForwardAndStrafe (btCollisionWorld *collisionWorld, const btVector3 &walkMove)
 
void stepDown (btCollisionWorld *collisionWorld, btScalar dt)
 
virtual bool needsCollision (const btCollisionObject *body0, const btCollisionObject *body1)
 
void setUpVector (const btVector3 &up)
 
btQuaternion getRotation (btVector3 &v0, btVector3 &v1) const
 
 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
 btKinematicCharacterController (btPairCachingGhostObject *ghostObject, btConvexShape *convexShape, btScalar stepHeight, const btVector3 &up=btVector3(1.0, 0.0, 0.0))
 
 ~btKinematicCharacterController ()
 
virtual void updateAction (btCollisionWorld *collisionWorld, btScalar deltaTime)
 btActionInterface interface More...
 
void debugDraw (btIDebugDraw *debugDrawer)
 btActionInterface interface More...
 
void setUp (const btVector3 &up)
 
const btVector3getUp ()
 
virtual void setWalkDirection (const btVector3 &walkDirection)
 
virtual void setVelocityForTimeInterval (const btVector3 &velocity, btScalar timeInterval)
 
virtual void setAngularVelocity (const btVector3 &velocity)
 
virtual const btVector3getAngularVelocity () const
 
virtual void setLinearVelocity (const btVector3 &velocity)
 
virtual btVector3 getLinearVelocity () const
 
void setLinearDamping (btScalar d)
 
btScalar getLinearDamping () const
 
void setAngularDamping (btScalar d)
 
btScalar getAngularDamping () const
 
void reset (btCollisionWorld *collisionWorld)
 
void warp (const btVector3 &origin)
 
void preStep (btCollisionWorld *collisionWorld)
 
void playerStep (btCollisionWorld *collisionWorld, btScalar dt)
 
void setStepHeight (btScalar h)
 
btScalar getStepHeight () const
 
void setFallSpeed (btScalar fallSpeed)
 
btScalar getFallSpeed () const
 
void setJumpSpeed (btScalar jumpSpeed)
 
btScalar getJumpSpeed () const
 
void setMaxJumpHeight (btScalar maxJumpHeight)
 
bool canJump () const
 
void jump (const btVector3 &v=btVector3(0, 0, 0))
 
void applyImpulse (const btVector3 &v)
 
void setGravity (const btVector3 &gravity)
 
btVector3 getGravity () const
 
void setMaxSlope (btScalar slopeRadians)
 
btScalar getMaxSlope () const
 
void setMaxPenetrationDepth (btScalar d)
 
btScalar getMaxPenetrationDepth () const
 
btPairCachingGhostObjectgetGhostObject ()
 
void setUseGhostSweepTest (bool useGhostObjectSweepTest)
 
bool onGround () const
 
void setUpInterpolate (bool value)
 

Variables

btKinematicCharacterController __pad0__
 
btPairCachingGhostObjectm_ghostObject
 
btConvexShapem_convexShape
 
btScalar m_maxPenetrationDepth
 
btScalar m_verticalVelocity
 
btScalar m_verticalOffset
 
btScalar m_fallSpeed
 
btScalar m_jumpSpeed
 
btScalar m_SetjumpSpeed
 
btScalar m_maxJumpHeight
 
btScalar m_maxSlopeRadians
 
btScalar m_maxSlopeCosine
 
btScalar m_gravity
 
btScalar m_turnAngle
 
btScalar m_stepHeight
 
btScalar m_addedMargin
 
btVector3 m_walkDirection
 this is the desired walk direction, set by the user More...
 
btVector3 m_normalizedDirection
 
btVector3 m_AngVel
 
btVector3 m_jumpPosition
 
btVector3 m_currentPosition
 
btScalar m_currentStepOffset
 
btVector3 m_targetPosition
 
btQuaternion m_currentOrientation
 
btQuaternion m_targetOrientation
 
btManifoldArray m_manifoldArray
 keep track of the contact manifolds More...
 
bool m_touchingContact
 
btVector3 m_touchingNormal
 
btScalar m_linearDamping
 
btScalar m_angularDamping
 
bool m_wasOnGround
 
bool m_wasJumping
 
bool m_useGhostObjectSweepTest
 
bool m_useWalkDirection
 
btScalar m_velocityTimeInterval
 
btVector3 m_up
 
btVector3 m_jumpAxis
 
bool m_interpolateUp
 
bool full_drop
 
bool bounce_fix
 

Function Documentation

◆ applyImpulse()

void applyImpulse ( const btVector3 v)

Definition at line 177 of file btKinematicCharacterController.h.

References jump(), and v.

◆ BT_DECLARE_ALIGNED_ALLOCATOR()

BT_DECLARE_ALIGNED_ALLOCATOR ( )

◆ btKinematicCharacterController()

btKinematicCharacterController::btKinematicCharacterController ( btPairCachingGhostObject ghostObject,
btConvexShape convexShape,
btScalar  stepHeight,
const btVector3 up = btVector3(1.0, 0.0, 0.0) 
)

◆ canJump()

bool canJump ( ) const

◆ computeReflectionDirection()

btVector3 btKinematicCharacterController::computeReflectionDirection ( const btVector3 direction,
const btVector3 normal 
)

Definition at line 112 of file btKinematicCharacterController.cpp.

References normal.

Referenced by updateTargetPositionBasedOnCollision().

◆ debugDraw()

void debugDraw ( btIDebugDraw debugDrawer)

◆ getAngularDamping()

btScalar getAngularDamping ( ) const

Definition at line 158 of file btKinematicCharacterController.h.

References m_angularDamping.

◆ getAngularVelocity()

virtual const btVector3& getAngularVelocity ( ) const
virtual

◆ getFallSpeed()

btScalar getFallSpeed ( ) const

Definition at line 169 of file btKinematicCharacterController.h.

References m_fallSpeed.

◆ getGhostObject()

btPairCachingGhostObject * btKinematicCharacterController::getGhostObject ( )

Definition at line 172 of file btKinematicCharacterController.cpp.

References m_ghostObject.

Referenced by stepDown(), stepForwardAndStrafe(), and stepUp().

◆ getGravity()

btVector3 getGravity ( ) const

◆ getJumpSpeed()

btScalar getJumpSpeed ( ) const

Definition at line 171 of file btKinematicCharacterController.h.

References m_jumpSpeed.

◆ getLinearDamping()

btScalar getLinearDamping ( ) const

Definition at line 156 of file btKinematicCharacterController.h.

References m_linearDamping.

◆ getLinearVelocity()

virtual btVector3 getLinearVelocity ( ) const
virtual

◆ getMaxPenetrationDepth()

btScalar btKinematicCharacterController::getMaxPenetrationDepth ( ) const

Definition at line 922 of file btKinematicCharacterController.cpp.

References m_maxPenetrationDepth.

◆ getMaxSlope()

btScalar btKinematicCharacterController::getMaxSlope ( ) const

Definition at line 912 of file btKinematicCharacterController.cpp.

References m_maxSlopeRadians.

◆ getRotation()

btQuaternion btKinematicCharacterController::getRotation ( btVector3 v0,
btVector3 v1 
) const

Definition at line 987 of file btKinematicCharacterController.cpp.

References shortestArcQuatNormalize2(), and v1.

Referenced by setUpVector().

◆ getStepHeight()

btScalar getStepHeight ( ) const

Definition at line 167 of file btKinematicCharacterController.h.

References m_stepHeight.

◆ getUp()

const btVector3& getUp ( )

Definition at line 132 of file btKinematicCharacterController.h.

References m_up.

◆ getUpAxisDirections()

btVector3 * btKinematicCharacterController::getUpAxisDirections ( )
static

Definition at line 937 of file btKinematicCharacterController.cpp.

References btVector3.

◆ jump()

void jump ( const btVector3 v = btVector3(0, 0, 0))

◆ needsCollision()

virtual bool needsCollision ( const btCollisionObject body0,
const btCollisionObject body1 
)
virtual

◆ onGround()

bool onGround ( ) const

◆ parallelComponent()

btVector3 btKinematicCharacterController::parallelComponent ( const btVector3 direction,
const btVector3 normal 
)

◆ perpindicularComponent()

btVector3 btKinematicCharacterController::perpindicularComponent ( const btVector3 direction,
const btVector3 normal 
)

◆ playerStep()

void playerStep ( btCollisionWorld collisionWorld,
btScalar  dt 
)

Referenced by updateAction().

◆ preStep()

void preStep ( btCollisionWorld collisionWorld)

Referenced by updateAction().

◆ recoverFromPenetration()

bool btKinematicCharacterController::recoverFromPenetration ( btCollisionWorld collisionWorld)

◆ reset()

void reset ( btCollisionWorld collisionWorld)

◆ setAngularDamping()

void setAngularDamping ( btScalar  d)

Definition at line 157 of file btKinematicCharacterController.h.

References btClamped(), and m_angularDamping.

◆ setAngularVelocity()

virtual void setAngularVelocity ( const btVector3 velocity)
virtual

◆ setFallSpeed()

void btKinematicCharacterController::setFallSpeed ( btScalar  fallSpeed)

Definition at line 852 of file btKinematicCharacterController.cpp.

References m_fallSpeed.

◆ setGravity()

void setGravity ( const btVector3 gravity)

Referenced by setUp().

◆ setJumpSpeed()

void btKinematicCharacterController::setJumpSpeed ( btScalar  jumpSpeed)

Definition at line 857 of file btKinematicCharacterController.cpp.

References m_jumpSpeed, and m_SetjumpSpeed.

◆ setLinearDamping()

void setLinearDamping ( btScalar  d)

Definition at line 155 of file btKinematicCharacterController.h.

References btClamped(), and m_linearDamping.

◆ setLinearVelocity()

virtual void setLinearVelocity ( const btVector3 velocity)
virtual

◆ setMaxJumpHeight()

void btKinematicCharacterController::setMaxJumpHeight ( btScalar  maxJumpHeight)

Definition at line 863 of file btKinematicCharacterController.cpp.

References m_maxJumpHeight.

◆ setMaxPenetrationDepth()

void btKinematicCharacterController::setMaxPenetrationDepth ( btScalar  d)

Definition at line 917 of file btKinematicCharacterController.cpp.

References m_maxPenetrationDepth.

◆ setMaxSlope()

void btKinematicCharacterController::setMaxSlope ( btScalar  slopeRadians)

The max slope determines the maximum angle that the controller can walk up. The slope angle is measured in radians.

Definition at line 906 of file btKinematicCharacterController.cpp.

References btCos(), m_maxSlopeCosine, and m_maxSlopeRadians.

Referenced by btKinematicCharacterController().

◆ setStepHeight()

void btKinematicCharacterController::setStepHeight ( btScalar  h)

Definition at line 932 of file btKinematicCharacterController.cpp.

References m_stepHeight.

Referenced by btKinematicCharacterController().

◆ setUp()

void btKinematicCharacterController::setUp ( const btVector3 up)

◆ setUpInterpolate()

void setUpInterpolate ( bool  value)

◆ setUpVector()

void btKinematicCharacterController::setUpVector ( const btVector3 up)

Definition at line 964 of file btKinematicCharacterController.cpp.

References btTransform, btVector3, getRotation(), m_ghostObject, m_up, and rot.

Referenced by setUp().

◆ setUseGhostSweepTest()

void setUseGhostSweepTest ( bool  useGhostObjectSweepTest)

Definition at line 191 of file btKinematicCharacterController.h.

References m_useGhostObjectSweepTest.

◆ setVelocityForTimeInterval()

virtual void setVelocityForTimeInterval ( const btVector3 velocity,
btScalar  timeInterval 
)
virtual

Caller provides a velocity with which the character should move for the given time period. After the time period, velocity is reset to zero. This call will reset any walk direction set by setWalkDirection(). Negative time intervals will result in no motion.

◆ setWalkDirection()

virtual void setWalkDirection ( const btVector3 walkDirection)
virtual

This should probably be called setPositionIncrementPerSimulatorStep. This is neither a direction nor a velocity, but the amount to increment the position each simulation iteration, regardless of dt. This call will reset any velocity set by setVelocityForTimeInterval().

◆ stepDown()

void btKinematicCharacterController::stepDown ( btCollisionWorld collisionWorld,
btScalar  dt 
)

◆ stepForwardAndStrafe()

void btKinematicCharacterController::stepForwardAndStrafe ( btCollisionWorld collisionWorld,
const btVector3 walkMove 
)

◆ stepUp()

void btKinematicCharacterController::stepUp ( btCollisionWorld collisionWorld)

◆ updateAction()

virtual void updateAction ( btCollisionWorld collisionWorld,
btScalar  deltaTime 
)
virtual

btActionInterface interface

Definition at line 121 of file btKinematicCharacterController.h.

References playerStep(), and preStep().

◆ updateTargetPositionBasedOnCollision()

void btKinematicCharacterController::updateTargetPositionBasedOnCollision ( const btVector3 hit_normal,
btScalar  tangentMag = btScalar(0.0),
btScalar  normalMag = btScalar(1.0) 
)

◆ warp()

void warp ( const btVector3 origin)

◆ ~btKinematicCharacterController()

btKinematicCharacterController::~btKinematicCharacterController ( )

Definition at line 168 of file btKinematicCharacterController.cpp.

Variable Documentation

◆ __pad0__

btKinematicCharacterController is an object that supports a sliding motion in a world. It uses a ghost object and convex sweep test to test for upcoming collisions. This is combined with discrete collision detection to recover from penetrations. Interaction between btKinematicCharacterController and dynamic rigid bodies needs to be explicity implemented by the user.

Definition at line 36 of file btKinematicCharacterController.h.

◆ bounce_fix

bool bounce_fix

Definition at line 96 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController(), and stepDown().

◆ full_drop

bool full_drop

Definition at line 95 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController(), and stepDown().

◆ m_addedMargin

btScalar m_addedMargin

◆ m_angularDamping

btScalar m_angularDamping

◆ m_AngVel

btVector3 m_AngVel

Definition at line 64 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController().

◆ m_convexShape

btConvexShape* m_convexShape

◆ m_currentOrientation

btQuaternion m_currentOrientation

Definition at line 73 of file btKinematicCharacterController.h.

Referenced by stepDown(), stepForwardAndStrafe(), and stepUp().

◆ m_currentPosition

btVector3 m_currentPosition

◆ m_currentStepOffset

btScalar m_currentStepOffset

◆ m_fallSpeed

btScalar m_fallSpeed

◆ m_ghostObject

btPairCachingGhostObject* m_ghostObject

◆ m_gravity

btScalar m_gravity

◆ m_interpolateUp

bool m_interpolateUp

Definition at line 94 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController(), and stepUp().

◆ m_jumpAxis

btVector3 m_jumpAxis

Definition at line 91 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController(), and stepUp().

◆ m_jumpPosition

btVector3 m_jumpPosition

Definition at line 66 of file btKinematicCharacterController.h.

◆ m_jumpSpeed

btScalar m_jumpSpeed

◆ m_linearDamping

btScalar m_linearDamping

◆ m_manifoldArray

btManifoldArray m_manifoldArray

keep track of the contact manifolds

Definition at line 77 of file btKinematicCharacterController.h.

Referenced by recoverFromPenetration().

◆ m_maxJumpHeight

btScalar m_maxJumpHeight

Definition at line 50 of file btKinematicCharacterController.h.

Referenced by setMaxJumpHeight().

◆ m_maxPenetrationDepth

btScalar m_maxPenetrationDepth

◆ m_maxSlopeCosine

btScalar m_maxSlopeCosine

Definition at line 52 of file btKinematicCharacterController.h.

Referenced by setMaxSlope(), stepDown(), and stepUp().

◆ m_maxSlopeRadians

btScalar m_maxSlopeRadians

Definition at line 51 of file btKinematicCharacterController.h.

Referenced by getMaxSlope(), and setMaxSlope().

◆ m_normalizedDirection

btVector3 m_normalizedDirection

Definition at line 63 of file btKinematicCharacterController.h.

Referenced by stepForwardAndStrafe().

◆ m_SetjumpSpeed

btScalar m_SetjumpSpeed

◆ m_stepHeight

btScalar m_stepHeight

Definition at line 57 of file btKinematicCharacterController.h.

Referenced by getStepHeight(), setStepHeight(), stepDown(), and stepUp().

◆ m_targetOrientation

btQuaternion m_targetOrientation

Definition at line 74 of file btKinematicCharacterController.h.

Referenced by stepDown(), stepForwardAndStrafe(), and stepUp().

◆ m_targetPosition

btVector3 m_targetPosition

◆ m_touchingContact

bool m_touchingContact

Definition at line 79 of file btKinematicCharacterController.h.

Referenced by stepUp().

◆ m_touchingNormal

btVector3 m_touchingNormal

Definition at line 80 of file btKinematicCharacterController.h.

◆ m_turnAngle

btScalar m_turnAngle

Definition at line 55 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController().

◆ m_up

btVector3 m_up

◆ m_useGhostObjectSweepTest

bool m_useGhostObjectSweepTest

◆ m_useWalkDirection

bool m_useWalkDirection

Definition at line 88 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController().

◆ m_velocityTimeInterval

btScalar m_velocityTimeInterval

Definition at line 89 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController().

◆ m_verticalOffset

btScalar m_verticalOffset

◆ m_verticalVelocity

btScalar m_verticalVelocity

◆ m_walkDirection

btVector3 m_walkDirection

this is the desired walk direction, set by the user

Definition at line 62 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController().

◆ m_wasJumping

bool m_wasJumping

Definition at line 86 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController(), and stepDown().

◆ m_wasOnGround

bool m_wasOnGround

Definition at line 85 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController(), and stepDown().