Blender V4.5
btHingeConstraint.h File Reference

Go to the source code of this file.

Classes

struct  btHingeConstraintDoubleData
 this structure is not used, except for loading pre-2.82 .bullet files More...
struct  btHingeConstraintFloatData
struct  btHingeConstraintDoubleData2
 do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 More...

Macros

#define _BT_USE_CENTER_LIMIT_   1
#define btHingeConstraintData   btHingeConstraintFloatData
#define btHingeConstraintDataName   "btHingeConstraintFloatData"

Enumerations

enum  btHingeFlags { BT_HINGE_FLAGS_CFM_STOP = 1 , BT_HINGE_FLAGS_ERP_STOP = 2 , BT_HINGE_FLAGS_CFM_NORM = 4 , BT_HINGE_FLAGS_ERP_NORM = 8 }

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 ()
virtual void getInfo1 (btConstraintInfo1 *info)
void getInfo1NonVirtual (btConstraintInfo1 *info)
virtual void getInfo2 (btConstraintInfo2 *info)
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
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].
btScalar getHingeAngle (const btTransform &transA, const btTransform &transB)
void testLimit (const btTransform &transA, const btTransform &transB)
const btTransformgetAFrame () const
const btTransformgetBFrame () const
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)
virtual btScalar getParam (int num, int axis=-1) const
 return the local value of parameter
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)
 btHingeAccumulatedAngleConstraint (btRigidBody &rbA, btRigidBody &rbB, const btVector3 &pivotInA, const btVector3 &pivotInB, const btVector3 &axisInA, const btVector3 &axisInB, bool useReferenceFrameA=false)
 btHingeAccumulatedAngleConstraint (btRigidBody &rbA, const btVector3 &pivotInA, const btVector3 &axisInA, bool useReferenceFrameA=false)
 btHingeAccumulatedAngleConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame, bool useReferenceFrameA=false)
 btHingeAccumulatedAngleConstraint (btRigidBody &rbA, const btTransform &rbAFrame, bool useReferenceFrameA=false)
btScalar getAccumulatedHingeAngle ()
void setAccumulatedHingeAngle (btScalar accAngle)

Variables

btHingeConstraint __pad0__
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
btHingeAccumulatedAngleConstraint __pad1__
 The getAccumulatedHingeAngle returns the accumulated hinge angle, taking rotation across the -PI/PI boundary into account.

Macro Definition Documentation

◆ _BT_USE_CENTER_LIMIT_

#define _BT_USE_CENTER_LIMIT_   1

◆ btHingeConstraintData

#define btHingeConstraintData   btHingeConstraintFloatData

Definition at line 33 of file btHingeConstraint.h.

◆ btHingeConstraintDataName

#define btHingeConstraintDataName   "btHingeConstraintFloatData"

Definition at line 34 of file btHingeConstraint.h.

Enumeration Type Documentation

◆ btHingeFlags

Enumerator
BT_HINGE_FLAGS_CFM_STOP 
BT_HINGE_FLAGS_ERP_STOP 
BT_HINGE_FLAGS_CFM_NORM 
BT_HINGE_FLAGS_ERP_NORM 

Definition at line 37 of file btHingeConstraint.h.

Function Documentation

◆ BT_DECLARE_ALIGNED_ALLOCATOR()

BT_DECLARE_ALIGNED_ALLOCATOR ( )

◆ btHingeAccumulatedAngleConstraint() [1/4]

btHingeAccumulatedAngleConstraint ( btRigidBody & rbA,
btRigidBody & rbB,
const btTransform & rbAFrame,
const btTransform & rbBFrame,
bool useReferenceFrameA = false )

◆ btHingeAccumulatedAngleConstraint() [2/4]

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

◆ btHingeAccumulatedAngleConstraint() [3/4]

btHingeAccumulatedAngleConstraint ( btRigidBody & rbA,
const btTransform & rbAFrame,
bool useReferenceFrameA = false )

◆ btHingeAccumulatedAngleConstraint() [4/4]

btHingeAccumulatedAngleConstraint ( btRigidBody & rbA,
const btVector3 & pivotInA,
const btVector3 & axisInA,
bool useReferenceFrameA = false )

◆ btHingeConstraint() [1/4]

◆ btHingeConstraint() [2/4]

◆ btHingeConstraint() [3/4]

◆ btHingeConstraint() [4/4]

◆ buildJacobian()

virtual void buildJacobian ( )
virtual

