Bullet Collision Detection & Physics Library
Public Member Functions | Private Member Functions | Private Attributes | List of all members
btMultiBody Class Reference

#include <btMultiBody.h>

Collaboration diagram for btMultiBody:
Collaboration graph
[legend]

Public Member Functions

 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
 btMultiBody (int n_links, btScalar mass, const btVector3 &inertia, bool fixed_base_, bool can_sleep_)
 
 ~btMultiBody ()
 
void setupPrismatic (int i, btScalar mass, const btVector3 &inertia, int parent, const btQuaternion &rot_parent_to_this, const btVector3 &joint_axis, const btVector3 &r_vector_when_q_zero, bool disableParentCollision=false)
 
void setupRevolute (int i, btScalar mass, const btVector3 &inertia, int parent, const btQuaternion &zero_rot_parent_to_this, const btVector3 &joint_axis, const btVector3 &parent_axis_position, const btVector3 &my_axis_position, bool disableParentCollision=false)
 
const btMultibodyLinkgetLink (int index) const
 
btMultibodyLinkgetLink (int index)
 
void setBaseCollider (btMultiBodyLinkCollider *collider)
 
const btMultiBodyLinkCollidergetBaseCollider () const
 
btMultiBodyLinkCollidergetBaseCollider ()
 
int getParent (int link_num) const
 
int getNumLinks () const
 
btScalar getBaseMass () const
 
const btVector3getBaseInertia () const
 
btScalar getLinkMass (int i) const
 
const btVector3getLinkInertia (int i) const
 
void setBaseMass (btScalar mass)
 
void setBaseInertia (const btVector3 &inertia)
 
const btVector3getBasePos () const
 
const btVector3 getBaseVel () const
 
const btQuaterniongetWorldToBaseRot () const
 
btVector3 getBaseOmega () const
 
void setBasePos (const btVector3 &pos)
 
void setBaseVel (const btVector3 &vel)
 
void setWorldToBaseRot (const btQuaternion &rot)
 
void setBaseOmega (const btVector3 &omega)
 
btScalar getJointPos (int i) const
 
btScalar getJointVel (int i) const
 
void setJointPos (int i, btScalar q)
 
void setJointVel (int i, btScalar qdot)
 
const btScalargetVelocityVector () const
 
const btVector3getRVector (int i) const
 
const btQuaterniongetParentToLocalRot (int i) const
 
btVector3 localPosToWorld (int i, const btVector3 &vec) const
 
btVector3 localDirToWorld (int i, const btVector3 &vec) const
 
btVector3 worldPosToLocal (int i, const btVector3 &vec) const
 
btVector3 worldDirToLocal (int i, const btVector3 &vec) const
 
btScalar getKineticEnergy () const
 
btVector3 getAngularMomentum () const
 
void clearForcesAndTorques ()
 
void clearVelocities ()
 
void addBaseForce (const btVector3 &f)
 
void addBaseTorque (const btVector3 &t)
 
void addLinkForce (int i, const btVector3 &f)
 
void addLinkTorque (int i, const btVector3 &t)
 
void addJointTorque (int i, btScalar Q)
 
const btVector3getBaseForce () const
 
const btVector3getBaseTorque () const
 
const btVector3getLinkForce (int i) const
 
const btVector3getLinkTorque (int i) const
 
btScalar getJointTorque (int i) const
 
void stepVelocities (btScalar dt, btAlignedObjectArray< btScalar > &scratch_r, btAlignedObjectArray< btVector3 > &scratch_v, btAlignedObjectArray< btMatrix3x3 > &scratch_m)
 
void calcAccelerationDeltas (const btScalar *force, btScalar *output, btAlignedObjectArray< btScalar > &scratch_r, btAlignedObjectArray< btVector3 > &scratch_v) const
 
void applyDeltaVee (const btScalar *delta_vee)
 
void applyDeltaVee (const btScalar *delta_vee, btScalar multiplier)
 
void stepPositions (btScalar dt)
 
void fillContactJacobian (int link, const btVector3 &contact_point, const btVector3 &normal, btScalar *jac, btAlignedObjectArray< btScalar > &scratch_r, btAlignedObjectArray< btVector3 > &scratch_v, btAlignedObjectArray< btMatrix3x3 > &scratch_m) const
 
void setCanSleep (bool canSleep)
 
bool isAwake () const
 
void wakeUp ()
 
void goToSleep ()
 
void checkMotionAndSleepIfRequired (btScalar timestep)
 
bool hasFixedBase () const
 
int getCompanionId () const
 
void setCompanionId (int id)
 
void setNumLinks (int numLinks)
 
btScalar getLinearDamping () const
 
void setLinearDamping (btScalar damp)
 
btScalar getAngularDamping () const
 
bool getUseGyroTerm () const
 
void setUseGyroTerm (bool useGyro)
 
btScalar getMaxAppliedImpulse () const
 
void setMaxAppliedImpulse (btScalar maxImp)
 
void setHasSelfCollision (bool hasSelfCollision)
 
bool hasSelfCollision () const
 

Private Member Functions

 btMultiBody (const btMultiBody &)
 
void operator= (const btMultiBody &)
 
void compTreeLinkVelocities (btVector3 *omega, btVector3 *vel) const
 
void solveImatrix (const btVector3 &rhs_top, const btVector3 &rhs_bot, float result[6]) const
 

Private Attributes

btMultiBodyLinkColliderm_baseCollider
 
btVector3 base_pos
 
btQuaternion base_quat
 
btScalar base_mass
 
btVector3 base_inertia
 
btVector3 base_force
 
btVector3 base_torque
 
btAlignedObjectArray
< btMultibodyLink
links
 
btAlignedObjectArray
< btMultiBodyLinkCollider * > 
m_colliders
 
btAlignedObjectArray< btScalarm_real_buf
 
btAlignedObjectArray< btVector3vector_buf
 
btAlignedObjectArray< btMatrix3x3matrix_buf
 
btMatrix3x3 cached_inertia_top_left
 
btMatrix3x3 cached_inertia_top_right
 
btMatrix3x3 cached_inertia_lower_left
 
btMatrix3x3 cached_inertia_lower_right
 
bool fixed_base
 
bool awake
 
bool can_sleep
 
btScalar sleep_timer
 
int m_companionId
 
btScalar m_linearDamping
 
btScalar m_angularDamping
 
bool m_useGyroTerm
 
btScalar m_maxAppliedImpulse
 
bool m_hasSelfCollision
 

Detailed Description

Definition at line 37 of file btMultiBody.h.

Constructor & Destructor Documentation

btMultiBody::btMultiBody ( int  n_links,
btScalar  mass,
const btVector3 inertia,
bool  fixed_base_,
bool  can_sleep_ 
)

Definition at line 79 of file btMultiBody.cpp.

btMultiBody::~btMultiBody ( )

Definition at line 109 of file btMultiBody.cpp.

btMultiBody::btMultiBody ( const btMultiBody )
private

Member Function Documentation

void btMultiBody::addBaseForce ( const btVector3 f)
inline

Definition at line 221 of file btMultiBody.h.

void btMultiBody::addBaseTorque ( const btVector3 t)
inline

Definition at line 225 of file btMultiBody.h.

void btMultiBody::addJointTorque ( int  i,
btScalar  Q 
)

Definition at line 350 of file btMultiBody.cpp.

void btMultiBody::addLinkForce ( int  i,
const btVector3 f 
)

Definition at line 340 of file btMultiBody.cpp.

void btMultiBody::addLinkTorque ( int  i,
const btVector3 t 
)

Definition at line 345 of file btMultiBody.cpp.

void btMultiBody::applyDeltaVee ( const btScalar delta_vee)
inline

Definition at line 269 of file btMultiBody.h.

void btMultiBody::applyDeltaVee ( const btScalar delta_vee,
btScalar  multiplier 
)
inline

Definition at line 278 of file btMultiBody.h.

btMultiBody::BT_DECLARE_ALIGNED_ALLOCATOR ( )
void btMultiBody::calcAccelerationDeltas ( const btScalar force,
btScalar output,
btAlignedObjectArray< btScalar > &  scratch_r,
btAlignedObjectArray< btVector3 > &  scratch_v 
) const

Definition at line 732 of file btMultiBody.cpp.

void btMultiBody::checkMotionAndSleepIfRequired ( btScalar  timestep)

Definition at line 982 of file btMultiBody.cpp.

void btMultiBody::clearForcesAndTorques ( )

Definition at line 321 of file btMultiBody.cpp.

void btMultiBody::clearVelocities ( )

Definition at line 333 of file btMultiBody.cpp.

void btMultiBody::compTreeLinkVelocities ( btVector3 omega,
btVector3 vel 
) const
private

Definition at line 259 of file btMultiBody.cpp.

void btMultiBody::fillContactJacobian ( int  link,
const btVector3 contact_point,
const btVector3 normal,
btScalar jac,
btAlignedObjectArray< btScalar > &  scratch_r,
btAlignedObjectArray< btVector3 > &  scratch_v,
btAlignedObjectArray< btMatrix3x3 > &  scratch_m 
) const

Definition at line 892 of file btMultiBody.cpp.

btScalar btMultiBody::getAngularDamping ( ) const
inline

Definition at line 368 of file btMultiBody.h.

btVector3 btMultiBody::getAngularMomentum ( ) const

Definition at line 300 of file btMultiBody.cpp.

const btMultiBodyLinkCollider* btMultiBody::getBaseCollider ( ) const
inline

Definition at line 91 of file btMultiBody.h.

btMultiBodyLinkCollider* btMultiBody::getBaseCollider ( )
inline

Definition at line 95 of file btMultiBody.h.

const btVector3& btMultiBody::getBaseForce ( ) const
inline

Definition at line 230 of file btMultiBody.h.

const btVector3& btMultiBody::getBaseInertia ( ) const
inline

Definition at line 114 of file btMultiBody.h.

btScalar btMultiBody::getBaseMass ( ) const
inline

Definition at line 113 of file btMultiBody.h.

btVector3 btMultiBody::getBaseOmega ( ) const
inline

Definition at line 140 of file btMultiBody.h.

const btVector3& btMultiBody::getBasePos ( ) const
inline

Definition at line 131 of file btMultiBody.h.

const btVector3& btMultiBody::getBaseTorque ( ) const
inline

Definition at line 231 of file btMultiBody.h.

const btVector3 btMultiBody::getBaseVel ( ) const
inline

Definition at line 132 of file btMultiBody.h.

int btMultiBody::getCompanionId ( ) const
inline

Definition at line 345 of file btMultiBody.h.

btScalar btMultiBody::getJointPos ( int  i) const

Definition at line 180 of file btMultiBody.cpp.

btScalar btMultiBody::getJointTorque ( int  i) const

Definition at line 365 of file btMultiBody.cpp.

btScalar btMultiBody::getJointVel ( int  i) const

Definition at line 185 of file btMultiBody.cpp.

btScalar btMultiBody::getKineticEnergy ( ) const

Definition at line 280 of file btMultiBody.cpp.

btScalar btMultiBody::getLinearDamping ( ) const
inline

Definition at line 360 of file btMultiBody.h.

const btMultibodyLink& btMultiBody::getLink ( int  index) const
inline

Definition at line 76 of file btMultiBody.h.

btMultibodyLink& btMultiBody::getLink ( int  index)
inline

Definition at line 81 of file btMultiBody.h.

const btVector3 & btMultiBody::getLinkForce ( int  i) const

Definition at line 355 of file btMultiBody.cpp.

const btVector3 & btMultiBody::getLinkInertia ( int  i) const

Definition at line 175 of file btMultiBody.cpp.

btScalar btMultiBody::getLinkMass ( int  i) const

Definition at line 170 of file btMultiBody.cpp.

const btVector3 & btMultiBody::getLinkTorque ( int  i) const

Definition at line 360 of file btMultiBody.cpp.

btScalar btMultiBody::getMaxAppliedImpulse ( ) const
inline

Definition at line 381 of file btMultiBody.h.

int btMultiBody::getNumLinks ( ) const
inline

Definition at line 112 of file btMultiBody.h.

int btMultiBody::getParent ( int  link_num) const

Definition at line 165 of file btMultiBody.cpp.

const btQuaternion & btMultiBody::getParentToLocalRot ( int  i) const

Definition at line 206 of file btMultiBody.cpp.

const btVector3 & btMultiBody::getRVector ( int  i) const

Definition at line 201 of file btMultiBody.cpp.

bool btMultiBody::getUseGyroTerm ( ) const
inline

Definition at line 373 of file btMultiBody.h.

const btScalar* btMultiBody::getVelocityVector ( ) const
inline

Definition at line 177 of file btMultiBody.h.

const btQuaternion& btMultiBody::getWorldToBaseRot ( ) const
inline

Definition at line 136 of file btMultiBody.h.

void btMultiBody::goToSleep ( )

Definition at line 977 of file btMultiBody.cpp.

bool btMultiBody::hasFixedBase ( ) const
inline

Definition at line 340 of file btMultiBody.h.

bool btMultiBody::hasSelfCollision ( ) const
inline

Definition at line 394 of file btMultiBody.h.

bool btMultiBody::isAwake ( ) const
inline

Definition at line 335 of file btMultiBody.h.

btVector3 btMultiBody::localDirToWorld ( int  i,
const btVector3 vec 
) const

Definition at line 239 of file btMultiBody.cpp.

btVector3 btMultiBody::localPosToWorld ( int  i,
const btVector3 vec 
) const

Definition at line 211 of file btMultiBody.cpp.

void btMultiBody::operator= ( const btMultiBody )
private
void btMultiBody::setBaseCollider ( btMultiBodyLinkCollider collider)
inline

Definition at line 87 of file btMultiBody.h.

void btMultiBody::setBaseInertia ( const btVector3 inertia)
inline

Definition at line 124 of file btMultiBody.h.

void btMultiBody::setBaseMass ( btScalar  mass)
inline

Definition at line 123 of file btMultiBody.h.

void btMultiBody::setBaseOmega ( const btVector3 omega)
inline

Definition at line 155 of file btMultiBody.h.

void btMultiBody::setBasePos ( const btVector3 pos)
inline

Definition at line 142 of file btMultiBody.h.

void btMultiBody::setBaseVel ( const btVector3 vel)
inline

Definition at line 146 of file btMultiBody.h.

void btMultiBody::setCanSleep ( bool  canSleep)
inline

Definition at line 330 of file btMultiBody.h.

void btMultiBody::setCompanionId ( int  id)
inline

Definition at line 349 of file btMultiBody.h.

void btMultiBody::setHasSelfCollision ( bool  hasSelfCollision)
inline

Definition at line 390 of file btMultiBody.h.

void btMultiBody::setJointPos ( int  i,
btScalar  q 
)

Definition at line 190 of file btMultiBody.cpp.

void btMultiBody::setJointVel ( int  i,
btScalar  qdot 
)

Definition at line 196 of file btMultiBody.cpp.

void btMultiBody::setLinearDamping ( btScalar  damp)
inline

Definition at line 364 of file btMultiBody.h.

void btMultiBody::setMaxAppliedImpulse ( btScalar  maxImp)
inline

Definition at line 385 of file btMultiBody.h.

void btMultiBody::setNumLinks ( int  numLinks)
inline

Definition at line 355 of file btMultiBody.h.

void btMultiBody::setupPrismatic ( int  i,
btScalar  mass,
const btVector3 inertia,
int  parent,
const btQuaternion rot_parent_to_this,
const btVector3 joint_axis,
const btVector3 r_vector_when_q_zero,
bool  disableParentCollision = false 
)

Definition at line 113 of file btMultiBody.cpp.

void btMultiBody::setupRevolute ( int  i,
btScalar  mass,
const btVector3 inertia,
int  parent,
const btQuaternion zero_rot_parent_to_this,
const btVector3 joint_axis,
const btVector3 parent_axis_position,
const btVector3 my_axis_position,
bool  disableParentCollision = false 
)

Definition at line 137 of file btMultiBody.cpp.

void btMultiBody::setUseGyroTerm ( bool  useGyro)
inline

Definition at line 377 of file btMultiBody.h.

void btMultiBody::setWorldToBaseRot ( const btQuaternion rot)
inline

Definition at line 151 of file btMultiBody.h.

void btMultiBody::solveImatrix ( const btVector3 rhs_top,
const btVector3 rhs_bot,
float  result[6] 
) const
private

solve I * x = rhs, so the result = invI * rhs

Special routine for calculating the inverse of a spatial inertia matrix the 6x6 matrix is stored as 4 blocks of 3x3 matrices

Definition at line 682 of file btMultiBody.cpp.

void btMultiBody::stepPositions ( btScalar  dt)

Definition at line 856 of file btMultiBody.cpp.

void btMultiBody::stepVelocities ( btScalar  dt,
btAlignedObjectArray< btScalar > &  scratch_r,
btAlignedObjectArray< btVector3 > &  scratch_v,
btAlignedObjectArray< btMatrix3x3 > &  scratch_m 
)

Definition at line 393 of file btMultiBody.cpp.

void btMultiBody::wakeUp ( )

Definition at line 972 of file btMultiBody.cpp.

btVector3 btMultiBody::worldDirToLocal ( int  i,
const btVector3 vec 
) const

Definition at line 250 of file btMultiBody.cpp.

btVector3 btMultiBody::worldPosToLocal ( int  i,
const btVector3 vec 
) const

Definition at line 228 of file btMultiBody.cpp.

Member Data Documentation

bool btMultiBody::awake
private

Definition at line 454 of file btMultiBody.h.

btVector3 btMultiBody::base_force
private

Definition at line 418 of file btMultiBody.h.

btVector3 btMultiBody::base_inertia
private

Definition at line 416 of file btMultiBody.h.

btScalar btMultiBody::base_mass
private

Definition at line 415 of file btMultiBody.h.

btVector3 btMultiBody::base_pos
private

Definition at line 412 of file btMultiBody.h.

btQuaternion btMultiBody::base_quat
private

Definition at line 413 of file btMultiBody.h.

btVector3 btMultiBody::base_torque
private

Definition at line 419 of file btMultiBody.h.

btMatrix3x3 btMultiBody::cached_inertia_lower_left
private

Definition at line 448 of file btMultiBody.h.

btMatrix3x3 btMultiBody::cached_inertia_lower_right
private

Definition at line 449 of file btMultiBody.h.

btMatrix3x3 btMultiBody::cached_inertia_top_left
private

Definition at line 446 of file btMultiBody.h.

btMatrix3x3 btMultiBody::cached_inertia_top_right
private

Definition at line 447 of file btMultiBody.h.

bool btMultiBody::can_sleep
private

Definition at line 455 of file btMultiBody.h.

bool btMultiBody::fixed_base
private

Definition at line 451 of file btMultiBody.h.

btAlignedObjectArray<btMultibodyLink> btMultiBody::links
private

Definition at line 421 of file btMultiBody.h.

btScalar btMultiBody::m_angularDamping
private

Definition at line 460 of file btMultiBody.h.

btMultiBodyLinkCollider* btMultiBody::m_baseCollider
private

Definition at line 410 of file btMultiBody.h.

btAlignedObjectArray<btMultiBodyLinkCollider*> btMultiBody::m_colliders
private

Definition at line 422 of file btMultiBody.h.

int btMultiBody::m_companionId
private

Definition at line 458 of file btMultiBody.h.

bool btMultiBody::m_hasSelfCollision
private

Definition at line 463 of file btMultiBody.h.

btScalar btMultiBody::m_linearDamping
private

Definition at line 459 of file btMultiBody.h.

btScalar btMultiBody::m_maxAppliedImpulse
private

Definition at line 462 of file btMultiBody.h.

btAlignedObjectArray<btScalar> btMultiBody::m_real_buf
private

Definition at line 440 of file btMultiBody.h.

bool btMultiBody::m_useGyroTerm
private

Definition at line 461 of file btMultiBody.h.

btAlignedObjectArray<btMatrix3x3> btMultiBody::matrix_buf
private

Definition at line 442 of file btMultiBody.h.

btScalar btMultiBody::sleep_timer
private

Definition at line 456 of file btMultiBody.h.

btAlignedObjectArray<btVector3> btMultiBody::vector_buf
private

Definition at line 441 of file btMultiBody.h.


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