Back to index

supertuxkart  0.5+dfsg1
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes
btRigidBody Class Reference

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: More...

#include <btRigidBody.h>

Collaboration diagram for btRigidBody:
Collaboration graph
[legend]

List of all members.

Classes

struct  btRigidBodyConstructionInfo
 btRigidBodyConstructionInfo provides information to create a rigid body. Setting mass to zero creates a fixed (non-dynamic) rigid body. For dynamic objects, you can use the collision shape to approximate the local inertia tensor, otherwise use the zero vector (default argument) You can use the motion state to synchronize the world transform between physics and graphics objects. And if the motion state is provided, the rigid body will initialize its initial world transform from the motion state, m_startWorldTransform is only used when you don't provide a motion state. 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. To specify friction (etc) during rigid body construction, please use the other constructor (using btRigidBodyConstructionInfo)
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 btVector3getGravity () const
void setDamping (btScalar lin_damping, btScalar ang_damping)
void applyDamping (btScalar timeStep)
 applyDamping damps the velocity, using the given m_linearDamping and m_angularDamping
SIMD_FORCE_INLINE const
btCollisionShape
getCollisionShape () const
SIMD_FORCE_INLINE
btCollisionShape
getCollisionShape ()
void setMassProps (btScalar mass, const btVector3 &inertia)
btScalar getInvMass () const
const btMatrix3x3getInvInertiaTensorWorld () const
void integrateVelocities (btScalar step)
void setCenterOfMassTransform (const btTransform &xform)
void applyCentralForce (const btVector3 &force)
const btVector3getInvInertiaDiagLocal ()
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)
SIMD_FORCE_INLINE void internalApplyImpulse (const btVector3 &linearComponent, const btVector3 &angularComponent, btScalar impulseMagnitude)
void clearForces ()
void updateInertiaTensor ()
const btPoint3getCenterOfMassPosition () const
btQuaternion getOrientation () const
const btTransformgetCenterOfMassTransform () const
const btVector3getLinearVelocity () const
const btVector3getAngularVelocity () 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
SIMD_FORCE_INLINE btScalar computeImpulseDenominator (const btPoint3 &pos, const btVector3 &normal) const
SIMD_FORCE_INLINE btScalar computeAngularImpulseDenominator (const btVector3 &axis) const
SIMD_FORCE_INLINE void updateDeactivation (btScalar timeStep)
SIMD_FORCE_INLINE bool wantsSleeping ()
const btBroadphaseProxy * getBroadphaseProxy () const
btBroadphaseProxy * getBroadphaseProxy ()
void setNewBroadphaseProxy (btBroadphaseProxy *broadphaseProxy)
btMotionStategetMotionState ()
const btMotionStategetMotionState () const
void setMotionState (btMotionState *motionState)
void setAngularFactor (btScalar angFac)
btScalar getAngularFactor () const
bool isInWorld () const
virtual bool checkCollideWithOverride (btCollisionObject *co)
void addConstraintRef (btTypedConstraint *c)
void removeConstraintRef (btTypedConstraint *c)
btTypedConstraintgetConstraintRef (int index)
int getNumConstraintRefs ()

Static Public Member Functions

