Blender V2.61 - r43446
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

btKinematicCharacterController Class Reference

#include <btKinematicCharacterController.h>

Inheritance diagram for btKinematicCharacterController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 btKinematicCharacterController (btPairCachingGhostObject *ghostObject, btConvexShape *convexShape, btScalar stepHeight, int upAxis=1)
 ~btKinematicCharacterController ()
virtual void updateAction (btCollisionWorld *collisionWorld, btScalar deltaTime)
 btActionInterface interface
void debugDraw (btIDebugDraw *debugDrawer)
 btActionInterface interface
void setUpAxis (int axis)
virtual void setWalkDirection (const btVector3 &walkDirection)
virtual void setVelocityForTimeInterval (const btVector3 &velocity, btScalar timeInterval)
void reset ()
void warp (const btVector3 &origin)
void preStep (btCollisionWorld *collisionWorld)
void playerStep (btCollisionWorld *collisionWorld, btScalar dt)
void setFallSpeed (btScalar fallSpeed)
void setJumpSpeed (btScalar jumpSpeed)
void setMaxJumpHeight (btScalar maxJumpHeight)
bool canJump () const
void jump ()
void setGravity (btScalar gravity)
btScalar getGravity () const
void setMaxSlope (btScalar slopeRadians)
btScalar getMaxSlope () const
btPairCachingGhostObjectgetGhostObject ()
void setUseGhostSweepTest (bool useGhostObjectSweepTest)
bool onGround () const

Protected Member Functions

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)

Static Protected Member Functions

static btVector3 * getUpAxisDirections ()

Protected Attributes

btScalar m_halfHeight
btPairCachingGhostObjectm_ghostObject
btConvexShape * m_convexShape
btScalar m_verticalVelocity
btScalar m_verticalOffset
btScalar m_fallSpeed
btScalar m_jumpSpeed
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
btVector3 m_normalizedDirection
btVector3 m_currentPosition
btScalar m_currentStepOffset
btVector3 m_targetPosition
btManifoldArray m_manifoldArray
 keep track of the contact manifolds
bool m_touchingContact
btVector3 m_touchingNormal
bool m_wasOnGround
bool m_wasJumping
bool m_useGhostObjectSweepTest
bool m_useWalkDirection
btScalar m_velocityTimeInterval
int m_upAxis

Detailed Description

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.


Constructor & Destructor Documentation

btKinematicCharacterController::btKinematicCharacterController ( btPairCachingGhostObject ghostObject,
btConvexShape *  convexShape,
btScalar  stepHeight,
int  upAxis = 1 
)
btKinematicCharacterController::~btKinematicCharacterController ( )

Definition at line 152 of file btKinematicCharacterController.cpp.


Member Function Documentation

bool btKinematicCharacterController::canJump ( ) const [virtual]

Implements btCharacterControllerInterface.

Definition at line 581 of file btKinematicCharacterController.cpp.

References onGround().

Referenced by jump().

btVector3 btKinematicCharacterController::computeReflectionDirection ( const btVector3 &  direction,
const btVector3 &  normal 
) [protected]
void btKinematicCharacterController::debugDraw ( btIDebugDraw debugDrawer) [virtual]

btActionInterface interface

Implements btActionInterface.

Definition at line 639 of file btKinematicCharacterController.cpp.

btPairCachingGhostObject * btKinematicCharacterController::getGhostObject ( )

Definition at line 156 of file btKinematicCharacterController.cpp.

References m_ghostObject.

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

btScalar btKinematicCharacterController::getGravity ( ) const

Definition at line 610 of file btKinematicCharacterController.cpp.

References m_gravity.

btScalar btKinematicCharacterController::getMaxSlope ( ) const

Definition at line 621 of file btKinematicCharacterController.cpp.

References m_maxSlopeRadians.

btVector3 * btKinematicCharacterController::getUpAxisDirections ( ) [static, protected]

Definition at line 632 of file btKinematicCharacterController.cpp.

Referenced by stepDown(), and stepUp().

void btKinematicCharacterController::jump ( ) [virtual]
bool btKinematicCharacterController::onGround ( ) const [virtual]

Implements btCharacterControllerInterface.

Definition at line 626 of file btKinematicCharacterController.cpp.

References m_verticalOffset, and m_verticalVelocity.

Referenced by canJump(), and playerStep().

