Blender V2.61 - r43446
Public Member Functions | Public Attributes | Protected Member Functions

btGeneric6DofConstraint Class Reference

btGeneric6DofConstraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space More...

#include <btGeneric6DofConstraint.h>

Inheritance diagram for btGeneric6DofConstraint:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 btGeneric6DofConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
 btGeneric6DofConstraint (btRigidBody &rbB, const btTransform &frameInB, bool useLinearReferenceFrameB)
void calculateTransforms (const btTransform &transA, const btTransform &transB)
 Calcs global transform of the offsets.
void calculateTransforms ()
const btTransformgetCalculatedTransformA () const
 Gets the global transform of the offset for body A.
const btTransformgetCalculatedTransformB () const
 Gets the global transform of the offset for body B.
const btTransformgetFrameOffsetA () const
const btTransformgetFrameOffsetB () const
btTransformgetFrameOffsetA ()
btTransformgetFrameOffsetB ()
virtual void buildJacobian ()
 performs Jacobian calculation, and also calculates angle differences and axis
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 &linVelA, const btVector3 &linVelB, const btVector3 &angVelA, const btVector3 &angVelB)
void updateRHS (btScalar timeStep)
btVector3 getAxis (int axis_index) const
 Get the rotation axis in global coordinates.
btScalar getAngle (int axis_index) const
 Get the relative Euler angle.
btScalar getRelativePivotPosition (int axis_index) const
 Get the relative position of the constraint pivot.
void setFrames (const btTransform &frameA, const btTransform &frameB)
bool testAngularLimitMotor (int axis_index)
 Test angular limit.
void setLinearLowerLimit (const btVector3 &linearLower)
void getLinearLowerLimit (btVector3 &linearLower)
void setLinearUpperLimit (const btVector3 &linearUpper)
void getLinearUpperLimit (btVector3 &linearUpper)
void setAngularLowerLimit (const btVector3 &angularLower)
void getAngularLowerLimit (btVector3 &angularLower)
void setAngularUpperLimit (const btVector3 &angularUpper)
void getAngularUpperLimit (btVector3 &angularUpper)
btRotationalLimitMotorgetRotationalLimitMotor (int index)
 Retrieves the angular limit informacion.
btTranslationalLimitMotorgetTranslationalLimitMotor ()
 Retrieves the limit informacion.
void setLimit (int axis, btScalar lo, btScalar hi)
bool isLimited (int limitIndex)
 Test limit.
virtual void calcAnchorPos (void)
int get_limit_motor_info2 (btRotationalLimitMotor *limot, const btTransform &transA, const btTransform &transB, const btVector3 &linVelA, const btVector3 &linVelB, const btVector3 &angVelA, const btVector3 &angVelB, btConstraintInfo2 *info, int row, btVector3 &ax1, int rotational, int rotAllowed=false)
bool getUseFrameOffset ()
void setUseFrameOffset (bool frameOffsetOnOff)
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
void setAxis (const btVector3 &axis1, const btVector3 &axis2)
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)

Public Attributes

bool m_useSolveConstraintObsolete
 for backwards compatibility during the transition to 'getInfo/getInfo2'

Protected Member Functions

btGeneric6DofConstraintoperator= (btGeneric6DofConstraint &other)
int setAngularLimits (btConstraintInfo2 *info, int row_offset, const btTransform &transA, const btTransform &transB, const btVector3 &linVelA, const btVector3 &linVelB, const btVector3 &angVelA, const btVector3 &angVelB)
int setLinearLimits (btConstraintInfo2 *info, int row, const btTransform &transA, const btTransform &transB, const btVector3 &linVelA, const btVector3 &linVelB, const btVector3 &angVelA, const btVector3 &angVelB)
void buildLinearJacobian (btJacobianEntry &jacLinear, const btVector3 &normalWorld, const btVector3 &pivotAInW, const btVector3 &pivotBInW)
void buildAngularJacobian (btJacobianEntry &jacAngular, const btVector3 &jointAxisW)
void calculateLinearInfo ()
void calculateAngleInfo ()
 calcs the euler angles between the two bodies.

Protected Attributes

btTransform m_frameInA
 the constraint space w.r.t body A
btTransform m_frameInB
btJacobianEntry m_jacLinear [3]
 3 orthogonal linear constraints
btJacobianEntry m_jacAng [3]
btTranslationalLimitMotor m_linearLimits
btRotationalLimitMotor m_angularLimits [3]
btScalar m_timeStep
btTransform m_calculatedTransformA
btTransform m_calculatedTransformB
btVector3 m_calculatedAxisAngleDiff
btVector3 m_calculatedAxis [3]
btVector3 m_calculatedLinearDiff
btScalar m_factA
btScalar m_factB
bool m_hasStaticBody
btVector3 m_AnchorPos
bool m_useLinearReferenceFrameA
bool m_useOffsetForConstraintFrame
int m_flags

