Public Member Functions | Private Attributes

btHingeConstraint Class Reference

hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space axis defines the orientation of the hinge axis More...

#include <btHingeConstraint.h>

Inheritance diagram for btHingeConstraint:
Inheritance graph
[legend]
Collaboration diagram for btHingeConstraint:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BT_DECLARE_ALIGNED_ALLOCATOR ()
 btHingeConstraint (btRigidBody &rbA, btRigidBody &rbB, const btVector3 &pivotInA, const btVector3 &pivotInB, const btVector3 &axisInA, const btVector3 &axisInB, bool useReferenceFrameA=false)
 btHingeConstraint (btRigidBody &rbA, const btVector3 &pivotInA, const btVector3 &axisInA, bool useReferenceFrameA=false)
 btHingeConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame, bool useReferenceFrameA=false)
 btHingeConstraint (btRigidBody &rbA, const btTransform &rbAFrame, bool useReferenceFrameA=false)
virtual void buildJacobian ()
 internal method used by the constraint solver, don't use them directly
virtual void getInfo1 (btConstraintInfo1 *info)
 internal method used by the constraint solver, don't use them directly
void getInfo1NonVirtual (btConstraintInfo1 *info)
virtual void getInfo2 (btConstraintInfo2 *info)
 internal method used by the constraint solver, don't use them directly
void getInfo2NonVirtual (btConstraintInfo2 *info, const btTransform &transA, const btTransform &transB, const btVector3 &angVelA, const btVector3 &angVelB)
void getInfo2Internal (btConstraintInfo2 *info, const btTransform &transA, const btTransform &transB, const btVector3 &angVelA, const btVector3 &angVelB)
void getInfo2InternalUsingFrameOffset (btConstraintInfo2 *info, const btTransform &transA, const btTransform &transB, const btVector3 &angVelA, const btVector3 &angVelB)
void updateRHS (btScalar timeStep)
const btRigidBodygetRigidBodyA () const
const btRigidBodygetRigidBodyB () const
btRigidBodygetRigidBodyA ()
btRigidBodygetRigidBodyB ()
btTransformgetFrameOffsetA ()
btTransformgetFrameOffsetB ()
void setFrames (const btTransform &frameA, const btTransform &frameB)
void setAngularOnly (bool angularOnly)
void enableAngularMotor (bool enableMotor, btScalar targetVelocity, btScalar maxMotorImpulse)
void enableMotor (bool enableMotor)
void setMaxMotorImpulse (btScalar maxMotorImpulse)
void setMotorTarget (const btQuaternion &qAinB, btScalar dt)
void setMotorTarget (btScalar targetAngle, btScalar dt)
void setLimit (btScalar low, btScalar high, btScalar _softness=0.9f, btScalar _biasFactor=0.3f, btScalar _relaxationFactor=1.0f)
void setAxis (btVector3 &axisInA)
btScalar getLowerLimit () const
btScalar getUpperLimit () const
btScalar getHingeAngle ()
btScalar getHingeAngle (const btTransform &transA, const btTransform &transB)
void testLimit (const btTransform &transA, const btTransform &transB)
const btTransformgetAFrame () const
const btTransformgetBFrame () const
btTransformgetAFrame ()
btTransformgetBFrame ()
int getSolveLimit ()
btScalar getLimitSign ()
bool getAngularOnly ()
bool getEnableAngularMotor ()
btScalar getMotorTargetVelosity ()
btScalar getMaxMotorImpulse ()
bool getUseFrameOffset ()
void setUseFrameOffset (bool frameOffsetOnOff)
virtual void setParam (int num, btScalar value, int axis=-1)
 override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5).
virtual btScalar getParam (int num, int axis=-1) const
 return the local value of parameter
virtual int calculateSerializeBufferSize () const
virtual const char * serialize (void *dataBuffer, btSerializer *serializer) const
 fills the dataBuffer and returns the struct name (and 0 on failure)

Private Attributes

btJacobianEntry m_jac [3]
btJacobianEntry m_jacAng [3]
btTransform m_rbAFrame
btTransform m_rbBFrame
btScalar m_motorTargetVelocity
btScalar m_maxMotorImpulse
btAngularLimit m_limit
btScalar m_kHinge
btScalar m_accLimitImpulse
btScalar m_hingeAngle
btScalar m_referenceSign
bool m_angularOnly
bool m_enableAngularMotor
bool m_useSolveConstraintObsolete
bool m_useOffsetForConstraintFrame
bool m_useReferenceFrameA
btScalar m_accMotorImpulse
int m_flags
btScalar m_normalCFM
btScalar m_stopCFM
btScalar m_stopERP

Detailed Description

hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space axis defines the orientation of the hinge axis

Definition at line 50 of file btHingeConstraint.h.


Constructor & Destructor Documentation

btHingeConstraint::btHingeConstraint ( btRigidBody rbA,
btRigidBody rbB,
const btVector3 pivotInA,
const btVector3 pivotInB,
const btVector3 axisInA,
const btVector3 axisInB,
bool  useReferenceFrameA = false 
)

