Blender
V3.3
|
#include "LinearMath/btVector3.h"
#include "btCharacterControllerInterface.h"
#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
Go to the source code of this file.
Definition at line 177 of file btKinematicCharacterController.h.
BT_DECLARE_ALIGNED_ALLOCATOR | ( | ) |
btKinematicCharacterController::btKinematicCharacterController | ( | btPairCachingGhostObject * | ghostObject, |
btConvexShape * | convexShape, | ||
btScalar | stepHeight, | ||
const btVector3 & | up = btVector3(1.0, 0.0, 0.0) |
||
) |
Definition at line 134 of file btKinematicCharacterController.cpp.
References bounce_fix, btRadians(), full_drop, m_addedMargin, m_angularDamping, m_AngVel, m_convexShape, m_currentStepOffset, m_fallSpeed, m_ghostObject, m_gravity, m_interpolateUp, m_jumpAxis, m_jumpSpeed, m_linearDamping, m_maxPenetrationDepth, m_SetjumpSpeed, m_turnAngle, m_up, m_useGhostObjectSweepTest, m_useWalkDirection, m_velocityTimeInterval, m_verticalOffset, m_verticalVelocity, m_walkDirection, m_wasJumping, m_wasOnGround, setMaxSlope(), setStepHeight(), and setUp().
bool canJump | ( | ) | const |
btVector3 btKinematicCharacterController::computeReflectionDirection | ( | const btVector3 & | direction, |
const btVector3 & | normal | ||
) |
Definition at line 112 of file btKinematicCharacterController.cpp.
References normal.
Referenced by updateTargetPositionBasedOnCollision().
void debugDraw | ( | btIDebugDraw * | debugDrawer | ) |
btScalar getAngularDamping | ( | ) | const |
Definition at line 158 of file btKinematicCharacterController.h.
References m_angularDamping.
|
virtual |
btScalar getFallSpeed | ( | ) | const |
Definition at line 169 of file btKinematicCharacterController.h.
References m_fallSpeed.
btPairCachingGhostObject * btKinematicCharacterController::getGhostObject | ( | ) |
Definition at line 172 of file btKinematicCharacterController.cpp.
References m_ghostObject.
Referenced by stepDown(), stepForwardAndStrafe(), and stepUp().
btVector3 getGravity | ( | ) | const |
btScalar getJumpSpeed | ( | ) | const |
Definition at line 171 of file btKinematicCharacterController.h.
References m_jumpSpeed.
btScalar getLinearDamping | ( | ) | const |
Definition at line 156 of file btKinematicCharacterController.h.
References m_linearDamping.
|
virtual |
Referenced by btRaycastVehicle::updateVehicle().
btScalar btKinematicCharacterController::getMaxPenetrationDepth | ( | ) | const |
Definition at line 922 of file btKinematicCharacterController.cpp.
References m_maxPenetrationDepth.
btScalar btKinematicCharacterController::getMaxSlope | ( | ) | const |
Definition at line 912 of file btKinematicCharacterController.cpp.
References m_maxSlopeRadians.
btQuaternion btKinematicCharacterController::getRotation | ( | btVector3 & | v0, |
btVector3 & | v1 | ||
) | const |
Definition at line 987 of file btKinematicCharacterController.cpp.
References shortestArcQuatNormalize2(), and v1.
Referenced by setUpVector().
btScalar getStepHeight | ( | ) | const |
Definition at line 167 of file btKinematicCharacterController.h.
References m_stepHeight.
const btVector3& getUp | ( | ) |
Definition at line 132 of file btKinematicCharacterController.h.
References m_up.
|
static |
Definition at line 937 of file btKinematicCharacterController.cpp.
References btVector3.
|
virtual |
bool onGround | ( | ) | const |
btVector3 btKinematicCharacterController::parallelComponent | ( | const btVector3 & | direction, |
const btVector3 & | normal | ||
) |
Definition at line 120 of file btKinematicCharacterController.cpp.
References normal.
Referenced by perpindicularComponent(), and updateTargetPositionBasedOnCollision().
btVector3 btKinematicCharacterController::perpindicularComponent | ( | const btVector3 & | direction, |
const btVector3 & | normal | ||
) |
Definition at line 129 of file btKinematicCharacterController.cpp.
References normal, and parallelComponent().
Referenced by updateTargetPositionBasedOnCollision().
void playerStep | ( | btCollisionWorld * | collisionWorld, |
btScalar | dt | ||
) |
Referenced by updateAction().
void preStep | ( | btCollisionWorld * | collisionWorld | ) |
Referenced by updateAction().
bool btKinematicCharacterController::recoverFromPenetration | ( | btCollisionWorld * | collisionWorld | ) |
Definition at line 177 of file btKinematicCharacterController.cpp.
References btBroadphasePair, btCollisionObject, btPersistentManifold(), btTransform, btVector3, btDispatcher::dispatchAllCollisionPairs(), btCollisionWorld::getBroadphase(), btCollisionWorld::getDispatcher(), btCollisionWorld::getDispatchInfo(), btManifoldPoint::getDistance(), getNumOverlappingPairs(), btPairCachingGhostObject::getOverlappingPairCache(), m_convexShape, m_currentPosition, m_ghostObject, m_manifoldArray, m_maxPenetrationDepth, btManifoldPoint::m_normalWorldOnB, needsCollision(), btAlignedObjectArray< T >::resize(), btBroadphaseInterface::setAabb(), and btAlignedObjectArray< T >::size().
Referenced by stepUp().
void reset | ( | btCollisionWorld * | collisionWorld | ) |
Definition at line 157 of file btKinematicCharacterController.h.
References btClamped(), and m_angularDamping.
Definition at line 852 of file btKinematicCharacterController.cpp.
References m_fallSpeed.
Definition at line 857 of file btKinematicCharacterController.cpp.
References m_jumpSpeed, and m_SetjumpSpeed.
Definition at line 155 of file btKinematicCharacterController.h.
References btClamped(), and m_linearDamping.
Definition at line 863 of file btKinematicCharacterController.cpp.
References m_maxJumpHeight.
Definition at line 917 of file btKinematicCharacterController.cpp.
References m_maxPenetrationDepth.
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().
Definition at line 932 of file btKinematicCharacterController.cpp.
References m_stepHeight.
Referenced by btKinematicCharacterController().
Definition at line 953 of file btKinematicCharacterController.cpp.
References m_gravity, setGravity(), and setUpVector().
Referenced by btKinematicCharacterController().
Definition at line 964 of file btKinematicCharacterController.cpp.
References btTransform, btVector3, getRotation(), m_ghostObject, m_up, and rot.
Referenced by setUp().
Definition at line 191 of file btKinematicCharacterController.h.
References m_useGhostObjectSweepTest.
|
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.
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().
void btKinematicCharacterController::stepDown | ( | btCollisionWorld * | collisionWorld, |
btScalar | dt | ||
) |
Definition at line 466 of file btKinematicCharacterController.cpp.
References bounce_fix, btTransform, btVector3, callback, btCollisionWorld::convexSweepTest(), full_drop, btCollisionWorld::getDispatchInfo(), getGhostObject(), btCollisionWorld::ConvexResultCallback::hasHit(), btDispatcherInfo::m_allowedCcdPenetration, btCollisionWorld::ConvexResultCallback::m_collisionFilterGroup, btCollisionWorld::ConvexResultCallback::m_collisionFilterMask, m_convexShape, m_currentOrientation, m_currentPosition, m_currentStepOffset, m_fallSpeed, m_ghostObject, btCollisionWorld::ClosestConvexResultCallback::m_hitCollisionObject, m_maxSlopeCosine, m_stepHeight, m_targetOrientation, m_targetPosition, m_up, m_useGhostObjectSweepTest, m_verticalOffset, m_verticalVelocity, m_wasJumping, m_wasOnGround, and needsCollision().
void btKinematicCharacterController::stepForwardAndStrafe | ( | btCollisionWorld * | collisionWorld, |
const btVector3 & | walkMove | ||
) |
Definition at line 384 of file btKinematicCharacterController.cpp.
References btTransform, btVector3, callback, btCollisionWorld::convexSweepTest(), distance2(), btCollisionWorld::getDispatchInfo(), getGhostObject(), length2(), m_addedMargin, btDispatcherInfo::m_allowedCcdPenetration, m_convexShape, m_currentOrientation, m_currentPosition, m_ghostObject, m_normalizedDirection, m_targetOrientation, m_targetPosition, m_useGhostObjectSweepTest, needsCollision(), SIMD_EPSILON, and updateTargetPositionBasedOnCollision().
void btKinematicCharacterController::stepUp | ( | btCollisionWorld * | collisionWorld | ) |
Definition at line 257 of file btKinematicCharacterController.cpp.
References btTransform, callback, getGhostObject(), m_convexShape, m_currentOrientation, m_currentPosition, m_currentStepOffset, m_ghostObject, m_interpolateUp, m_jumpAxis, m_maxSlopeCosine, m_stepHeight, m_targetOrientation, m_targetPosition, m_touchingContact, m_up, m_useGhostObjectSweepTest, m_verticalOffset, m_verticalVelocity, needsCollision(), recoverFromPenetration(), and world.
|
virtual |
btActionInterface interface
Definition at line 121 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) |
||
) |
Definition at line 347 of file btKinematicCharacterController.cpp.
References btVector3, computeReflectionDirection(), m_currentPosition, m_targetPosition, parallelComponent(), perpindicularComponent(), and SIMD_EPSILON.
Referenced by stepForwardAndStrafe().
Referenced by libmv::TemplatedTrackRegion().
btKinematicCharacterController::~btKinematicCharacterController | ( | ) |
Definition at line 168 of file btKinematicCharacterController.cpp.
btKinematicCharacterController __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.
bool bounce_fix |
Definition at line 96 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), and stepDown().
bool full_drop |
Definition at line 95 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), and stepDown().
btScalar m_addedMargin |
Definition at line 59 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), and stepForwardAndStrafe().
btScalar m_angularDamping |
Definition at line 83 of file btKinematicCharacterController.h.
Referenced by btRigidBody::applyDamping(), btKinematicCharacterController(), getAngularDamping(), btRigidBody::getAngularDamping(), and setAngularDamping().
btVector3 m_AngVel |
Definition at line 64 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController().
btConvexShape* m_convexShape |
Definition at line 42 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), recoverFromPenetration(), stepDown(), stepForwardAndStrafe(), and stepUp().
btQuaternion m_currentOrientation |
Definition at line 73 of file btKinematicCharacterController.h.
Referenced by stepDown(), stepForwardAndStrafe(), and stepUp().
btVector3 m_currentPosition |
Definition at line 69 of file btKinematicCharacterController.h.
Referenced by recoverFromPenetration(), stepDown(), stepForwardAndStrafe(), stepUp(), and updateTargetPositionBasedOnCollision().
btScalar m_currentStepOffset |
Definition at line 70 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), stepDown(), and stepUp().
btScalar m_fallSpeed |
Definition at line 47 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), getFallSpeed(), setFallSpeed(), and stepDown().
btPairCachingGhostObject* m_ghostObject |
Definition at line 41 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), getGhostObject(), recoverFromPenetration(), setUpVector(), stepDown(), stepForwardAndStrafe(), and stepUp().
btScalar m_gravity |
Definition at line 53 of file btKinematicCharacterController.h.
Referenced by btDeformableBackwardEulerObjective::applyExplicitForce(), btMultiBodyDynamicsWorld::applyGravity(), btKinematicCharacterController(), btDeformableMultiBodyDynamicsWorld::clearGravity(), serializeDynamicsWorldInfo(), setUp(), and btMultiBodyDynamicsWorld::solveExternalForces().
bool m_interpolateUp |
Definition at line 94 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), and stepUp().
btVector3 m_jumpAxis |
Definition at line 91 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), and stepUp().
btVector3 m_jumpPosition |
Definition at line 66 of file btKinematicCharacterController.h.
btScalar m_jumpSpeed |
Definition at line 48 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), getJumpSpeed(), and setJumpSpeed().
btScalar m_linearDamping |
Definition at line 82 of file btKinematicCharacterController.h.
Referenced by btRigidBody::applyDamping(), btKinematicCharacterController(), getLinearDamping(), btRigidBody::getLinearDamping(), and setLinearDamping().
btManifoldArray m_manifoldArray |
keep track of the contact manifolds
Definition at line 77 of file btKinematicCharacterController.h.
Referenced by recoverFromPenetration().
btScalar m_maxJumpHeight |
Definition at line 50 of file btKinematicCharacterController.h.
Referenced by setMaxJumpHeight().
btScalar m_maxPenetrationDepth |
Definition at line 44 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), getMaxPenetrationDepth(), recoverFromPenetration(), and setMaxPenetrationDepth().
btScalar m_maxSlopeCosine |
Definition at line 52 of file btKinematicCharacterController.h.
Referenced by setMaxSlope(), stepDown(), and stepUp().
btScalar m_maxSlopeRadians |
Definition at line 51 of file btKinematicCharacterController.h.
Referenced by getMaxSlope(), and setMaxSlope().
btVector3 m_normalizedDirection |
Definition at line 63 of file btKinematicCharacterController.h.
Referenced by stepForwardAndStrafe().
btScalar m_SetjumpSpeed |
Definition at line 49 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), and setJumpSpeed().
btScalar m_stepHeight |
Definition at line 57 of file btKinematicCharacterController.h.
Referenced by getStepHeight(), setStepHeight(), stepDown(), and stepUp().
btQuaternion m_targetOrientation |
Definition at line 74 of file btKinematicCharacterController.h.
Referenced by stepDown(), stepForwardAndStrafe(), and stepUp().
btVector3 m_targetPosition |
Definition at line 71 of file btKinematicCharacterController.h.
Referenced by stepDown(), stepForwardAndStrafe(), stepUp(), and updateTargetPositionBasedOnCollision().
bool m_touchingContact |
Definition at line 79 of file btKinematicCharacterController.h.
Referenced by stepUp().
btVector3 m_touchingNormal |
Definition at line 80 of file btKinematicCharacterController.h.
btScalar m_turnAngle |
Definition at line 55 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController().
btVector3 m_up |
Definition at line 90 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), getUp(), setUpVector(), stepDown(), and stepUp().
bool m_useGhostObjectSweepTest |
Definition at line 87 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), setUseGhostSweepTest(), stepDown(), stepForwardAndStrafe(), and stepUp().
bool m_useWalkDirection |
Definition at line 88 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController().
btScalar m_velocityTimeInterval |
Definition at line 89 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController().
btScalar m_verticalOffset |
Definition at line 46 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), stepDown(), and stepUp().
btScalar m_verticalVelocity |
Definition at line 45 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), stepDown(), and stepUp().
btVector3 m_walkDirection |
this is the desired walk direction, set by the user
Definition at line 62 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController().
bool m_wasJumping |
Definition at line 86 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), and stepDown().
bool m_wasOnGround |
Definition at line 85 of file btKinematicCharacterController.h.
Referenced by btKinematicCharacterController(), and stepDown().