Detailed Description

btGeneric6DofConstraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space

btGeneric6DofConstraint can leave any of the 6 degree of freedom 'free' or 'locked'. currently this limit supports rotational motors

Definition at line 271 of file btGeneric6DofConstraint.h.


Constructor & Destructor Documentation

btGeneric6DofConstraint::btGeneric6DofConstraint ( btRigidBody rbA,
btRigidBody rbB,
const btTransform frameInA,
const btTransform frameInB,
bool  useLinearReferenceFrameA 
)

Definition at line 38 of file btGeneric6DofConstraint.cpp.

References calculateTransforms().

btGeneric6DofConstraint::btGeneric6DofConstraint ( btRigidBody rbB,
const btTransform frameInB,
bool  useLinearReferenceFrameB 
)

not providing rigidbody A means implicitly using worldspace for body A

Definition at line 52 of file btGeneric6DofConstraint.cpp.

References calculateTransforms(), btRigidBody::getCenterOfMassTransform(), m_frameInA, and m_frameInB.


Member Function Documentation

void btGeneric6DofConstraint::buildAngularJacobian ( btJacobianEntry &  jacAngular,
const btVector3 &  jointAxisW 
) [protected]
void btGeneric6DofConstraint::buildJacobian ( ) [virtual]
void btGeneric6DofConstraint::buildLinearJacobian ( btJacobianEntry &  jacLinear,
const btVector3 &  normalWorld,
const btVector3 &  pivotAInW,
const btVector3 &  pivotBInW 
) [protected]
void btGeneric6DofConstraint::calcAnchorPos ( void  ) [virtual]
void btGeneric6DofConstraint::calculateAngleInfo ( ) [protected]
void btGeneric6DofConstraint::calculateLinearInfo ( ) [protected]
SIMD_FORCE_INLINE int btGeneric6DofConstraint::calculateSerializeBufferSize ( ) const [virtual]

Reimplemented from btTypedConstraint.

Reimplemented in btGeneric6DofSpringConstraint.

Definition at line 579 of file btGeneric6DofConstraint.h.

void btGeneric6DofConstraint::calculateTransforms ( const btTransform transA,
const btTransform transB 
)
void btGeneric6DofConstraint::calculateTransforms ( )
int btGeneric6DofConstraint::get_limit_motor_info2 ( btRotationalLimitMotor limot,
const btTransform transA,
const btTransform transB,
const btVector3 &  linVelA,
const btVector3 &  linVelB,
const btVector3 &  angVelA,
const btVector3 &  angVelB,
btConstraintInfo2 info,
int  row,
btVector3 &  ax1,
int  rotational,
int  rotAllowed = false 
)
btScalar btGeneric6DofConstraint::getAngle ( int  axis_index) const
void btGeneric6DofConstraint::getAngularLowerLimit ( btVector3 &  angularLower) [inline]

Definition at line 471 of file btGeneric6DofConstraint.h.

References i, and m_angularLimits.

void btGeneric6DofConstraint::getAngularUpperLimit ( btVector3 &  angularUpper) [inline]

Definition at line 483 of file btGeneric6DofConstraint.h.

References i, and m_angularLimits.

btVector3 btGeneric6DofConstraint::getAxis ( int  axis_index) const

Get the rotation axis in global coordinates.

Precondition:
btGeneric6DofConstraint.buildJacobian must be called previously.

Definition at line 726 of file btGeneric6DofConstraint.cpp.

References m_calculatedAxis.

Referenced by buildJacobian(), and setAngularLimits().

const btTransform& btGeneric6DofConstraint::getCalculatedTransformA ( ) const [inline]
const btTransform& btGeneric6DofConstraint::getCalculatedTransformB ( ) const [inline]
const btTransform& btGeneric6DofConstraint::getFrameOffsetA ( ) const [inline]

Definition at line 382 of file btGeneric6DofConstraint.h.

References m_frameInA.

btTransform& btGeneric6DofConstraint::getFrameOffsetA ( ) [inline]

Definition at line 393 of file btGeneric6DofConstraint.h.

References m_frameInA.

const btTransform& btGeneric6DofConstraint::getFrameOffsetB ( ) const [inline]

Definition at line 387 of file btGeneric6DofConstraint.h.

References m_frameInB.

btTransform& btGeneric6DofConstraint::getFrameOffsetB ( ) [inline]

Definition at line 398 of file btGeneric6DofConstraint.h.

References m_frameInB.

void btGeneric6DofConstraint::getInfo1 ( btConstraintInfo1 info) [virtual]
void btGeneric6DofConstraint::getInfo1NonVirtual ( btConstraintInfo1 info)
void btGeneric6DofConstraint::getInfo2 ( btConstraintInfo2 info) [virtual]
void btGeneric6DofConstraint::getInfo2NonVirtual ( btConstraintInfo2 info,
const btTransform transA,
const btTransform transB,
const btVector3 &  linVelA,
const btVector3 &  linVelB,
const btVector3 &  angVelA,
const btVector3 &  angVelB 
)
void btGeneric6DofConstraint::getLinearLowerLimit ( btVector3 &  linearLower) [inline]
void btGeneric6DofConstraint::getLinearUpperLimit ( btVector3 &  linearUpper) [inline]
btScalar btGeneric6DofConstraint::getParam ( int  num,
int  axis = -1 
) const [virtual]
btScalar btGeneric6DofConstraint::getRelativePivotPosition ( int  axis_index) const

Get the relative position of the constraint pivot.

Precondition:
btGeneric6DofConstraint::calculateTransforms() must be called previously.

Definition at line 732 of file btGeneric6DofConstraint.cpp.

References m_calculatedLinearDiff.

Referenced by CcdPhysicsEnvironment::getConstraintParam().

btRotationalLimitMotor* btGeneric6DofConstraint::getRotationalLimitMotor ( int  index) [inline]

Retrieves the angular limit informacion.

Definition at line 490 of file btGeneric6DofConstraint.h.

References m_angularLimits.

Referenced by btDiscreteDynamicsWorld::debugDrawConstraint(), setAngularLimits(), and CcdPhysicsEnvironment::setConstraintParam().

btTranslationalLimitMotor* btGeneric6DofConstraint::getTranslationalLimitMotor ( ) [inline]

Retrieves the limit informacion.

Definition at line 496 of file btGeneric6DofConstraint.h.

References m_linearLimits.

Referenced by btDiscreteDynamicsWorld::debugDrawConstraint(), and CcdPhysicsEnvironment::setConstraintParam().

bool btGeneric6DofConstraint::getUseFrameOffset ( ) [inline]

Definition at line 542 of file btGeneric6DofConstraint.h.

References m_useOffsetForConstraintFrame.

bool btGeneric6DofConstraint::isLimited ( int  limitIndex) [inline]

Test limit.

  • free means upper < lower,
  • locked means upper == lower
  • limited means upper > lower
  • limitIndex: first 3 are linear, next 3 are angular

Definition at line 525 of file btGeneric6DofConstraint.h.

References btRotationalLimitMotor::isLimited(), btTranslationalLimitMotor::isLimited(), m_angularLimits, and m_linearLimits.

btGeneric6DofConstraint& btGeneric6DofConstraint::operator= ( btGeneric6DofConstraint other) [inline, protected]

Definition at line 321 of file btGeneric6DofConstraint.h.

References btAssert.

SIMD_FORCE_INLINE const char * btGeneric6DofConstraint::serialize ( void *  dataBuffer,
btSerializer serializer 
) const [virtual]
int btGeneric6DofConstraint::setAngularLimits ( btConstraintInfo2 info,
int  row_offset,
const btTransform transA,
const btTransform transB,
const btVector3 &  linVelA,
const btVector3 &  linVelB,
const btVector3 &  angVelA,
const btVector3 &  angVelB 
) [protected]
void btGeneric6DofConstraint::setAngularLowerLimit ( const btVector3 &  angularLower) [inline]
void btGeneric6DofConstraint::setAngularUpperLimit ( const btVector3 &  angularUpper) [inline]
void btGeneric6DofConstraint::setAxis ( const btVector3 &  axis1,
const btVector3 &  axis2 
)
void btGeneric6DofConstraint::setFrames ( const btTransform frameA,
const btTransform frameB 
)
void btGeneric6DofConstraint::setLimit ( int  axis,
btScalar  lo,
btScalar  hi 
) [inline]
int btGeneric6DofConstraint::setLinearLimits ( btConstraintInfo2 info,
int  row,
const btTransform transA,
const btTransform transB,
const btVector3 &  linVelA,
const btVector3 &  linVelB,
const btVector3 &  angVelA,
const btVector3 &  angVelB 
) [protected]

Definition at line 627 of file btGeneric6DofConstraint.cpp.

References BT_6DOF_FLAGS_AXIS_SHIFT, BT_6DOF_FLAGS_CFM_NORM, BT_6DOF_FLAGS_CFM_STOP, BT_6DOF_FLAGS_ERP_STOP, btTypedConstraint::btConstraintInfo2::cfm, btTypedConstraint::btConstraintInfo2::erp, get_limit_motor_info2(), btTransform::getBasis(), btMatrix3x3::getColumn(), i, m_angularLimits, btRotationalLimitMotor::m_bounce, m_calculatedTransformA, btTranslationalLimitMotor::m_currentLimit, btRotationalLimitMotor::m_currentLimit, btTranslationalLimitMotor::m_currentLimitError, btRotationalLimitMotor::m_currentLimitError, btTranslationalLimitMotor::m_currentLinearDiff, btRotationalLimitMotor::m_currentPosition, btTranslationalLimitMotor::m_damping, btRotationalLimitMotor::m_damping, btRotationalLimitMotor::m_enableMotor, btTranslationalLimitMotor::m_enableMotor, m_flags, btRotationalLimitMotor::m_hiLimit, btTranslationalLimitMotor::m_limitSoftness, btRotationalLimitMotor::m_limitSoftness, m_linearLimits, btRotationalLimitMotor::m_loLimit, btTranslationalLimitMotor::m_lowerLimit, btRotationalLimitMotor::m_maxLimitForce, btRotationalLimitMotor::m_maxMotorForce, btTranslationalLimitMotor::m_maxMotorForce, btTranslationalLimitMotor::m_normalCFM, btRotationalLimitMotor::m_normalCFM, btRotationalLimitMotor::m_stopCFM, btTranslationalLimitMotor::m_stopCFM, btRotationalLimitMotor::m_stopERP, btTranslationalLimitMotor::m_stopERP, btRotationalLimitMotor::m_targetVelocity, btTranslationalLimitMotor::m_targetVelocity, btTranslationalLimitMotor::m_upperLimit, m_useOffsetForConstraintFrame, and btTranslationalLimitMotor::needApplyForce().

Referenced by getInfo2(), and getInfo2NonVirtual().

void btGeneric6DofConstraint::setLinearLowerLimit ( const btVector3 &  linearLower) [inline]
void btGeneric6DofConstraint::setLinearUpperLimit ( const btVector3 &  linearUpper) [inline]
void btGeneric6DofConstraint::setParam ( int  num,
btScalar  value,
int  axis = -1 
) [virtual]
void btGeneric6DofConstraint::setUseFrameOffset ( bool  frameOffsetOnOff) [inline]

Definition at line 543 of file btGeneric6DofConstraint.h.

References m_useOffsetForConstraintFrame.

bool btGeneric6DofConstraint::testAngularLimitMotor ( int  axis_index)

Test angular limit.

Calculates angular correction and returns true if limit needs to be corrected.

Precondition:
btGeneric6DofConstraint::calculateTransforms() must be called previously.

Definition at line 452 of file btGeneric6DofConstraint.cpp.

References angle(), btAdjustAngleToLimits(), m_angularLimits, m_calculatedAxisAngleDiff, btRotationalLimitMotor::m_currentPosition, btRotationalLimitMotor::needApplyTorques(), and btRotationalLimitMotor::testLimitValue().

Referenced by buildJacobian(), getInfo1(), and getInfo2NonVirtual().

void btGeneric6DofConstraint::updateRHS ( btScalar  timeStep)

Definition at line 709 of file btGeneric6DofConstraint.cpp.


Member Data Documentation

btVector3 btGeneric6DofConstraint::m_AnchorPos [protected]

temporal variables

Definition at line 312 of file btGeneric6DofConstraint.h.

Referenced by buildJacobian(), and calcAnchorPos().

temporal variables

Definition at line 306 of file btGeneric6DofConstraint.h.

Referenced by calculateAngleInfo(), and getAxis().

temporal variables

Definition at line 308 of file btGeneric6DofConstraint.h.

Referenced by calculateTransforms(), and get_limit_motor_info2().

temporal variables

Definition at line 309 of file btGeneric6DofConstraint.h.

Referenced by calculateTransforms(), and get_limit_motor_info2().

temporal variables

Definition at line 317 of file btGeneric6DofConstraint.h.

Referenced by getParam(), setAngularLimits(), setLinearLimits(), and setParam().

temporal variables

Definition at line 310 of file btGeneric6DofConstraint.h.

Referenced by calculateTransforms(), and get_limit_motor_info2().

btJacobianEntry btGeneric6DofConstraint::m_jacAng[3] [protected]

3 orthogonal angular constraints

Definition at line 284 of file btGeneric6DofConstraint.h.

Referenced by buildJacobian().

btJacobianEntry btGeneric6DofConstraint::m_jacLinear[3] [protected]

3 orthogonal linear constraints

Jacobians

Definition at line 283 of file btGeneric6DofConstraint.h.

Referenced by buildJacobian().

temporal variables

Definition at line 302 of file btGeneric6DofConstraint.h.

temporal variables

Definition at line 314 of file btGeneric6DofConstraint.h.

Referenced by buildJacobian(), and serialize().

for backwards compatibility during the transition to 'getInfo/getInfo2'

Definition at line 350 of file btGeneric6DofConstraint.h.

Referenced by buildJacobian(), getInfo1(), getInfo1NonVirtual(), getInfo2(), and getInfo2NonVirtual().


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