Blender V2.61 - r43446
|
Generic 6 DOF constraint that allows to set spring motors to any translational and rotational DOF. More...
#include <btGeneric6DofSpringConstraint.h>
Public Member Functions | |
btGeneric6DofSpringConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA) | |
void | enableSpring (int index, bool onOff) |
void | setStiffness (int index, btScalar stiffness) |
void | setDamping (int index, btScalar damping) |
void | setEquilibriumPoint () |
void | setEquilibriumPoint (int index) |
void | setEquilibriumPoint (int index, btScalar val) |
virtual void | setAxis (const btVector3 &axis1, const btVector3 &axis2) |
virtual void | getInfo2 (btConstraintInfo2 *info) |
internal method used by the constraint solver, don't use them directly | |
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) | |
Protected Member Functions | |
void | internalUpdateSprings (btConstraintInfo2 *info) |
Protected Attributes | |
bool | m_springEnabled [6] |
btScalar | m_equilibriumPoint [6] |
btScalar | m_springStiffness [6] |
btScalar | m_springDamping [6] |
Generic 6 DOF constraint that allows to set spring motors to any translational and rotational DOF.
DOF index used in enableSpring() and setStiffness() means: 0 : translation X 1 : translation Y 2 : translation Z 3 : rotation X (3rd Euler rotational around new position of X axis, range [-PI+epsilon, PI-epsilon] ) 4 : rotation Y (2nd Euler rotational around new position of Y axis, range [-PI/2+epsilon, PI/2-epsilon] ) 5 : rotation Z (1st Euler rotational around Z axis, range [-PI+epsilon, PI-epsilon] )
Definition at line 35 of file btGeneric6DofSpringConstraint.h.
btGeneric6DofSpringConstraint::btGeneric6DofSpringConstraint | ( | btRigidBody & | rbA, |
btRigidBody & | rbB, | ||
const btTransform & | frameInA, | ||
const btTransform & | frameInB, | ||
bool | useLinearReferenceFrameA | ||
) |
Definition at line 21 of file btGeneric6DofSpringConstraint.cpp.
References D6_SPRING_CONSTRAINT_TYPE, i, m_equilibriumPoint, btTypedObject::m_objectType, m_springDamping, m_springEnabled, and m_springStiffness.
SIMD_FORCE_INLINE int btGeneric6DofSpringConstraint::calculateSerializeBufferSize | ( | ) | const [virtual] |
Reimplemented from btGeneric6DofConstraint.
Definition at line 74 of file btGeneric6DofSpringConstraint.h.
void btGeneric6DofSpringConstraint::enableSpring | ( | int | index, |
bool | onOff | ||
) |
Definition at line 36 of file btGeneric6DofSpringConstraint.cpp.
References btAssert, btGeneric6DofConstraint::m_angularLimits, btRotationalLimitMotor::m_enableMotor, btTranslationalLimitMotor::m_enableMotor, btGeneric6DofConstraint::m_linearLimits, and m_springEnabled.
Referenced by btHinge2Constraint::btHinge2Constraint(), and CcdPhysicsEnvironment::setConstraintParam().
void btGeneric6DofSpringConstraint::getInfo2 | ( | btConstraintInfo2 * | info | ) | [virtual] |
internal method used by the constraint solver, don't use them directly
Reimplemented from btGeneric6DofConstraint.
Definition at line 142 of file btGeneric6DofSpringConstraint.cpp.
References internalUpdateSprings().
void btGeneric6DofSpringConstraint::internalUpdateSprings | ( | btConstraintInfo2 * | info | ) | [protected] |
Definition at line 104 of file btGeneric6DofSpringConstraint.cpp.
References btFabs(), btTypedConstraint::btConstraintInfo2::fps, btRigidBody::getLinearVelocity(), i, btGeneric6DofConstraint::m_angularLimits, btGeneric6DofConstraint::m_calculatedAxisAngleDiff, btGeneric6DofConstraint::m_calculatedLinearDiff, m_equilibriumPoint, btGeneric6DofConstraint::m_linearLimits, btRotationalLimitMotor::m_maxMotorForce, btTranslationalLimitMotor::m_maxMotorForce, btTypedConstraint::btConstraintInfo2::m_numIterations, btTypedConstraint::m_rbA, btTypedConstraint::m_rbB, m_springDamping, m_springEnabled, m_springStiffness, btTranslationalLimitMotor::m_targetVelocity, and btRotationalLimitMotor::m_targetVelocity.
Referenced by getInfo2().
SIMD_FORCE_INLINE const char * btGeneric6DofSpringConstraint::serialize | ( | void * | dataBuffer, |
btSerializer * | serializer | ||
) | const [virtual] |
fills the dataBuffer and returns the struct name (and 0 on failure)
Reimplemented from btGeneric6DofConstraint.
Definition at line 80 of file btGeneric6DofSpringConstraint.h.
References i, btGeneric6DofSpringConstraintData::m_6dofData, btGeneric6DofSpringConstraintData::m_equilibriumPoint, m_equilibriumPoint, m_springDamping, btGeneric6DofSpringConstraintData::m_springDamping, btGeneric6DofSpringConstraintData::m_springEnabled, m_springEnabled, m_springStiffness, and btGeneric6DofSpringConstraintData::m_springStiffness.
void btGeneric6DofSpringConstraint::setAxis | ( | const btVector3 & | axis1, |
const btVector3 & | axis2 | ||
) | [virtual] |
Reimplemented from btGeneric6DofConstraint.
Definition at line 152 of file btGeneric6DofSpringConstraint.cpp.
References btGeneric6DofConstraint::calculateTransforms(), btTransform::getBasis(), btRigidBody::getCenterOfMassTransform(), btTransform::inverse(), btGeneric6DofConstraint::m_frameInA, btGeneric6DofConstraint::m_frameInB, btTypedConstraint::m_rbA, btTypedConstraint::m_rbB, btTransform::setIdentity(), and btMatrix3x3::setValue().
void btGeneric6DofSpringConstraint::setDamping | ( | int | index, |
btScalar | damping | ||
) |
Definition at line 59 of file btGeneric6DofSpringConstraint.cpp.
References btAssert, and m_springDamping.
Referenced by btHinge2Constraint::btHinge2Constraint(), and CcdPhysicsEnvironment::setConstraintParam().
void btGeneric6DofSpringConstraint::setEquilibriumPoint | ( | ) |
Definition at line 66 of file btGeneric6DofSpringConstraint.cpp.
References btGeneric6DofConstraint::calculateTransforms(), i, btGeneric6DofConstraint::m_calculatedAxisAngleDiff, btGeneric6DofConstraint::m_calculatedLinearDiff, and m_equilibriumPoint.
Referenced by btHinge2Constraint::btHinge2Constraint(), and CcdPhysicsEnvironment::setConstraintParam().
void btGeneric6DofSpringConstraint::setEquilibriumPoint | ( | int | index, |
btScalar | val | ||
) |
Definition at line 97 of file btGeneric6DofSpringConstraint.cpp.
References btAssert, m_equilibriumPoint, and simple_enum_gen::val.
void btGeneric6DofSpringConstraint::setEquilibriumPoint | ( | int | index | ) |
Definition at line 83 of file btGeneric6DofSpringConstraint.cpp.
References btAssert, btGeneric6DofConstraint::calculateTransforms(), btGeneric6DofConstraint::m_calculatedAxisAngleDiff, btGeneric6DofConstraint::m_calculatedLinearDiff, and m_equilibriumPoint.
void btGeneric6DofSpringConstraint::setStiffness | ( | int | index, |
btScalar | stiffness | ||
) |
Definition at line 52 of file btGeneric6DofSpringConstraint.cpp.
References btAssert, and m_springStiffness.
Referenced by btHinge2Constraint::btHinge2Constraint(), and CcdPhysicsEnvironment::setConstraintParam().
btScalar btGeneric6DofSpringConstraint::m_equilibriumPoint[6] [protected] |
Definition at line 39 of file btGeneric6DofSpringConstraint.h.
Referenced by btGeneric6DofSpringConstraint(), internalUpdateSprings(), serialize(), and setEquilibriumPoint().
btScalar btGeneric6DofSpringConstraint::m_springDamping[6] [protected] |
Definition at line 41 of file btGeneric6DofSpringConstraint.h.
Referenced by btGeneric6DofSpringConstraint(), internalUpdateSprings(), serialize(), and setDamping().
bool btGeneric6DofSpringConstraint::m_springEnabled[6] [protected] |
Definition at line 38 of file btGeneric6DofSpringConstraint.h.
Referenced by btGeneric6DofSpringConstraint(), enableSpring(), internalUpdateSprings(), and serialize().
btScalar btGeneric6DofSpringConstraint::m_springStiffness[6] [protected] |
Definition at line 40 of file btGeneric6DofSpringConstraint.h.
Referenced by btGeneric6DofSpringConstraint(), internalUpdateSprings(), serialize(), and setStiffness().