Definition at line 37 of file btHingeConstraint.cpp.

btHingeConstraint::btHingeConstraint ( btRigidBody rbA,
const btVector3 pivotInA,
const btVector3 axisInA,
bool  useReferenceFrameA = false 
)

Definition at line 95 of file btHingeConstraint.cpp.

btHingeConstraint::btHingeConstraint ( btRigidBody rbA,
btRigidBody rbB,
const btTransform rbAFrame,
const btTransform rbBFrame,
bool  useReferenceFrameA = false 
)

Definition at line 143 of file btHingeConstraint.cpp.

btHingeConstraint::btHingeConstraint ( btRigidBody rbA,
const btTransform rbAFrame,
bool  useReferenceFrameA = false 
)

not providing rigidbody B means implicitly using worldspace for body B

Definition at line 170 of file btHingeConstraint.cpp.


Member Function Documentation

btHingeConstraint::BT_DECLARE_ALIGNED_ALLOCATOR (  ) 

Reimplemented from btTypedConstraint.

void btHingeConstraint::buildJacobian (  )  [virtual]

internal method used by the constraint solver, don't use them directly

Reimplemented from btTypedConstraint.

Definition at line 199 of file btHingeConstraint.cpp.

int btHingeConstraint::calculateSerializeBufferSize (  )  const [inline, virtual]

Reimplemented from btTypedConstraint.

Definition at line 347 of file btHingeConstraint.h.

void btHingeConstraint::enableAngularMotor ( bool  enableMotor,
btScalar  targetVelocity,
btScalar  maxMotorImpulse 
) [inline]

Definition at line 166 of file btHingeConstraint.h.

void btHingeConstraint::enableMotor ( bool  enableMotor  )  [inline]

Definition at line 176 of file btHingeConstraint.h.

btTransform& btHingeConstraint::getAFrame (  )  [inline]

Definition at line 249 of file btHingeConstraint.h.

const btTransform& btHingeConstraint::getAFrame (  )  const [inline]

Definition at line 246 of file btHingeConstraint.h.

bool btHingeConstraint::getAngularOnly (  )  [inline]

Definition at line 270 of file btHingeConstraint.h.

btTransform& btHingeConstraint::getBFrame (  )  [inline]

Definition at line 250 of file btHingeConstraint.h.

const btTransform& btHingeConstraint::getBFrame (  )  const [inline]

Definition at line 247 of file btHingeConstraint.h.

bool btHingeConstraint::getEnableAngularMotor (  )  [inline]

Definition at line 274 of file btHingeConstraint.h.

btTransform& btHingeConstraint::getFrameOffsetA (  )  [inline]

Definition at line 149 of file btHingeConstraint.h.

btTransform& btHingeConstraint::getFrameOffsetB (  )  [inline]

Definition at line 154 of file btHingeConstraint.h.

btScalar btHingeConstraint::getHingeAngle (  ) 

Definition at line 601 of file btHingeConstraint.cpp.

btScalar btHingeConstraint::getHingeAngle ( const btTransform transA,
const btTransform transB 
)

Definition at line 606 of file btHingeConstraint.cpp.

void btHingeConstraint::getInfo1 ( btConstraintInfo1 info  )  [virtual]

internal method used by the constraint solver, don't use them directly

Implements btTypedConstraint.

Definition at line 288 of file btHingeConstraint.cpp.

void btHingeConstraint::getInfo1NonVirtual ( btConstraintInfo1 info  ) 

Definition at line 311 of file btHingeConstraint.cpp.

void btHingeConstraint::getInfo2 ( btConstraintInfo2 info  )  [virtual]

internal method used by the constraint solver, don't use them directly

Implements btTypedConstraint.

Definition at line 326 of file btHingeConstraint.cpp.

void btHingeConstraint::getInfo2Internal ( btConstraintInfo2 info,
const btTransform transA,
const btTransform transB,
const btVector3 angVelA,
const btVector3 angVelB 
)

Definition at line 348 of file btHingeConstraint.cpp.

void btHingeConstraint::getInfo2InternalUsingFrameOffset ( btConstraintInfo2 info,
const btTransform transA,
const btTransform transB,
const btVector3 angVelA,
const btVector3 angVelB 
)

Definition at line 697 of file btHingeConstraint.cpp.

void btHingeConstraint::getInfo2NonVirtual ( btConstraintInfo2 info,
const btTransform transA,
const btTransform transB,
const btVector3 angVelA,
const btVector3 angVelB 
)

the regular (virtual) implementation getInfo2 already performs 'testLimit' during getInfo1, so we need to do it now

Definition at line 339 of file btHingeConstraint.cpp.

btScalar btHingeConstraint::getLimitSign (  )  [inline]

Definition at line 261 of file btHingeConstraint.h.

btScalar btHingeConstraint::getLowerLimit (  )  const [inline]

Definition at line 220 of file btHingeConstraint.h.

