Bullet Collision Detection & Physics Library
Public Member Functions | Private Attributes | List of all members
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]

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 More...
 
virtual void getInfo1 (btConstraintInfo1 *info)
 internal method used by the constraint solver, don't use them directly More...
 
void getInfo1NonVirtual (btConstraintInfo1 *info)
 
virtual void getInfo2 (btConstraintInfo2 *info)
 internal method used by the constraint solver, don't use them directly More...
 
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 setMotorTargetVelocity (btScalar motorTargetVelocity)
 
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)
 
btScalar getLimitSoftness () const
 
btScalar getLimitBiasFactor () const
 
btScalar getLimitRelaxationFactor () const
 
void setAxis (btVector3 &axisInA)
 
bool hasLimit () const
 
btScalar getLowerLimit () const
 
btScalar getUpperLimit () const
 
btScalar getHingeAngle ()
 The getHingeAngle gives the hinge angle in range [-PI,PI]. More...
 
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 getMotorTargetVelocity ()
 
btScalar getMaxMotorImpulse ()
 
bool getUseFrameOffset ()
 
void setUseFrameOffset (bool frameOffsetOnOff)
 
bool getUseReferenceFrameA () const
 
void setUseReferenceFrameA (bool useReferenceFrameA)
 
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). More...
 
virtual btScalar getParam (int num, int axis=-1) const
 return the local value of parameter More...
 
virtual int getFlags () const
 
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) More...
 
- Public Member Functions inherited from btTypedConstraint
 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
virtual ~btTypedConstraint ()
 
 btTypedConstraint (btTypedConstraintType type, btRigidBody &rbA)
 
 btTypedConstraint (btTypedConstraintType type, btRigidBody &rbA, btRigidBody &rbB)
 
int getOverrideNumSolverIterations () const
 
void setOverrideNumSolverIterations (int overideNumIterations)
 override the number of constraint solver iterations used to solve this constraint -1 will use the default number of iterations, as specified in SolverInfo.m_numIterations More...
 
virtual void buildJacobian ()
 internal method used by the constraint solver, don't use them directly More...
 
virtual void setupSolverConstraint (btConstraintArray &ca, int solverBodyA, int solverBodyB, btScalar timeStep)
 internal method used by the constraint solver, don't use them directly More...
 
virtual void getInfo1 (btConstraintInfo1 *info)=0
 internal method used by the constraint solver, don't use them directly More...
 
virtual void getInfo2 (btConstraintInfo2 *info)=0
 internal method used by the constraint solver, don't use them directly More...
 
void internalSetAppliedImpulse (btScalar appliedImpulse)
 internal method used by the constraint solver, don't use them directly More...
 
btScalar internalGetAppliedImpulse ()
 internal method used by the constraint solver, don't use them directly More...
 
btScalar getBreakingImpulseThreshold () const
 
void setBreakingImpulseThreshold (btScalar threshold)
 
bool isEnabled () const
 
void setEnabled (bool enabled)
 
virtual void solveConstraintObsolete (btSolverBody &, btSolverBody &, btScalar)
 internal method used by the constraint solver, don't use them directly More...
 
const btRigidBodygetRigidBodyA () const
 
const btRigidBodygetRigidBodyB () const
 
btRigidBodygetRigidBodyA ()
 
btRigidBodygetRigidBodyB ()
 
int getUserConstraintType () const
 
void setUserConstraintType (int userConstraintType)
 
void setUserConstraintId (int uid)
 
int getUserConstraintId () const
 
void setUserConstraintPtr (void *ptr)
 
void * getUserConstraintPtr ()
 
void setJointFeedback (btJointFeedback *jointFeedback)
 
const btJointFeedbackgetJointFeedback () const
 
btJointFeedbackgetJointFeedback ()
 
int getUid () const
 
bool needsFeedback () const
 
void enableFeedback (bool needsFeedback)
 enableFeedback will allow to read the applied linear and angular impulse use getAppliedImpulse, getAppliedLinearImpulse and getAppliedAngularImpulse to read feedback information More...
 
btScalar getAppliedImpulse () const
 getAppliedImpulse is an estimated total applied impulse. More...
 
btTypedConstraintType getConstraintType () const
 
void setDbgDrawSize (btScalar dbgDrawSize)
 
btScalar getDbgDrawSize ()
 
virtual void setParam (int num, btScalar value, int axis=-1)=0
 override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). More...
 
virtual btScalar getParam (int num, int axis=-1) const =0
 return the local value of parameter More...
 
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) More...
 
- Public Member Functions inherited from btTypedObject
 btTypedObject (int objectType)
 
int getObjectType () const
 

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_normalERP
 
btScalar m_stopCFM
 
btScalar m_stopERP
 

Additional Inherited Members

- Static Public Member Functions inherited from btTypedConstraint
static btRigidBodygetFixedBody ()
 
- Public Attributes inherited from btTypedObject
int m_objectType
 
- Protected Member Functions inherited from btTypedConstraint
btScalar getMotorFactor (btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact)
 internal method used by the constraint solver, don't use them directly More...
 
- Protected Attributes inherited from btTypedConstraint
btRigidBodym_rbA
 
btRigidBodym_rbB
 
btScalar m_appliedImpulse
 
btScalar m_dbgDrawSize
 
btJointFeedbackm_jointFeedback
 

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 47 of file btHingeConstraint.h.

Constructor & Destructor Documentation

◆ btHingeConstraint() [1/4]

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

Definition at line 30 of file btHingeConstraint.cpp.

◆ btHingeConstraint() [2/4]

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

Definition at line 95 of file btHingeConstraint.cpp.

◆ btHingeConstraint() [3/4]

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

Definition at line 144 of file btHingeConstraint.cpp.

◆ btHingeConstraint() [4/4]

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

not providing rigidbody B means implicitly using worldspace for body B

Definition at line 173 of file btHingeConstraint.cpp.

Member Function Documentation

◆ BT_DECLARE_ALIGNED_ALLOCATOR()

btHingeConstraint::BT_DECLARE_ALIGNED_ALLOCATOR ( )

◆ buildJacobian()

void btHingeConstraint::buildJacobian ( )
virtual

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

Reimplemented from btTypedConstraint.

Definition at line 204 of file btHingeConstraint.cpp.

◆ calculateSerializeBufferSize()

int btHingeConstraint::calculateSerializeBufferSize ( ) const
inlinevirtual

Reimplemented from btTypedConstraint.

Definition at line 436 of file btHingeConstraint.h.

◆ enableAngularMotor()

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

Definition at line 159 of file btHingeConstraint.h.

◆ enableMotor()

void btHingeConstraint::enableMotor ( bool  enableMotor)
inline

Definition at line 169 of file btHingeConstraint.h.

◆ getAFrame() [1/2]

btTransform & btHingeConstraint::getAFrame ( )
inline

Definition at line 276 of file btHingeConstraint.h.

◆ getAFrame() [2/2]

const btTransform & btHingeConstraint::getAFrame ( ) const
inline

Definition at line 273 of file btHingeConstraint.h.

◆ getAngularOnly()

bool btHingeConstraint::getAngularOnly ( )
inline

Definition at line 297 of file btHingeConstraint.h.

◆ getBFrame() [1/2]

btTransform & btHingeConstraint::getBFrame ( )
inline

Definition at line 277 of file btHingeConstraint.h.

◆ getBFrame() [2/2]

const btTransform & btHingeConstraint::getBFrame ( ) const
inline

Definition at line 274 of file btHingeConstraint.h.

◆ getEnableAngularMotor()

bool btHingeConstraint::getEnableAngularMotor ( )
inline

Definition at line 301 of file btHingeConstraint.h.

◆ getFlags()

virtual int btHingeConstraint::getFlags ( ) const
inlinevirtual

Definition at line 326 of file btHingeConstraint.h.

◆ getFrameOffsetA()

btTransform & btHingeConstraint::getFrameOffsetA ( )
inline

Definition at line 142 of file btHingeConstraint.h.

◆ getFrameOffsetB()

btTransform & btHingeConstraint::getFrameOffsetB ( )
inline

Definition at line 147 of file btHingeConstraint.h.

◆ getHingeAngle() [1/2]

btScalar btHingeConstraint::getHingeAngle ( )

The getHingeAngle gives the hinge angle in range [-PI,PI].

Definition at line 642 of file btHingeConstraint.cpp.

◆ getHingeAngle() [2/2]

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

Definition at line 647 of file btHingeConstraint.cpp.

◆ getInfo1()

void btHingeConstraint::getInfo1 ( btConstraintInfo1 info)
virtual

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

Implements btTypedConstraint.

Reimplemented in btHingeAccumulatedAngleConstraint.

Definition at line 335 of file btHingeConstraint.cpp.

◆ getInfo1NonVirtual()

void btHingeConstraint::getInfo1NonVirtual ( btConstraintInfo1 info)

Definition at line 357 of file btHingeConstraint.cpp.

◆ getInfo2()

void btHingeConstraint::getInfo2 ( btConstraintInfo2 info)
virtual

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

Implements btTypedConstraint.

Definition at line 372 of file btHingeConstraint.cpp.

◆ getInfo2Internal()

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

Definition at line 392 of file btHingeConstraint.cpp.

◆ getInfo2InternalUsingFrameOffset()

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

Definition at line 734 of file btHingeConstraint.cpp.

◆ getInfo2NonVirtual()

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 384 of file btHingeConstraint.cpp.

◆ getLimitBiasFactor()

btScalar btHingeConstraint::getLimitBiasFactor ( ) const
inline

Definition at line 197 of file btHingeConstraint.h.

◆ getLimitRelaxationFactor()

btScalar btHingeConstraint::getLimitRelaxationFactor ( ) const
inline

Definition at line 206 of file btHingeConstraint.h.

◆ getLimitSign()

btScalar btHingeConstraint::getLimitSign ( )
inline

Definition at line 288 of file btHingeConstraint.h.

◆ getLimitSoftness()

btScalar btHingeConstraint::getLimitSoftness ( ) const
inline

Definition at line 188 of file btHingeConstraint.h.

◆ getLowerLimit()

btScalar btHingeConstraint::getLowerLimit ( ) const
inline

Definition at line 248 of file btHingeConstraint.h.

◆ getMaxMotorImpulse()

btScalar btHingeConstraint::getMaxMotorImpulse ( )
inline

Definition at line 309 of file btHingeConstraint.h.

◆ getMotorTargetVelocity()

btScalar btHingeConstraint::getMotorTargetVelocity ( )
inline

Definition at line 305 of file btHingeConstraint.h.

◆ getParam()

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

return the local value of parameter

Implements btTypedConstraint.

Definition at line 1051 of file btHingeConstraint.cpp.

◆ getRigidBodyA() [1/2]

btRigidBody & btHingeConstraint::getRigidBodyA ( )
inline

Definition at line 132 of file btHingeConstraint.h.

◆ getRigidBodyA() [2/2]

const btRigidBody & btHingeConstraint::getRigidBodyA ( ) const
inline

Definition at line 123 of file btHingeConstraint.h.

◆ getRigidBodyB() [1/2]

btRigidBody & btHingeConstraint::getRigidBodyB ( )
inline

Definition at line 137 of file btHingeConstraint.h.

◆ getRigidBodyB() [2/2]

const btRigidBody & btHingeConstraint::getRigidBodyB ( ) const
inline

Definition at line 127 of file btHingeConstraint.h.

◆ getSolveLimit()

int btHingeConstraint::getSolveLimit ( )
inline

Definition at line 279 of file btHingeConstraint.h.

◆ getUpperLimit()

btScalar btHingeConstraint::getUpperLimit ( ) const
inline

Definition at line 257 of file btHingeConstraint.h.

◆ getUseFrameOffset()

bool btHingeConstraint::getUseFrameOffset ( )
inline

Definition at line 314 of file btHingeConstraint.h.

◆ getUseReferenceFrameA()

bool btHingeConstraint::getUseReferenceFrameA ( ) const
inline

Definition at line 317 of file btHingeConstraint.h.

◆ hasLimit()

bool btHingeConstraint::hasLimit ( ) const
inline

Definition at line 239 of file btHingeConstraint.h.

◆ serialize()

const char * btHingeConstraint::serialize ( void *  dataBuffer,
btSerializer serializer 
) const
inlinevirtual

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

Reimplemented from btTypedConstraint.

Definition at line 442 of file btHingeConstraint.h.

◆ setAngularOnly()

void btHingeConstraint::setAngularOnly ( bool  angularOnly)
inline

Definition at line 154 of file btHingeConstraint.h.

◆ setAxis()

void btHingeConstraint::setAxis ( btVector3 axisInA)
inline

Definition at line 215 of file btHingeConstraint.h.

◆ setFrames()

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

Definition at line 630 of file btHingeConstraint.cpp.

◆ setLimit()

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

Definition at line 175 of file btHingeConstraint.h.

◆ setMaxMotorImpulse()

void btHingeConstraint::setMaxMotorImpulse ( btScalar  maxMotorImpulse)
inline

Definition at line 170 of file btHingeConstraint.h.

◆ setMotorTarget() [1/2]

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

Definition at line 715 of file btHingeConstraint.cpp.

◆ setMotorTarget() [2/2]

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

Definition at line 689 of file btHingeConstraint.cpp.

◆ setMotorTargetVelocity()

void btHingeConstraint::setMotorTargetVelocity ( btScalar  motorTargetVelocity)
inline

Definition at line 171 of file btHingeConstraint.h.

◆ setParam()

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 1018 of file btHingeConstraint.cpp.

◆ setUseFrameOffset()

void btHingeConstraint::setUseFrameOffset ( bool  frameOffsetOnOff)
inline

Definition at line 315 of file btHingeConstraint.h.

◆ setUseReferenceFrameA()

void btHingeConstraint::setUseReferenceFrameA ( bool  useReferenceFrameA)
inline

Definition at line 318 of file btHingeConstraint.h.

◆ testLimit()

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

Definition at line 657 of file btHingeConstraint.cpp.

◆ updateRHS()

void btHingeConstraint::updateRHS ( btScalar  timeStep)

Definition at line 637 of file btHingeConstraint.cpp.

Member Data Documentation

◆ m_accLimitImpulse

btScalar btHingeConstraint::m_accLimitImpulse
private

Definition at line 79 of file btHingeConstraint.h.

◆ m_accMotorImpulse

btScalar btHingeConstraint::m_accMotorImpulse
private

Definition at line 89 of file btHingeConstraint.h.

◆ m_angularOnly

bool btHingeConstraint::m_angularOnly
private

Definition at line 83 of file btHingeConstraint.h.

◆ m_enableAngularMotor

bool btHingeConstraint::m_enableAngularMotor
private

Definition at line 84 of file btHingeConstraint.h.

◆ m_flags

int btHingeConstraint::m_flags
private

Definition at line 91 of file btHingeConstraint.h.

◆ m_hingeAngle

btScalar btHingeConstraint::m_hingeAngle
private

Definition at line 80 of file btHingeConstraint.h.

◆ m_jac

btJacobianEntry btHingeConstraint::m_jac[3]
private

Definition at line 53 of file btHingeConstraint.h.

◆ m_jacAng

btJacobianEntry btHingeConstraint::m_jacAng[3]
private

Definition at line 54 of file btHingeConstraint.h.

◆ m_kHinge

btScalar btHingeConstraint::m_kHinge
private

Definition at line 77 of file btHingeConstraint.h.

◆ m_limit

btAngularLimit btHingeConstraint::m_limit
private

Definition at line 63 of file btHingeConstraint.h.

◆ m_maxMotorImpulse

btScalar btHingeConstraint::m_maxMotorImpulse
private

Definition at line 60 of file btHingeConstraint.h.

◆ m_motorTargetVelocity

btScalar btHingeConstraint::m_motorTargetVelocity
private

Definition at line 59 of file btHingeConstraint.h.

◆ m_normalCFM

btScalar btHingeConstraint::m_normalCFM
private

Definition at line 92 of file btHingeConstraint.h.

◆ m_normalERP

btScalar btHingeConstraint::m_normalERP
private

Definition at line 93 of file btHingeConstraint.h.

◆ m_rbAFrame

btTransform btHingeConstraint::m_rbAFrame
private

Definition at line 56 of file btHingeConstraint.h.

◆ m_rbBFrame

btTransform btHingeConstraint::m_rbBFrame
private

Definition at line 57 of file btHingeConstraint.h.

◆ m_referenceSign

btScalar btHingeConstraint::m_referenceSign
private

Definition at line 81 of file btHingeConstraint.h.

◆ m_stopCFM

btScalar btHingeConstraint::m_stopCFM
private

Definition at line 94 of file btHingeConstraint.h.

◆ m_stopERP

btScalar btHingeConstraint::m_stopERP
private

Definition at line 95 of file btHingeConstraint.h.

◆ m_useOffsetForConstraintFrame

bool btHingeConstraint::m_useOffsetForConstraintFrame
private

Definition at line 86 of file btHingeConstraint.h.

◆ m_useReferenceFrameA

bool btHingeConstraint::m_useReferenceFrameA
private

Definition at line 87 of file btHingeConstraint.h.

◆ m_useSolveConstraintObsolete

bool btHingeConstraint::m_useSolveConstraintObsolete
private

Definition at line 85 of file btHingeConstraint.h.


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