we need it for both methods

Definition at line 322 of file btGeneric6DofSpring2Constraint.h.

◆ calculateSerializeBufferSize()

virtual int calculateSerializeBufferSize ( ) const
virtual

◆ enableAngularMotor()

void enableAngularMotor ( bool enableMotor,
btScalar targetVelocity,
btScalar maxMotorImpulse )

◆ enableMotor()

void enableMotor ( bool enableMotor)

Definition at line 169 of file btHingeConstraint.h.

References enableMotor(), and m_enableAngularMotor.

◆ getAccumulatedHingeAngle()

btScalar btHingeAccumulatedAngleConstraint::getAccumulatedHingeAngle ( )

Definition at line 315 of file btHingeConstraint.cpp.

References btShortestAngleUpdate(), and getHingeAngle().

◆ getAFrame()

const btTransform & getAFrame ( ) const

Definition at line 273 of file btHingeConstraint.h.

References btTransform, getAFrame(), and m_rbAFrame.

◆ getAngularOnly()

bool getAngularOnly ( )
inline

Definition at line 297 of file btHingeConstraint.h.

References getAngularOnly(), and m_angularOnly.

◆ getBFrame()

const btTransform & getBFrame ( ) const

Definition at line 274 of file btHingeConstraint.h.

References btTransform, getBFrame(), and m_rbBFrame.

◆ getEnableAngularMotor()

bool getEnableAngularMotor ( )
inline

◆ getFlags()

virtual int getFlags ( ) const
virtual

Definition at line 326 of file btHingeConstraint.h.

References getFlags(), and m_flags.

◆ getFrameOffsetA()

btTransform & getFrameOffsetA ( )

Definition at line 142 of file btHingeConstraint.h.

References btTransform, getFrameOffsetA(), and m_rbAFrame.

◆ getFrameOffsetB()

btTransform & getFrameOffsetB ( )

Definition at line 147 of file btHingeConstraint.h.

References btTransform, getFrameOffsetB(), and m_rbBFrame.

◆ getHingeAngle() [1/2]

◆ getHingeAngle() [2/2]

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

◆ getInfo1()

virtual void getInfo1 ( btConstraintInfo1 * info)
virtual

References getInfo1().

◆ getInfo1NonVirtual()

void getInfo1NonVirtual ( btConstraintInfo1 * info)

References getInfo1NonVirtual().

◆ getInfo2()

◆ getInfo2Internal()

◆ getInfo2InternalUsingFrameOffset()

◆ 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.

References btTransform, btVector3, getInfo2Internal(), and testLimit().

◆ getLimitBiasFactor()

btScalar getLimitBiasFactor ( ) const

◆ getLimitRelaxationFactor()

btScalar getLimitRelaxationFactor ( ) const

◆ getLimitSign()

btScalar getLimitSign ( )
inline

Definition at line 288 of file btHingeConstraint.h.

References getLimitSign(), btAngularLimit::getSign(), and m_limit.

Referenced by getLimitSign().

◆ getLimitSoftness()

btScalar getLimitSoftness ( ) const

◆ getLowerLimit()

◆ getMaxMotorImpulse()

btScalar getMaxMotorImpulse ( )
inline

Definition at line 309 of file btHingeConstraint.h.

References getMaxMotorImpulse(), and m_maxMotorImpulse.

◆ getMotorTargetVelocity()

btScalar getMotorTargetVelocity ( )
inline

Definition at line 305 of file btHingeConstraint.h.

References getMotorTargetVelocity(), and m_motorTargetVelocity.

Referenced by getMotorTargetVelocity().

◆ getParam()

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

return the local value of parameter

References getParam(), and num.

◆ getRigidBodyA()

const btRigidBody & getRigidBodyA ( ) const

Definition at line 123 of file btHingeConstraint.h.

References getRigidBodyA(), and m_rbA.

◆ getRigidBodyB()

const btRigidBody & getRigidBodyB ( ) const

Definition at line 127 of file btHingeConstraint.h.

References getRigidBodyB(), and m_rbB.

◆ getSolveLimit()

int getSolveLimit ( )
inline

◆ getUpperLimit()

◆ getUseFrameOffset()

bool getUseFrameOffset ( )

Definition at line 314 of file btHingeConstraint.h.

References getUseFrameOffset(), and m_useOffsetForConstraintFrame.

◆ getUseReferenceFrameA()

bool getUseReferenceFrameA ( ) const

Definition at line 317 of file btHingeConstraint.h.

References getUseReferenceFrameA(), and m_useReferenceFrameA.

Referenced by getUseReferenceFrameA().

◆ hasLimit()

bool hasLimit ( ) const

Definition at line 239 of file btHingeConstraint.h.

References btAngularLimit::getHalfRange(), hasLimit(), m_limit, m_lowerLimit, and m_upperLimit.

Referenced by hasLimit().

◆ serialize()

virtual const char * serialize ( void * dataBuffer,
btSerializer * serializer ) const
virtual

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

References serialize().

◆ setAccumulatedHingeAngle()

void btHingeAccumulatedAngleConstraint::setAccumulatedHingeAngle ( btScalar accAngle)

Definition at line 321 of file btHingeConstraint.cpp.

◆ setAngularOnly()

void setAngularOnly ( bool angularOnly)

Definition at line 154 of file btHingeConstraint.h.

References m_angularOnly, and setAngularOnly().

◆ setAxis()

◆ setFrames()

void setFrames ( const btTransform & frameA,
const btTransform & frameB )

Definition at line 264 of file btSliderConstraint.h.

◆ setLimit()

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

◆ setMaxMotorImpulse()

void setMaxMotorImpulse ( btScalar maxMotorImpulse)

Definition at line 170 of file btHingeConstraint.h.

References m_maxMotorImpulse, and setMaxMotorImpulse().

◆ setMotorTarget() [1/2]

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

◆ setMotorTarget() [2/2]

◆ setMotorTargetVelocity()

void setMotorTargetVelocity ( btScalar motorTargetVelocity)

Definition at line 171 of file btHingeConstraint.h.

References m_motorTargetVelocity, and setMotorTargetVelocity().

Referenced by setMotorTargetVelocity().

◆ setParam()

virtual void 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.

References num, and setParam().

◆ setUseFrameOffset()

void setUseFrameOffset ( bool frameOffsetOnOff)

Definition at line 315 of file btHingeConstraint.h.

References m_useOffsetForConstraintFrame, and setUseFrameOffset().

◆ setUseReferenceFrameA()

void setUseReferenceFrameA ( bool useReferenceFrameA)

Definition at line 318 of file btHingeConstraint.h.

References m_useReferenceFrameA, and setUseReferenceFrameA().

Referenced by setUseReferenceFrameA().

◆ testLimit()

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

◆ updateRHS()

void updateRHS ( btScalar timeStep)

References updateRHS().

Variable Documentation

◆ __pad0__

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

◆ __pad1__

The getAccumulatedHingeAngle returns the accumulated hinge angle, taking rotation across the -PI/PI boundary into account.

Definition at line 361 of file btHingeConstraint.h.

◆ m_accLimitImpulse

btScalar m_accLimitImpulse

Definition at line 79 of file btHingeConstraint.h.

◆ m_accMotorImpulse

btScalar m_accMotorImpulse

Definition at line 89 of file btHingeConstraint.h.

◆ m_angularOnly

bool m_angularOnly

Definition at line 83 of file btHingeConstraint.h.

◆ m_enableAngularMotor

◆ m_flags

int m_flags

Definition at line 91 of file btHingeConstraint.h.

◆ m_hingeAngle

btScalar m_hingeAngle

◆ m_jacAng

btJacobianEntry m_jacAng[3]

Definition at line 54 of file btHingeConstraint.h.

◆ m_kHinge

btScalar m_kHinge

Definition at line 77 of file btHingeConstraint.h.

◆ m_limit

◆ m_maxMotorImpulse

btScalar m_maxMotorImpulse

Definition at line 60 of file btHingeConstraint.h.

◆ m_motorTargetVelocity

◆ m_normalCFM

◆ m_normalERP

◆ m_rbAFrame

btTransform m_rbAFrame

Definition at line 56 of file btHingeConstraint.h.

◆ m_rbBFrame

btTransform m_rbBFrame

Definition at line 57 of file btHingeConstraint.h.

◆ m_referenceSign

◆ m_stopCFM

◆ m_stopERP

◆ m_useOffsetForConstraintFrame

bool m_useOffsetForConstraintFrame

Definition at line 86 of file btHingeConstraint.h.

◆ m_useReferenceFrameA

◆ m_useSolveConstraintObsolete

bool m_useSolveConstraintObsolete

Definition at line 85 of file btHingeConstraint.h.