btVector3 btKinematicCharacterController::parallelComponent ( const btVector3 &  direction,
const btVector3 &  normal 
) [protected]
btVector3 btKinematicCharacterController::perpindicularComponent ( const btVector3 &  direction,
const btVector3 &  normal 
) [protected]
void btKinematicCharacterController::playerStep ( btCollisionWorld collisionWorld,
btScalar  dt 
) [virtual]
void btKinematicCharacterController::preStep ( btCollisionWorld collisionWorld) [virtual]
bool btKinematicCharacterController::recoverFromPenetration ( btCollisionWorld collisionWorld) [protected]
void btKinematicCharacterController::reset ( ) [virtual]
void btKinematicCharacterController::setFallSpeed ( btScalar  fallSpeed)

Definition at line 566 of file btKinematicCharacterController.cpp.

References m_fallSpeed.

void btKinematicCharacterController::setGravity ( btScalar  gravity)

Definition at line 605 of file btKinematicCharacterController.cpp.

References m_gravity.

void btKinematicCharacterController::setJumpSpeed ( btScalar  jumpSpeed)

Definition at line 571 of file btKinematicCharacterController.cpp.

References m_jumpSpeed.

void btKinematicCharacterController::setMaxJumpHeight ( btScalar  maxJumpHeight)

Definition at line 576 of file btKinematicCharacterController.cpp.

References m_maxJumpHeight.

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 615 of file btKinematicCharacterController.cpp.

References btCos(), m_maxSlopeCosine, and m_maxSlopeRadians.

Referenced by btKinematicCharacterController().

void btKinematicCharacterController::setUpAxis ( int  axis) [inline]

Definition at line 108 of file btKinematicCharacterController.h.

References m_upAxis.

void btKinematicCharacterController::setUseGhostSweepTest ( bool  useGhostObjectSweepTest) [inline]

Definition at line 154 of file btKinematicCharacterController.h.

References m_useGhostObjectSweepTest.

void btKinematicCharacterController::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.

Implements btCharacterControllerInterface.

Definition at line 452 of file btKinematicCharacterController.cpp.

References getNormalizedVector().

void btKinematicCharacterController::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().

Implements btCharacterControllerInterface.

Definition at line 440 of file btKinematicCharacterController.cpp.

References getNormalizedVector().

void btKinematicCharacterController::stepDown ( btCollisionWorld collisionWorld,
btScalar  dt 
) [protected]
void btKinematicCharacterController::stepForwardAndStrafe ( btCollisionWorld collisionWorld,
const btVector3 &  walkMove 
) [protected]
void btKinematicCharacterController::stepUp ( btCollisionWorld collisionWorld) [protected]
virtual void btKinematicCharacterController::updateAction ( btCollisionWorld collisionWorld,
btScalar  deltaTime 
) [inline, virtual]

btActionInterface interface

Implements btActionInterface.

Definition at line 99 of file btKinematicCharacterController.h.

References playerStep(), and preStep().

void btKinematicCharacterController::updateTargetPositionBasedOnCollision ( const btVector3 &  hit_normal,
btScalar  tangentMag = btScalar(0.0),
btScalar  normalMag = btScalar(1.0) 
) [protected]
void btKinematicCharacterController::warp ( const btVector3 &  origin) [virtual]

Member Data Documentation

Definition at line 66 of file btKinematicCharacterController.h.

Referenced by stepDown(), and stepUp().

Definition at line 40 of file btKinematicCharacterController.h.

keep track of the contact manifolds

Definition at line 70 of file btKinematicCharacterController.h.

Referenced by recoverFromPenetration().

Definition at line 49 of file btKinematicCharacterController.h.

Referenced by setMaxJumpHeight().

Definition at line 51 of file btKinematicCharacterController.h.

Referenced by setMaxSlope(), and stepDown().

Definition at line 50 of file btKinematicCharacterController.h.

Referenced by getMaxSlope(), and setMaxSlope().

Definition at line 62 of file btKinematicCharacterController.h.

Referenced by stepForwardAndStrafe().

Definition at line 72 of file btKinematicCharacterController.h.

Referenced by preStep(), and stepForwardAndStrafe().

Definition at line 54 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController().

Definition at line 78 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController(), and playerStep().

Definition at line 79 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController(), and playerStep().

this is the desired walk direction, set by the user

Definition at line 61 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController(), and playerStep().

Definition at line 76 of file btKinematicCharacterController.h.

Referenced by btKinematicCharacterController(), jump(), and stepDown().


The documentation for this class was generated from the following files: