|
Bullet Collision Detection & Physics Library
|
The btRigidBody is the main class for rigid body objects. More...
#include <btRigidBody.h>


Classes | |
| struct | btRigidBodyConstructionInfo |
| The btRigidBodyConstructionInfo structure provides information to create a rigid body. More... | |
Public Member Functions | |
| btRigidBody (const btRigidBodyConstructionInfo &constructionInfo) | |
| btRigidBody constructor using construction info | |
| btRigidBody (btScalar mass, btMotionState *motionState, btCollisionShape *collisionShape, const btVector3 &localInertia=btVector3(0, 0, 0)) | |
| btRigidBody constructor for backwards compatibility. | |
| virtual | ~btRigidBody () |
| void | proceedToTransform (const btTransform &newTrans) |
| void | predictIntegratedTransform (btScalar step, btTransform &predictedTransform) |
| continuous collision detection needs prediction | |
| void | saveKinematicState (btScalar step) |
| void | applyGravity () |
| void | setGravity (const btVector3 &acceleration) |
| const btVector3 & | getGravity () const |
| void | setDamping (btScalar lin_damping, btScalar ang_damping) |
| btScalar | getLinearDamping () const |
| btScalar | getAngularDamping () const |
| btScalar | getLinearSleepingThreshold () const |
| btScalar | getAngularSleepingThreshold () const |
| void | applyDamping (btScalar timeStep) |
| applyDamping damps the velocity, using the given m_linearDamping and m_angularDamping | |
| const btCollisionShape * | getCollisionShape () const |
| btCollisionShape * | getCollisionShape () |
| void | setMassProps (btScalar mass, const btVector3 &inertia) |
| const btVector3 & | getLinearFactor () const |
| void | setLinearFactor (const btVector3 &linearFactor) |
| btScalar | getInvMass () const |
| const btMatrix3x3 & | getInvInertiaTensorWorld () const |
| void | integrateVelocities (btScalar step) |
| void | setCenterOfMassTransform (const btTransform &xform) |
| void | applyCentralForce (const btVector3 &force) |
| const btVector3 & | getTotalForce () const |
| const btVector3 & | getTotalTorque () const |
| const btVector3 & | getInvInertiaDiagLocal () const |
| void | setInvInertiaDiagLocal (const btVector3 &diagInvInertia) |
| void | setSleepingThresholds (btScalar linear, btScalar angular) |
| void | applyTorque (const btVector3 &torque) |
| void | applyForce (const btVector3 &force, const btVector3 &rel_pos) |
| void | applyCentralImpulse (const btVector3 &impulse) |
| void | applyTorqueImpulse (const btVector3 &torque) |
| void | applyImpulse (const btVector3 &impulse, const btVector3 &rel_pos) |
| void | clearForces () |
| void | updateInertiaTensor () |
| const btVector3 & | getCenterOfMassPosition () const |
| btQuaternion | getOrientation () const |
| const btTransform & | getCenterOfMassTransform () const |
| const btVector3 & | getLinearVelocity () const |
| const btVector3 & | getAngularVelocity () const |
| void | setLinearVelocity (const btVector3 &lin_vel) |
| void | setAngularVelocity (const btVector3 &ang_vel) |
| btVector3 | getVelocityInLocalPoint (const btVector3 &rel_pos) const |
| void | translate (const btVector3 &v) |
| void | getAabb (btVector3 &aabbMin, btVector3 &aabbMax) const |
| btScalar | computeImpulseDenominator (const btVector3 &pos, const btVector3 &normal) const |
| btScalar | computeAngularImpulseDenominator (const btVector3 &axis) const |
| void | updateDeactivation (btScalar timeStep) |
| bool | wantsSleeping () |
| const btBroadphaseProxy * | getBroadphaseProxy () const |
| btBroadphaseProxy * | getBroadphaseProxy () |
| void | setNewBroadphaseProxy (btBroadphaseProxy *broadphaseProxy) |
| btMotionState * | getMotionState () |
| const btMotionState * | getMotionState () const |
| void | setMotionState (btMotionState *motionState) |
| void | setAngularFactor (const btVector3 &angFac) |
| void | setAngularFactor (btScalar angFac) |
| const btVector3 & | getAngularFactor () const |
| bool | isInWorld () const |
| virtual bool | checkCollideWithOverride (const btCollisionObject *co) const |
| void | addConstraintRef (btTypedConstraint *c) |
| void | removeConstraintRef (btTypedConstraint *c) |
| btTypedConstraint * | getConstraintRef (int index) |
| int | getNumConstraintRefs () const |
| void | setFlags (int flags) |
| int | getFlags () const |
| btVector3 | computeGyroscopicForce (btScalar maxGyroscopicForce) const |
| virtual int | calculateSerializeBufferSize () const |
| virtual const char * | serialize (void *dataBuffer, class btSerializer *serializer) const |
| fills the dataBuffer and returns the struct name (and 0 on failure) | |
| virtual void | serializeSingleObject (class btSerializer *serializer) const |
Public Member Functions inherited from btCollisionObject | |
| BT_DECLARE_ALIGNED_ALLOCATOR () | |
| bool | mergesSimulationIslands () const |
| const btVector3 & | getAnisotropicFriction () const |
| void | setAnisotropicFriction (const btVector3 &anisotropicFriction, int frictionMode=CF_ANISOTROPIC_FRICTION) |
| bool | hasAnisotropicFriction (int frictionMode=CF_ANISOTROPIC_FRICTION) const |
| void | setContactProcessingThreshold (btScalar contactProcessingThreshold) |
| the constraint solver can discard solving contacts, if the distance is above this threshold. | |
| btScalar | getContactProcessingThreshold () const |
| bool | isStaticObject () const |
| bool | isKinematicObject () const |
| bool | isStaticOrKinematicObject () const |
| bool | hasContactResponse () const |
| btCollisionObject () | |
| virtual | ~btCollisionObject () |
| virtual void | setCollisionShape (btCollisionShape *collisionShape) |
| void * | internalGetExtensionPointer () const |
| Avoid using this internal API call, the extension pointer is used by some Bullet extensions. | |
| void | internalSetExtensionPointer (void *pointer) |
| Avoid using this internal API call, the extension pointer is used by some Bullet extensions If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead. | |
| int | getActivationState () const |
| void | setActivationState (int newState) const |
| void | setDeactivationTime (btScalar time) |
| btScalar | getDeactivationTime () const |
| void | forceActivationState (int newState) const |
| void | activate (bool forceActivation=false) const |
| bool | isActive () const |
| void | setRestitution (btScalar rest) |
| btScalar | getRestitution () const |
| void | setFriction (btScalar frict) |
| btScalar | getFriction () const |
| void | setRollingFriction (btScalar frict) |
| btScalar | getRollingFriction () const |
| int | getInternalType () const |
| reserved for Bullet internal usage | |
| btTransform & | getWorldTransform () |
| const btTransform & | getWorldTransform () const |
| void | setWorldTransform (const btTransform &worldTrans) |
| btBroadphaseProxy * | getBroadphaseHandle () |
| const btBroadphaseProxy * | getBroadphaseHandle () const |
| void | setBroadphaseHandle (btBroadphaseProxy *handle) |
| const btTransform & | getInterpolationWorldTransform () const |
| btTransform & | getInterpolationWorldTransform () |
| void | setInterpolationWorldTransform (const btTransform &trans) |
| void | setInterpolationLinearVelocity (const btVector3 &linvel) |
| void | setInterpolationAngularVelocity (const btVector3 &angvel) |
| const btVector3 & | getInterpolationLinearVelocity () const |
| const btVector3 & | getInterpolationAngularVelocity () const |
| int | getIslandTag () const |
| void | setIslandTag (int tag) |
| int | getCompanionId () const |
| void | setCompanionId (int id) |
| btScalar | getHitFraction () const |
| void | setHitFraction (btScalar hitFraction) |
| int | getCollisionFlags () const |
| void | setCollisionFlags (int flags) |
| btScalar | getCcdSweptSphereRadius () const |
| Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm:: | |
| void | setCcdSweptSphereRadius (btScalar radius) |
| Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm:: | |
| btScalar | getCcdMotionThreshold () const |
| btScalar | getCcdSquareMotionThreshold () const |
| void | setCcdMotionThreshold (btScalar ccdMotionThreshold) |
| Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold. | |
| void * | getUserPointer () const |
| users can point to their objects, userPointer is not used by Bullet | |
| int | getUserIndex () const |
| void | setUserPointer (void *userPointer) |
| users can point to their objects, userPointer is not used by Bullet | |
| void | setUserIndex (int index) |
| users can point to their objects, userPointer is not used by Bullet | |
| int | getUpdateRevisionInternal () const |
| bool | checkCollideWith (const btCollisionObject *co) const |
Static Public Member Functions | |
| static const btRigidBody * | upcast (const btCollisionObject *colObj) |
| to keep collision detection and dynamics separate we don't store a rigidbody pointer but a rigidbody is derived from btCollisionObject, so we can safely perform an upcast | |
| static btRigidBody * | upcast (btCollisionObject *colObj) |
Public Attributes | |
| int | m_contactSolverType |
| int | m_frictionSolverType |
Protected Member Functions | |
| void | setupRigidBody (const btRigidBodyConstructionInfo &constructionInfo) |
| setupRigidBody is only used internally by the constructor | |
Protected Attributes | |
| btVector3 | m_deltaLinearVelocity |
| btVector3 | m_deltaAngularVelocity |
| btVector3 | m_angularFactor |
| btVector3 | m_invMass |
| btVector3 | m_pushVelocity |
| btVector3 | m_turnVelocity |
Protected Attributes inherited from btCollisionObject | |
| btTransform | m_worldTransform |
| btTransform | m_interpolationWorldTransform |
| m_interpolationWorldTransform is used for CCD and interpolation it can be either previous or future (predicted) transform | |
| btVector3 | m_interpolationLinearVelocity |
| btVector3 | m_interpolationAngularVelocity |
| btVector3 | m_anisotropicFriction |
| int | m_hasAnisotropicFriction |
| btScalar | m_contactProcessingThreshold |
| btBroadphaseProxy * | m_broadphaseHandle |
| btCollisionShape * | m_collisionShape |
| void * | m_extensionPointer |
| m_extensionPointer is used by some internal low-level Bullet extensions. | |
| btCollisionShape * | m_rootCollisionShape |
| m_rootCollisionShape is temporarily used to store the original collision shape The m_collisionShape might be temporarily replaced by a child collision shape during collision detection purposes If it is NULL, the m_collisionShape is not temporarily replaced. | |
| int | m_collisionFlags |
| int | m_islandTag1 |
| int | m_companionId |
| int | m_activationState1 |
| btScalar | m_deactivationTime |
| btScalar | m_friction |
| btScalar | m_restitution |
| btScalar | m_rollingFriction |
| int | m_internalType |
| m_internalType is reserved to distinguish Bullet's btCollisionObject, btRigidBody, btSoftBody, btGhostObject etc. | |
| union { | |
| void * m_userObjectPointer | |
| int m_userIndex | |
| }; | |
| users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer | |
| btScalar | m_hitFraction |
| time of impact calculation | |
| btScalar | m_ccdSweptSphereRadius |
| Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm:: | |
| btScalar | m_ccdMotionThreshold |
| Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold. | |
| int | m_checkCollideWith |
| If some object should have elaborate collision filtering by sub-classes. | |
| int | m_updateRevision |
| internal update revision number. It will be increased when the object changes. This allows some subsystems to perform lazy evaluation. | |
Additional Inherited Members | |
Public Types inherited from btCollisionObject | |
| enum | CollisionFlags { CF_STATIC_OBJECT = 1, CF_KINEMATIC_OBJECT = 2, CF_NO_CONTACT_RESPONSE = 4, CF_CUSTOM_MATERIAL_CALLBACK = 8, CF_CHARACTER_OBJECT = 16, CF_DISABLE_VISUALIZE_OBJECT = 32, CF_DISABLE_SPU_COLLISION_PROCESSING = 64 } |
| enum | CollisionObjectTypes { CO_COLLISION_OBJECT = 1, CO_RIGID_BODY = 2, CO_GHOST_OBJECT = 4, CO_SOFT_BODY = 8, CO_HF_FLUID = 16, CO_USER_TYPE = 32, CO_FEATHERSTONE_LINK = 64 } |
| enum | AnisotropicFrictionFlags { CF_ANISOTROPIC_FRICTION_DISABLED = 0, CF_ANISOTROPIC_FRICTION = 1, CF_ANISOTROPIC_ROLLING_FRICTION = 2 } |
The btRigidBody is the main class for rigid body objects.
It is derived from btCollisionObject, so it keeps a pointer to a btCollisionShape. It is recommended for performance and memory use to share btCollisionShape objects whenever possible. There are 3 types of rigid bodies:
Definition at line 59 of file btRigidBody.h.
| btRigidBody::btRigidBody | ( | const btRigidBodyConstructionInfo & | constructionInfo | ) |
btRigidBody constructor using construction info
Definition at line 30 of file btRigidBody.cpp.
| btRigidBody::btRigidBody | ( | btScalar | mass, |
| btMotionState * | motionState, | ||
| btCollisionShape * | collisionShape, | ||
| const btVector3 & | localInertia = btVector3(0,0,0) |
||
| ) |
btRigidBody constructor for backwards compatibility.
To specify friction (etc) during rigid body construction, please use the other constructor (using btRigidBodyConstructionInfo)
Definition at line 35 of file btRigidBody.cpp.
|
inlinevirtual |
Definition at line 179 of file btRigidBody.h.
| void btRigidBody::addConstraintRef | ( | btTypedConstraint * | c | ) |
Definition at line 339 of file btRigidBody.cpp.
|
inline |
Definition at line 276 of file btRigidBody.h.
|
inline |
Definition at line 318 of file btRigidBody.h.
| void btRigidBody::applyDamping | ( | btScalar | timeStep | ) |
applyDamping damps the velocity, using the given m_linearDamping and m_angularDamping
Definition at line 159 of file btRigidBody.cpp.
Definition at line 312 of file btRigidBody.h.
| void btRigidBody::applyGravity | ( | ) |
Definition at line 216 of file btRigidBody.cpp.
Definition at line 328 of file btRigidBody.h.
|
inline |
Definition at line 307 of file btRigidBody.h.
|
inline |
Definition at line 323 of file btRigidBody.h.
|
virtual |
Reimplemented from btCollisionObject.
Definition at line 354 of file btRigidBody.cpp.
|
virtual |
Reimplemented from btCollisionObject.
Definition at line 320 of file btRigidBody.cpp.
|
inline |
Definition at line 340 of file btRigidBody.h.
Definition at line 409 of file btRigidBody.h.
Definition at line 260 of file btRigidBody.cpp.
|
inline |
Definition at line 397 of file btRigidBody.h.
Definition at line 127 of file btRigidBody.cpp.
|
inline |
Definition at line 231 of file btRigidBody.h.
|
inline |
Definition at line 498 of file btRigidBody.h.
|
inline |
Definition at line 241 of file btRigidBody.h.
|
inline |
Definition at line 359 of file btRigidBody.h.
|
inline |
Definition at line 454 of file btRigidBody.h.
|
inline |
Definition at line 458 of file btRigidBody.h.
|
inline |
Definition at line 348 of file btRigidBody.h.
|
inline |
Definition at line 353 of file btRigidBody.h.
|
inline |
Reimplemented from btCollisionObject.
Definition at line 248 of file btRigidBody.h.
|
inline |
Reimplemented from btCollisionObject.
Definition at line 252 of file btRigidBody.h.
|
inline |
Definition at line 514 of file btRigidBody.h.
|
inline |
Definition at line 529 of file btRigidBody.h.
|
inline |
Definition at line 219 of file btRigidBody.h.
|
inline |
Definition at line 291 of file btRigidBody.h.
|
inline |
Definition at line 268 of file btRigidBody.h.
|
inline |
Definition at line 267 of file btRigidBody.h.
|
inline |
Definition at line 226 of file btRigidBody.h.
|
inline |
Definition at line 258 of file btRigidBody.h.
|
inline |
Definition at line 236 of file btRigidBody.h.
|
inline |
Definition at line 356 of file btRigidBody.h.
|
inline |
Definition at line 468 of file btRigidBody.h.
|
inline |
Definition at line 472 of file btRigidBody.h.
|
inline |
Definition at line 519 of file btRigidBody.h.
| btQuaternion btRigidBody::getOrientation | ( | ) | const |
Definition at line 295 of file btRigidBody.cpp.
|
inline |
Definition at line 281 of file btRigidBody.h.
|
inline |
Definition at line 286 of file btRigidBody.h.
Definition at line 376 of file btRigidBody.h.
| void btRigidBody::integrateVelocities | ( | btScalar | step | ) |
clamp angular velocity. collision calculations will fail on higher angular velocities
Definition at line 277 of file btRigidBody.cpp.
|
inline |
Definition at line 504 of file btRigidBody.h.
| void btRigidBody::predictIntegratedTransform | ( | btScalar | step, |
| btTransform & | predictedTransform | ||
| ) |
continuous collision detection needs prediction
Definition at line 104 of file btRigidBody.cpp.
| void btRigidBody::proceedToTransform | ( | const btTransform & | newTrans | ) |
Definition at line 225 of file btRigidBody.cpp.
| void btRigidBody::removeConstraintRef | ( | btTypedConstraint * | c | ) |
Definition at line 348 of file btRigidBody.cpp.
| void btRigidBody::saveKinematicState | ( | btScalar | step | ) |
Definition at line 109 of file btRigidBody.cpp.
|
virtual |
fills the dataBuffer and returns the struct name (and 0 on failure)
Reimplemented from btCollisionObject.
Definition at line 361 of file btRigidBody.cpp.
|
virtual |
Reimplemented from btCollisionObject.
Definition at line 393 of file btRigidBody.cpp.
|
inline |
Definition at line 487 of file btRigidBody.h.
|
inline |
Definition at line 493 of file btRigidBody.h.
|
inline |
Definition at line 370 of file btRigidBody.h.
| void btRigidBody::setCenterOfMassTransform | ( | const btTransform & | xform | ) |
Definition at line 303 of file btRigidBody.cpp.
Definition at line 149 of file btRigidBody.cpp.
|
inline |
Definition at line 524 of file btRigidBody.h.
| void btRigidBody::setGravity | ( | const btVector3 & | acceleration | ) |
Definition at line 135 of file btRigidBody.cpp.
|
inline |
Definition at line 296 of file btRigidBody.h.
|
inline |
Definition at line 262 of file btRigidBody.h.
|
inline |
Definition at line 364 of file btRigidBody.h.
Definition at line 231 of file btRigidBody.cpp.
|
inline |
Definition at line 476 of file btRigidBody.h.
|
inline |
Definition at line 462 of file btRigidBody.h.
Definition at line 301 of file btRigidBody.h.
|
protected |
setupRigidBody is only used internally by the constructor
Definition at line 41 of file btRigidBody.cpp.
|
inline |
Definition at line 385 of file btRigidBody.h.
|
inlinestatic |
to keep collision detection and dynamics separate we don't store a rigidbody pointer but a rigidbody is derived from btCollisionObject, so we can safely perform an upcast
Definition at line 197 of file btRigidBody.h.
|
inlinestatic |
Definition at line 203 of file btRigidBody.h.
|
inline |
Definition at line 415 of file btRigidBody.h.
| void btRigidBody::updateInertiaTensor | ( | ) |
Definition at line 254 of file btRigidBody.cpp.
|
inline |
Definition at line 432 of file btRigidBody.h.
|
private |
Definition at line 81 of file btRigidBody.h.
|
private |
Definition at line 80 of file btRigidBody.h.
|
private |
Definition at line 77 of file btRigidBody.h.
|
private |
Definition at line 78 of file btRigidBody.h.
|
private |
Definition at line 79 of file btRigidBody.h.
|
private |
Definition at line 75 of file btRigidBody.h.
|
protected |
Definition at line 102 of file btRigidBody.h.
|
private |
Definition at line 85 of file btRigidBody.h.
|
private |
Definition at line 64 of file btRigidBody.h.
|
private |
Definition at line 91 of file btRigidBody.h.
| int btRigidBody::m_contactSolverType |
Definition at line 484 of file btRigidBody.h.
|
private |
Definition at line 95 of file btRigidBody.h.
|
protected |
Definition at line 101 of file btRigidBody.h.
|
protected |
Definition at line 100 of file btRigidBody.h.
| int btRigidBody::m_frictionSolverType |
Definition at line 485 of file btRigidBody.h.
|
private |
Definition at line 68 of file btRigidBody.h.
|
private |
Definition at line 69 of file btRigidBody.h.
|
private |
Definition at line 65 of file btRigidBody.h.
|
private |
Definition at line 70 of file btRigidBody.h.
|
private |
Definition at line 62 of file btRigidBody.h.
|
protected |
Definition at line 103 of file btRigidBody.h.
|
private |
Definition at line 74 of file btRigidBody.h.
|
private |
Definition at line 66 of file btRigidBody.h.
|
private |
Definition at line 84 of file btRigidBody.h.
|
private |
Definition at line 63 of file btRigidBody.h.
|
private |
Definition at line 88 of file btRigidBody.h.
|
protected |
Definition at line 104 of file btRigidBody.h.
|
private |
Definition at line 93 of file btRigidBody.h.
|
private |
Definition at line 71 of file btRigidBody.h.
|
private |
Definition at line 72 of file btRigidBody.h.
|
protected |
Definition at line 105 of file btRigidBody.h.
1.8.1.2