#include <btKinematicCharacterController.h>
Public Member Functions | |
btKinematicCharacterController (btPairCachingGhostObject *ghostObject, btConvexShape *convexShape, btScalar stepHeight, int upAxis=1) | |
bool | canJump () const |
void | debugDraw (btIDebugDraw *debugDrawer) |
btActionInterface interface | |
btPairCachingGhostObject * | getGhostObject () |
void | jump () |
bool | onGround () const |
void | playerStep (btCollisionWorld *collisionWorld, btScalar dt) |
void | preStep (btCollisionWorld *collisionWorld) |
void | reset () |
void | setFallSpeed (btScalar fallSpeed) |
void | setJumpSpeed (btScalar jumpSpeed) |
void | setMaxJumpHeight (btScalar maxJumpHeight) |
void | setUpAxis (int axis) |
void | setUseGhostSweepTest (bool useGhostObjectSweepTest) |
virtual void | setVelocityForTimeInterval (const btVector3 &velocity, btScalar timeInterval) |
virtual void | setWalkDirection (const btVector3 &walkDirection) |
virtual void | updateAction (btCollisionWorld *collisionWorld, btScalar deltaTime) |
btActionInterface interface | |
void | warp (const btVector3 &origin) |
~btKinematicCharacterController () | |
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 | stepDown (btCollisionWorld *collisionWorld, btScalar dt) |
void | stepForwardAndStrafe (btCollisionWorld *collisionWorld, const btVector3 &walkMove) |
void | stepUp (btCollisionWorld *collisionWorld) |
void | updateTargetPositionBasedOnCollision (const btVector3 &hit_normal, btScalar tangentMag=btScalar(0.0), btScalar normalMag=btScalar(1.0)) |
Static Protected Member Functions | |
static btVector3 * | getUpAxisDirections () |
Protected Attributes | |
btScalar | m_addedMargin |
btConvexShape * | m_convexShape |
btVector3 | m_currentPosition |
btScalar | m_currentStepOffset |
btScalar | m_fallSpeed |
btPairCachingGhostObject * | m_ghostObject |
btScalar | m_halfHeight |
btScalar | m_jumpSpeed |
btManifoldArray | m_manifoldArray |
keep track of the contact manifolds | |
btScalar | m_maxJumpHeight |
btVector3 | m_normalizedDirection |
btScalar | m_stepHeight |
btVector3 | m_targetPosition |
bool | m_touchingContact |
btVector3 | m_touchingNormal |
btScalar | m_turnAngle |
int | m_upAxis |
bool | m_useGhostObjectSweepTest |
bool | m_useWalkDirection |
btScalar | m_velocityTimeInterval |
btVector3 | m_walkDirection |
this is the desired walk direction, set by the user |
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 35 of file btKinematicCharacterController.h.
btKinematicCharacterController::btKinematicCharacterController | ( | btPairCachingGhostObject * | ghostObject, | |
btConvexShape * | convexShape, | |||
btScalar | stepHeight, | |||
int | upAxis = 1 | |||
) |
btKinematicCharacterController::~btKinematicCharacterController | ( | ) |
bool btKinematicCharacterController::canJump | ( | ) | const [virtual] |
Implements btCharacterControllerInterface.
btVector3 btKinematicCharacterController::computeReflectionDirection | ( | const btVector3 & | direction, | |
const btVector3 & | normal | |||
) | [protected] |
void btKinematicCharacterController::debugDraw | ( | btIDebugDraw * | debugDrawer | ) | [virtual] |
btActionInterface interface
Implements btActionInterface.
btPairCachingGhostObject* btKinematicCharacterController::getGhostObject | ( | ) |
static btVector3* btKinematicCharacterController::getUpAxisDirections | ( | ) | [static, protected] |
void btKinematicCharacterController::jump | ( | ) | [virtual] |
Implements btCharacterControllerInterface.
bool btKinematicCharacterController::onGround | ( | ) | const [virtual] |
Implements btCharacterControllerInterface.
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] |
Implements btCharacterControllerInterface.
void btKinematicCharacterController::preStep | ( | btCollisionWorld * | collisionWorld | ) | [virtual] |
Implements btCharacterControllerInterface.
bool btKinematicCharacterController::recoverFromPenetration | ( | btCollisionWorld * | collisionWorld | ) | [protected] |
void btKinematicCharacterController::reset | ( | ) | [virtual] |
Implements btCharacterControllerInterface.
void btKinematicCharacterController::setFallSpeed | ( | btScalar | fallSpeed | ) |
void btKinematicCharacterController::setJumpSpeed | ( | btScalar | jumpSpeed | ) |
void btKinematicCharacterController::setMaxJumpHeight | ( | btScalar | maxJumpHeight | ) |
void btKinematicCharacterController::setUpAxis | ( | int | axis | ) | [inline] |
Definition at line 100 of file btKinematicCharacterController.h.
void btKinematicCharacterController::setUseGhostSweepTest | ( | bool | useGhostObjectSweepTest | ) | [inline] |
Definition at line 137 of file btKinematicCharacterController.h.
virtual 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.
virtual 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.
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 91 of file btKinematicCharacterController.h.
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] |
Implements btCharacterControllerInterface.
Definition at line 52 of file btKinematicCharacterController.h.
btConvexShape* btKinematicCharacterController::m_convexShape [protected] |
Definition at line 42 of file btKinematicCharacterController.h.
btVector3 btKinematicCharacterController::m_currentPosition [protected] |
Definition at line 59 of file btKinematicCharacterController.h.
Definition at line 60 of file btKinematicCharacterController.h.
btScalar btKinematicCharacterController::m_fallSpeed [protected] |
Definition at line 44 of file btKinematicCharacterController.h.
Definition at line 41 of file btKinematicCharacterController.h.
btScalar btKinematicCharacterController::m_halfHeight [protected] |
Definition at line 39 of file btKinematicCharacterController.h.
btScalar btKinematicCharacterController::m_jumpSpeed [protected] |
Definition at line 45 of file btKinematicCharacterController.h.
keep track of the contact manifolds
Definition at line 64 of file btKinematicCharacterController.h.
Definition at line 46 of file btKinematicCharacterController.h.
btVector3 btKinematicCharacterController::m_normalizedDirection [protected] |
Definition at line 56 of file btKinematicCharacterController.h.
btScalar btKinematicCharacterController::m_stepHeight [protected] |
Definition at line 50 of file btKinematicCharacterController.h.
btVector3 btKinematicCharacterController::m_targetPosition [protected] |
Definition at line 61 of file btKinematicCharacterController.h.
bool btKinematicCharacterController::m_touchingContact [protected] |
Definition at line 66 of file btKinematicCharacterController.h.
btVector3 btKinematicCharacterController::m_touchingNormal [protected] |
Definition at line 67 of file btKinematicCharacterController.h.
btScalar btKinematicCharacterController::m_turnAngle [protected] |
Definition at line 48 of file btKinematicCharacterController.h.
int btKinematicCharacterController::m_upAxis [protected] |
Definition at line 72 of file btKinematicCharacterController.h.
bool btKinematicCharacterController::m_useGhostObjectSweepTest [protected] |
Definition at line 69 of file btKinematicCharacterController.h.
bool btKinematicCharacterController::m_useWalkDirection [protected] |
Definition at line 70 of file btKinematicCharacterController.h.
Definition at line 71 of file btKinematicCharacterController.h.
btVector3 btKinematicCharacterController::m_walkDirection [protected] |
this is the desired walk direction, set by the user
Definition at line 55 of file btKinematicCharacterController.h.