btScalar btHingeConstraint::getMaxMotorImpulse (  )  [inline]

Definition at line 282 of file btHingeConstraint.h.

btScalar btHingeConstraint::getMotorTargetVelosity (  )  [inline]

Definition at line 278 of file btHingeConstraint.h.

btScalar btHingeConstraint::getParam ( int  num,
int  axis = -1 
) const [virtual]

return the local value of parameter

Implements btTypedConstraint.

Definition at line 1004 of file btHingeConstraint.cpp.

const btRigidBody& btHingeConstraint::getRigidBodyA (  )  const [inline]

Reimplemented from btTypedConstraint.

Definition at line 130 of file btHingeConstraint.h.

btRigidBody& btHingeConstraint::getRigidBodyA (  )  [inline]

Reimplemented from btTypedConstraint.

Definition at line 139 of file btHingeConstraint.h.

const btRigidBody& btHingeConstraint::getRigidBodyB (  )  const [inline]

Reimplemented from btTypedConstraint.

Definition at line 134 of file btHingeConstraint.h.

btRigidBody& btHingeConstraint::getRigidBodyB (  )  [inline]

Reimplemented from btTypedConstraint.

Definition at line 144 of file btHingeConstraint.h.

int btHingeConstraint::getSolveLimit (  )  [inline]

Definition at line 252 of file btHingeConstraint.h.

btScalar btHingeConstraint::getUpperLimit (  )  const [inline]

Definition at line 229 of file btHingeConstraint.h.

bool btHingeConstraint::getUseFrameOffset (  )  [inline]

Definition at line 287 of file btHingeConstraint.h.

const char * btHingeConstraint::serialize ( void *  dataBuffer,
btSerializer serializer 
) const [inline, virtual]

fills the dataBuffer and returns the struct name (and 0 on failure)

Reimplemented from btTypedConstraint.

Definition at line 353 of file btHingeConstraint.h.

void btHingeConstraint::setAngularOnly ( bool  angularOnly  )  [inline]

Definition at line 161 of file btHingeConstraint.h.

void btHingeConstraint::setAxis ( btVector3 axisInA  )  [inline]

Definition at line 195 of file btHingeConstraint.h.

void btHingeConstraint::setFrames ( const btTransform frameA,
const btTransform frameB 
)

Definition at line 586 of file btHingeConstraint.cpp.

void btHingeConstraint::setLimit ( btScalar  low,
btScalar  high,
btScalar  _softness = 0.9f,
btScalar  _biasFactor = 0.3f,
btScalar  _relaxationFactor = 1.0f 
) [inline]

Definition at line 182 of file btHingeConstraint.h.

void btHingeConstraint::setMaxMotorImpulse ( btScalar  maxMotorImpulse  )  [inline]

Definition at line 177 of file btHingeConstraint.h.

void btHingeConstraint::setMotorTarget ( btScalar  targetAngle,
btScalar  dt 
)

Definition at line 676 of file btHingeConstraint.cpp.

void btHingeConstraint::setMotorTarget ( const btQuaternion qAinB,
btScalar  dt 
)

Definition at line 651 of file btHingeConstraint.cpp.

void btHingeConstraint::setParam ( int  num,
btScalar  value,
int  axis = -1 
) [virtual]

override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5).

If no axis is provided, it uses the default axis for this constraint.

Implements btTypedConstraint.

Definition at line 975 of file btHingeConstraint.cpp.

void btHingeConstraint::setUseFrameOffset ( bool  frameOffsetOnOff  )  [inline]

Definition at line 288 of file btHingeConstraint.h.

void btHingeConstraint::testLimit ( const btTransform transA,
const btTransform transB 
)

Definition at line 618 of file btHingeConstraint.cpp.

void btHingeConstraint::updateRHS ( btScalar  timeStep  ) 

Definition at line 594 of file btHingeConstraint.cpp.


Member Data Documentation

Definition at line 83 of file btHingeConstraint.h.

Definition at line 93 of file btHingeConstraint.h.

Definition at line 87 of file btHingeConstraint.h.

Definition at line 88 of file btHingeConstraint.h.

Definition at line 95 of file btHingeConstraint.h.

Definition at line 84 of file btHingeConstraint.h.

Definition at line 55 of file btHingeConstraint.h.

Definition at line 56 of file btHingeConstraint.h.

Definition at line 80 of file btHingeConstraint.h.

Definition at line 66 of file btHingeConstraint.h.

Definition at line 62 of file btHingeConstraint.h.

Definition at line 61 of file btHingeConstraint.h.

Definition at line 96 of file btHingeConstraint.h.

Definition at line 58 of file btHingeConstraint.h.

Definition at line 59 of file btHingeConstraint.h.

Definition at line 85 of file btHingeConstraint.h.

Definition at line 97 of file btHingeConstraint.h.

Definition at line 98 of file btHingeConstraint.h.

Definition at line 90 of file btHingeConstraint.h.

Definition at line 91 of file btHingeConstraint.h.

Definition at line 89 of file btHingeConstraint.h.


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