static const btRigidBodyupcast (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 btRigidBodyupcast (btCollisionObject *colObj)

Public Attributes

int m_contactSolverType
int m_frictionSolverType
int m_debugBodyId

Protected Member Functions

void setupRigidBody (const btRigidBodyConstructionInfo &constructionInfo)
 setupRigidBody is only used internally by the constructor

Private Attributes

btMatrix3x3 m_invInertiaTensorWorld
btVector3 m_linearVelocity
btVector3 m_angularVelocity
btScalar m_inverseMass
btScalar m_angularFactor
btVector3 m_gravity
btVector3 m_invInertiaLocal
btVector3 m_totalForce
btVector3 m_totalTorque
btScalar m_linearDamping
btScalar m_angularDamping
bool m_additionalDamping
btScalar m_additionalDampingFactor
btScalar m_additionalLinearDampingThresholdSqr
btScalar m_additionalAngularDampingThresholdSqr
btScalar m_additionalAngularDampingFactor
btScalar m_linearSleepingThreshold
btScalar m_angularSleepingThreshold
btMotionStatem_optionalMotionState
btAlignedObjectArray
< btTypedConstraint * > 
m_constraintRefs

Detailed Description

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 42 of file btRigidBody.h.


Constructor & Destructor Documentation

btRigidBody constructor using construction info

Definition at line 29 of file btRigidBody.cpp.

{
       setupRigidBody(constructionInfo);
}

Here is the call graph for this function:

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 34 of file btRigidBody.cpp.

{
       btRigidBodyConstructionInfo cinfo(mass,motionState,collisionShape,localInertia);
       setupRigidBody(cinfo);
}

Here is the call graph for this function:

virtual btRigidBody::~btRigidBody ( ) [inline, virtual]

Definition at line 143 of file btRigidBody.h.

        { 
                //No constraints should point to this rigidbody
              //Remove constraints from the dynamics world before you delete the related rigidbodies. 
                btAssert(m_constraintRefs.size()==0); 
        }

Here is the call graph for this function:


Member Function Documentation

Definition at line 292 of file btRigidBody.cpp.

{
       int index = m_constraintRefs.findLinearSearch(c);
       if (index == m_constraintRefs.size())
              m_constraintRefs.push_back(c); 

       m_checkCollideWith = true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void btRigidBody::applyCentralForce ( const btVector3 force) [inline]

Definition at line 211 of file btRigidBody.h.

       {
              m_totalForce += force;
       }

Here is the caller graph for this function:

void btRigidBody::applyCentralImpulse ( const btVector3 impulse) [inline]

Definition at line 243 of file btRigidBody.h.

       {
              m_linearVelocity += impulse * m_inverseMass;
       }

Here is the caller graph for this function:

void btRigidBody::applyDamping ( btScalar  timeStep)

applyDamping damps the velocity, using the given m_linearDamping and m_angularDamping

Definition at line 144 of file btRigidBody.cpp.

{
       m_linearVelocity *= GEN_clamped((btScalar(1.) - timeStep * m_linearDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
       m_angularVelocity *= GEN_clamped((btScalar(1.) - timeStep * m_angularDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));

       if (m_additionalDamping)
       {
              //Additional damping can help avoiding lowpass jitter motion, help stability for ragdolls etc.
              //Such damping is undesirable, so once the overall simulation quality of the rigid body dynamics system has improved, this should become obsolete
              if ((m_angularVelocity.length2() < m_additionalAngularDampingThresholdSqr) &&
                     (m_linearVelocity.length2() < m_additionalLinearDampingThresholdSqr))
              {
                     m_angularVelocity *= m_additionalDampingFactor;
                     m_linearVelocity *= m_additionalDampingFactor;
              }
       

              btScalar speed = m_linearVelocity.length();
              if (speed < m_linearDamping)
              {
                     btScalar dampVel = btScalar(0.005);
                     if (speed > dampVel)
                     {
                            btVector3 dir = m_linearVelocity.normalized();
                            m_linearVelocity -=  dir * dampVel;
                     } else
                     {
                            m_linearVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
                     }
              }

              btScalar angSpeed = m_angularVelocity.length();
              if (angSpeed < m_angularDamping)
              {
                     btScalar angDampVel = btScalar(0.005);
                     if (angSpeed > angDampVel)
                     {
                            btVector3 dir = m_angularVelocity.normalized();
                            m_angularVelocity -=  dir * angDampVel;
                     } else
                     {
                            m_angularVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
                     }
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void btRigidBody::applyForce ( const btVector3 force,
const btVector3 rel_pos 
) [inline]

Definition at line 237 of file btRigidBody.h.

       {
              applyCentralForce(force);
              applyTorque(rel_pos.cross(force));
       }

Here is the call graph for this function:

Definition at line 192 of file btRigidBody.cpp.

{
       if (isStaticOrKinematicObject())
              return;
       
       applyCentralForce(m_gravity);      

}

Here is the call graph for this function:

Here is the caller graph for this function:

void btRigidBody::applyImpulse ( const btVector3 impulse,
const btVector3 rel_pos 
) [inline]

Definition at line 253 of file btRigidBody.h.

       {
              if (m_inverseMass != btScalar(0.))
              {
                     applyCentralImpulse(impulse);
                     if (m_angularFactor)
                     {
                            applyTorqueImpulse(rel_pos.cross(impulse)*m_angularFactor);
                     }
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void btRigidBody::applyTorque ( const btVector3 torque) [inline]

Definition at line 232 of file btRigidBody.h.

       {
              m_totalTorque += torque;
       }

Here is the caller graph for this function:

void btRigidBody::applyTorqueImpulse ( const btVector3 torque) [inline]

Definition at line 248 of file btRigidBody.h.

Here is the caller graph for this function:

bool btRigidBody::checkCollideWithOverride ( btCollisionObject *  co) [virtual]

Definition at line 276 of file btRigidBody.cpp.

{
       btRigidBody* otherRb = btRigidBody::upcast(co);
       if (!otherRb)
              return true;

       for (int i = 0; i < m_constraintRefs.size(); ++i)
       {
              btTypedConstraint* c = m_constraintRefs[i];
              if (&c->getRigidBodyA() == otherRb || &c->getRigidBodyB() == otherRb)
                     return false;
       }

       return true;
}

Here is the call graph for this function:

void btRigidBody::clearForces ( ) [inline]

Definition at line 278 of file btRigidBody.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 348 of file btRigidBody.h.

       {
              btVector3 vec = axis * getInvInertiaTensorWorld();
              return axis.dot(vec);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE btScalar btRigidBody::computeImpulseDenominator ( const btPoint3 pos,
const btVector3 normal 
) const [inline]

Definition at line 336 of file btRigidBody.h.

       {
              btVector3 r0 = pos - getCenterOfMassPosition();

              btVector3 c0 = (r0).cross(normal);

              btVector3 vec = (c0 * getInvInertiaTensorWorld()).cross(r0);

              return m_inverseMass + normal.dot(vec);

       }

Here is the call graph for this function:

Here is the caller graph for this function:

void btRigidBody::getAabb ( btVector3 aabbMin,
btVector3 aabbMax 
) const

Definition at line 113 of file btRigidBody.cpp.

{
       getCollisionShape()->getAabb(m_worldTransform,aabbMin,aabbMax);
}

Here is the call graph for this function:

Definition at line 430 of file btRigidBody.h.

       {
              return m_angularFactor;
       }

Here is the caller graph for this function:

const btVector3& btRigidBody::getAngularVelocity ( ) const [inline]

Definition at line 297 of file btRigidBody.h.

                                                      { 
              return m_angularVelocity; 
       }

Here is the caller graph for this function:

const btBroadphaseProxy* btRigidBody::getBroadphaseProxy ( ) const [inline]

Definition at line 393 of file btRigidBody.h.

       {
              return m_broadphaseHandle;
       }

Here is the caller graph for this function:

btBroadphaseProxy* btRigidBody::getBroadphaseProxy ( ) [inline]

Definition at line 397 of file btRigidBody.h.

       {
              return m_broadphaseHandle;
       }

Definition at line 286 of file btRigidBody.h.

                                                           { 
              return m_worldTransform.getOrigin(); 
       }

Here is the caller graph for this function:

Definition at line 291 of file btRigidBody.h.

                                                            { 
              return m_worldTransform; 
       }

Here is the caller graph for this function:

Definition at line 192 of file btRigidBody.h.

                                                                           {
              return m_collisionShape;
       }

Here is the caller graph for this function:

Definition at line 196 of file btRigidBody.h.

                                                                     {
                     return m_collisionShape;
       }

Definition at line 446 of file btRigidBody.h.

       {
              return m_constraintRefs[index];
       }
const btVector3& btRigidBody::getGravity ( ) const [inline]

Definition at line 183 of file btRigidBody.h.

       {
              return m_gravity;
       }

Definition at line 216 of file btRigidBody.h.

       {
              return m_invInertiaLocal;
       };

Here is the caller graph for this function:

Definition at line 203 of file btRigidBody.h.

Here is the caller graph for this function:

btScalar btRigidBody::getInvMass ( ) const [inline]

Definition at line 202 of file btRigidBody.h.

{ return m_inverseMass; }

Here is the caller graph for this function:

const btVector3& btRigidBody::getLinearVelocity ( ) const [inline]

Definition at line 294 of file btRigidBody.h.

                                                    { 
              return m_linearVelocity; 
       }

Here is the caller graph for this function:

Definition at line 407 of file btRigidBody.h.

       {
              return m_optionalMotionState;
       }

Here is the caller graph for this function:

const btMotionState* btRigidBody::getMotionState ( ) const [inline]

Definition at line 411 of file btRigidBody.h.

       {
              return m_optionalMotionState;
       }

Definition at line 451 of file btRigidBody.h.

       {
              return m_constraintRefs.size();
       }

Here is the call graph for this function:

Definition at line 251 of file btRigidBody.cpp.

{
              btQuaternion orn;
              m_worldTransform.getBasis().getRotation(orn);
              return orn;
}
btVector3 btRigidBody::getVelocityInLocalPoint ( const btVector3 rel_pos) const [inline]

Definition at line 315 of file btRigidBody.h.

       {
              //we also calculate lin/ang velocity for kinematic objects
              return m_linearVelocity + m_angularVelocity.cross(rel_pos);

              //for kinematic objects, we could also use use:
              //            return        (m_worldTransform(rel_pos) - m_interpolationWorldTransform(rel_pos)) / m_kinematicTimeStep;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

clamp angular velocity. collision calculations will fail on higher angular velocities

Definition at line 233 of file btRigidBody.cpp.

{
       if (isStaticOrKinematicObject())
              return;

       m_linearVelocity += m_totalForce * (m_inverseMass * step);
       m_angularVelocity += m_invInertiaTensorWorld * m_totalTorque * step;

#define MAX_ANGVEL SIMD_HALF_PI

       btScalar angvel = m_angularVelocity.length();
       if (angvel*step > MAX_ANGVEL)
       {
              m_angularVelocity *= (MAX_ANGVEL/step) /angvel;
       }

}

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE void btRigidBody::internalApplyImpulse ( const btVector3 linearComponent,
const btVector3 angularComponent,
btScalar  impulseMagnitude 
) [inline]

Definition at line 266 of file btRigidBody.h.

       {
              if (m_inverseMass != btScalar(0.))
              {
                     m_linearVelocity += linearComponent*impulseMagnitude;
                     if (m_angularFactor)
                     {
                            m_angularVelocity += angularComponent*impulseMagnitude*m_angularFactor;
                     }
              }
       }

Here is the caller graph for this function:

bool btRigidBody::isInWorld ( ) const [inline]

Definition at line 436 of file btRigidBody.h.

       {
              return (getBroadphaseProxy() != 0);
       }

Here is the call graph for this function:

void btRigidBody::predictIntegratedTransform ( btScalar  step,
btTransform predictedTransform 
)

continuous collision detection needs prediction

Definition at line 90 of file btRigidBody.cpp.

{
       btTransformUtil::integrateTransform(m_worldTransform,m_linearVelocity,m_angularVelocity,timeStep,predictedTransform);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void btRigidBody::proceedToTransform ( const btTransform newTrans)

Definition at line 201 of file btRigidBody.cpp.

{
       setCenterOfMassTransform( newTrans );
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 301 of file btRigidBody.cpp.

{
       m_constraintRefs.remove(c);
       m_checkCollideWith = m_constraintRefs.size() > 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 95 of file btRigidBody.cpp.

{
       //todo: clamp to some (user definable) safe minimum timestep, to limit maximum angular/linear velocities
       if (timeStep != btScalar(0.))
       {
              //if we use motionstate to synchronize world transforms, get the new kinematic/animated world transform
              if (getMotionState())
                     getMotionState()->getWorldTransform(m_worldTransform);
              btVector3 linVel,angVel;
              
              btTransformUtil::calculateVelocity(m_interpolationWorldTransform,m_worldTransform,timeStep,m_linearVelocity,m_angularVelocity);
              m_interpolationLinearVelocity = m_linearVelocity;
              m_interpolationAngularVelocity = m_angularVelocity;
              m_interpolationWorldTransform = m_worldTransform;
              //printf("angular = %f %f %f\n",m_angularVelocity.getX(),m_angularVelocity.getY(),m_angularVelocity.getZ());
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void btRigidBody::setAngularFactor ( btScalar  angFac) [inline]

Definition at line 426 of file btRigidBody.h.

       {
              m_angularFactor = angFac;
       }

Here is the caller graph for this function:

void btRigidBody::setAngularVelocity ( const btVector3 ang_vel) [inline]

Definition at line 308 of file btRigidBody.h.

                                                                { 
              assert (m_collisionFlags != btCollisionObject::CF_STATIC_OBJECT);
              {
                     m_angularVelocity = ang_vel; 
              }
       }

Here is the caller graph for this function:

Definition at line 259 of file btRigidBody.cpp.

{

       if (isStaticOrKinematicObject())
       {
              m_interpolationWorldTransform = m_worldTransform;
       } else
       {
              m_interpolationWorldTransform = xform;
       }
       m_interpolationLinearVelocity = getLinearVelocity();
       m_interpolationAngularVelocity = getAngularVelocity();
       m_worldTransform = xform;
       updateInertiaTensor();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void btRigidBody::setDamping ( btScalar  lin_damping,
btScalar  ang_damping 
)

Definition at line 134 of file btRigidBody.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void btRigidBody::setGravity ( const btVector3 acceleration)

Definition at line 121 of file btRigidBody.cpp.

{
       if (m_inverseMass != btScalar(0.0))
       {
              m_gravity = acceleration * (btScalar(1.0) / m_inverseMass);
       }
}

Here is the caller graph for this function:

void btRigidBody::setInvInertiaDiagLocal ( const btVector3 diagInvInertia) [inline]

Definition at line 221 of file btRigidBody.h.

       {
              m_invInertiaLocal = diagInvInertia;
       }
void btRigidBody::setLinearVelocity ( const btVector3 lin_vel) [inline]

Definition at line 302 of file btRigidBody.h.

       { 
              assert (m_collisionFlags != btCollisionObject::CF_STATIC_OBJECT);
              m_linearVelocity = lin_vel; 
       }

Here is the caller graph for this function:

void btRigidBody::setMassProps ( btScalar  mass,
const btVector3 inertia 
)

Definition at line 207 of file btRigidBody.cpp.

{
       if (mass == btScalar(0.))
       {
              m_collisionFlags |= btCollisionObject::CF_STATIC_OBJECT;
              m_inverseMass = btScalar(0.);
       } else
       {
              m_collisionFlags &= (~btCollisionObject::CF_STATIC_OBJECT);
              m_inverseMass = btScalar(1.0) / mass;
       }
       
       m_invInertiaLocal.setValue(inertia.x() != btScalar(0.0) ? btScalar(1.0) / inertia.x(): btScalar(0.0),
                               inertia.y() != btScalar(0.0) ? btScalar(1.0) / inertia.y(): btScalar(0.0),
                               inertia.z() != btScalar(0.0) ? btScalar(1.0) / inertia.z(): btScalar(0.0));

}

Here is the call graph for this function:

Here is the caller graph for this function:

void btRigidBody::setMotionState ( btMotionState motionState) [inline]

Definition at line 415 of file btRigidBody.h.

       {
              m_optionalMotionState = motionState;
              if (m_optionalMotionState)
                     motionState->getWorldTransform(m_worldTransform);
       }

Here is the call graph for this function:

void btRigidBody::setNewBroadphaseProxy ( btBroadphaseProxy *  broadphaseProxy) [inline]

Definition at line 401 of file btRigidBody.h.

       {
              m_broadphaseHandle = broadphaseProxy;
       }
void btRigidBody::setSleepingThresholds ( btScalar  linear,
btScalar  angular 
) [inline]

Definition at line 226 of file btRigidBody.h.

void btRigidBody::setupRigidBody ( const btRigidBodyConstructionInfo constructionInfo) [protected]

setupRigidBody is only used internally by the constructor

Definition at line 40 of file btRigidBody.cpp.

{

       m_internalType=CO_RIGID_BODY;

       m_linearVelocity.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
       m_angularVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
       m_angularFactor = btScalar(1.);
       m_gravity.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
       m_totalForce.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
       m_totalTorque.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0)),
       m_linearDamping = btScalar(0.);
       m_angularDamping = btScalar(0.5);
       m_linearSleepingThreshold = constructionInfo.m_linearSleepingThreshold;
       m_angularSleepingThreshold = constructionInfo.m_angularSleepingThreshold;
       m_optionalMotionState = constructionInfo.m_motionState;
       m_contactSolverType = 0;
       m_frictionSolverType = 0;
       m_additionalDamping = constructionInfo.m_additionalDamping;
       m_additionalDampingFactor = constructionInfo.m_additionalDampingFactor;
       m_additionalLinearDampingThresholdSqr = constructionInfo.m_additionalLinearDampingThresholdSqr;
       m_additionalAngularDampingThresholdSqr = constructionInfo.m_additionalAngularDampingThresholdSqr;
       m_additionalAngularDampingFactor = constructionInfo.m_additionalAngularDampingFactor;

       if (m_optionalMotionState)
       {
              m_optionalMotionState->getWorldTransform(m_worldTransform);
       } else
       {
              m_worldTransform = constructionInfo.m_startWorldTransform;
       }

       m_interpolationWorldTransform = m_worldTransform;
       m_interpolationLinearVelocity.setValue(0,0,0);
       m_interpolationAngularVelocity.setValue(0,0,0);
       
       //moved to btCollisionObject
       m_friction = constructionInfo.m_friction;
       m_restitution = constructionInfo.m_restitution;

       m_collisionShape = constructionInfo.m_collisionShape;
       m_debugBodyId = uniqueId++;
       
       setMassProps(constructionInfo.m_mass, constructionInfo.m_localInertia);
    setDamping(constructionInfo.m_linearDamping, constructionInfo.m_angularDamping);
       updateInertiaTensor();

}

Here is the call graph for this function:

Here is the caller graph for this function:

void btRigidBody::translate ( const btVector3 v) [inline]

Definition at line 324 of file btRigidBody.h.

       {
              m_worldTransform.getOrigin() += v; 
       }
static const btRigidBody* btRigidBody::upcast ( const btCollisionObject *  colObj) [inline, static]

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 161 of file btRigidBody.h.

       {
              if (colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
                     return (const btRigidBody*)colObj;
              return 0;
       }

Here is the caller graph for this function:

static btRigidBody* btRigidBody::upcast ( btCollisionObject *  colObj) [inline, static]

Definition at line 167 of file btRigidBody.h.

       {
              if (colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
                     return (btRigidBody*)colObj;
              return 0;
       }

Definition at line 354 of file btRigidBody.h.

       {
              if ( (getActivationState() == ISLAND_SLEEPING) || (getActivationState() == DISABLE_DEACTIVATION))
                     return;

              if ((getLinearVelocity().length2() < m_linearSleepingThreshold*m_linearSleepingThreshold) &&
                     (getAngularVelocity().length2() < m_angularSleepingThreshold*m_angularSleepingThreshold))
              {
                     m_deactivationTime += timeStep;
              } else
              {
                     m_deactivationTime=btScalar(0.);
                     setActivationState(0);
              }

       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 227 of file btRigidBody.cpp.

{
       m_invInertiaTensorWorld = m_worldTransform.getBasis().scaled(m_invInertiaLocal) * m_worldTransform.getBasis().transpose();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 371 of file btRigidBody.h.

       {

              if (getActivationState() == DISABLE_DEACTIVATION)
                     return false;

              //disable deactivation
              if (gDisableDeactivation || (gDeactivationTime == btScalar(0.)))
                     return false;

              if ( (getActivationState() == ISLAND_SLEEPING) || (getActivationState() == WANTS_DEACTIVATION))
                     return true;

              if (m_deactivationTime> gDeactivationTime)
              {
                     return true;
              }
              return false;
       }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 63 of file btRigidBody.h.

Definition at line 62 of file btRigidBody.h.

Definition at line 59 of file btRigidBody.h.

Definition at line 60 of file btRigidBody.h.

Definition at line 61 of file btRigidBody.h.

Definition at line 57 of file btRigidBody.h.

Definition at line 49 of file btRigidBody.h.

Definition at line 67 of file btRigidBody.h.

Definition at line 47 of file btRigidBody.h.

Definition at line 73 of file btRigidBody.h.

Definition at line 423 of file btRigidBody.h.

Definition at line 456 of file btRigidBody.h.

Definition at line 424 of file btRigidBody.h.

Definition at line 51 of file btRigidBody.h.

Definition at line 48 of file btRigidBody.h.

Definition at line 52 of file btRigidBody.h.

Definition at line 45 of file btRigidBody.h.

Definition at line 56 of file btRigidBody.h.

Definition at line 66 of file btRigidBody.h.

Definition at line 46 of file btRigidBody.h.

Definition at line 70 of file btRigidBody.h.

Definition at line 53 of file btRigidBody.h.

Definition at line 54 of file btRigidBody.h.


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