40#ifndef BT_GENERIC_6DOF_CONSTRAINT2_H
41#define BT_GENERIC_6DOF_CONSTRAINT2_H
49#ifdef BT_USE_DOUBLE_PRECISION
50#define btGeneric6DofSpring2ConstraintData2 btGeneric6DofSpring2ConstraintDoubleData2
51#define btGeneric6DofSpring2ConstraintDataName "btGeneric6DofSpring2ConstraintDoubleData2"
53#define btGeneric6DofSpring2ConstraintData2 btGeneric6DofSpring2ConstraintData
54#define btGeneric6DofSpring2ConstraintDataName "btGeneric6DofSpring2ConstraintData"
204 for (
int i = 0; i < 3; i++)
236 for (
int i = 0; i < 3; i++)
270#define BT_6DOF_FLAGS_AXIS_SHIFT2 4
307 void calculateLinearInfo();
308 void calculateAngleInfo();
309 void testAngularLimitMotor(
int axis_index);
314 btConstraintInfo2* info,
int row,
btVector3& ax1,
int rotational,
int rotAllowed =
false);
323 virtual void getInfo1(btConstraintInfo1 * info);
324 virtual void getInfo2(btConstraintInfo2 * info);
325 virtual int calculateSerializeBufferSize()
const;
326 virtual const char* serialize(
void* dataBuffer,
btSerializer* serializer)
const;
333 void calculateTransforms();
364 for (
int i = 0; i < 3; i++)
370 for (
int i = 0; i < 3; i++)
376 for (
int i = 0; i < 3; i++)
377 angularLower[i] = m_angularLimits[i].m_loLimit;
382 for (
int i = 0; i < 3; i++)
383 angularLower[i] = -m_angularLimits[i].m_hiLimit;
388 for (
int i = 0; i < 3; i++)
394 for (
int i = 0; i < 3; i++)
400 for (
int i = 0; i < 3; i++)
401 angularUpper[i] = m_angularLimits[i].m_hiLimit;
406 for (
int i = 0; i < 3; i++)
407 angularUpper[i] = -m_angularLimits[i].m_loLimit;
423 m_angularLimits[axis - 3].
m_loLimit = lo;
424 m_angularLimits[axis - 3].
m_hiLimit = hi;
439 m_angularLimits[axis - 3].
m_hiLimit = -lo;
440 m_angularLimits[axis - 3].
m_loLimit = -hi;
448 return m_linearLimits.
isLimited(limitIndex);
450 return m_angularLimits[limitIndex - 3].
isLimited();
458 void setBounce(
int index,
btScalar bounce);
460 void enableMotor(
int index,
bool onOff);
461 void setServo(
int index,
bool onOff);
462 void setTargetVelocity(
int index,
btScalar velocity);
463 void setServoTarget(
int index,
btScalar target);
464 void setMaxMotorForce(
int index,
btScalar force);
466 void enableSpring(
int index,
bool onOff);
467 void setStiffness(
int index,
btScalar stiffness,
bool limitIfNeeded =
true);
468 void setDamping(
int index,
btScalar damping,
bool limitIfNeeded =
true);
469 void setEquilibriumPoint();
470 void setEquilibriumPoint(
int index);
471 void setEquilibriumPoint(
int index,
btScalar val);
475 virtual void setParam(
int num,
btScalar value,
int axis = -1);
476 virtual btScalar getParam(
int num,
int axis = -1)
const;
597 for (i = 0; i < 3; i++)
613 dof->m_angularLowerLimit.m_floats[3] = 0;
614 dof->m_angularUpperLimit.m_floats[3] = 0;
615 dof->m_angularBounce.m_floats[3] = 0;
616 dof->m_angularStopERP.m_floats[3] = 0;
617 dof->m_angularStopCFM.m_floats[3] = 0;
618 dof->m_angularMotorERP.m_floats[3] = 0;
619 dof->m_angularMotorCFM.m_floats[3] = 0;
620 dof->m_angularTargetVelocity.m_floats[3] = 0;
621 dof->m_angularMaxMotorForce.m_floats[3] = 0;
622 dof->m_angularServoTarget.m_floats[3] = 0;
623 dof->m_angularSpringStiffness.m_floats[3] = 0;
624 dof->m_angularSpringDamping.m_floats[3] = 0;
625 dof->m_angularEquilibriumPoint.m_floats[3] = 0;
626 for (i = 0; i < 4; i++)
648 for (i = 0; i < 4; i++)
659 dof->m_padding1[0] = 0;
660 dof->m_padding1[1] = 0;
661 dof->m_padding1[2] = 0;
662 dof->m_padding1[3] = 0;
btScalar btGetMatrixElem(const btMatrix3x3 &mat, int index)
bool matrixToEulerXYZ(const btMatrix3x3 &mat, btVector3 &xyz)
MatrixToEulerXYZ from http://www.geometrictools.com/LibFoundation/Mathematics/Wm4Matrix3....
#define btGeneric6DofSpring2ConstraintData2
@ BT_6DOF_FLAGS_ERP_MOTO2
@ BT_6DOF_FLAGS_CFM_MOTO2
@ BT_6DOF_FLAGS_ERP_STOP2
@ BT_6DOF_FLAGS_CFM_STOP2
@ BT_6DOF_FLAGS_USE_INFINITE_ERROR
#define btGeneric6DofSpring2ConstraintDataName
btScalar btNormalizeAngle(btScalar angleInRadians)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
#define SIMD_FORCE_INLINE
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
void setAngularUpperLimitReversed(const btVector3 &angularUpper)
btRotationalLimitMotor2 m_angularLimits[3]
void getAngularLowerLimitReversed(btVector3 &angularLower)
void getAngularLowerLimit(btVector3 &angularLower)
void setRotationOrder(RotateOrder order)
void getAngularUpperLimit(btVector3 &angularUpper)
btVector3 m_calculatedAxisAngleDiff
void setLimit(int axis, btScalar lo, btScalar hi)
btVector3 m_calculatedLinearDiff
btTransform & getFrameOffsetB()
void getLinearLowerLimit(btVector3 &linearLower)
virtual int calculateSerializeBufferSize() const
void setAngularLowerLimitReversed(const btVector3 &angularLower)
btTransform m_calculatedTransformA
RotateOrder getRotationOrder()
btTranslationalLimitMotor2 m_linearLimits
void setLinearUpperLimit(const btVector3 &linearUpper)
btTransform m_calculatedTransformB
btRotationalLimitMotor2 * getRotationalLimitMotor(int index)
const btTransform & getCalculatedTransformA() const
const btTransform & getCalculatedTransformB() const
btScalar getRelativePivotPosition(int axis_index) const
RotateOrder m_rotateOrder
void setAngularUpperLimit(const btVector3 &angularUpper)
BT_DECLARE_ALIGNED_ALLOCATOR()
btTransform & getFrameOffsetA()
void setAngularLowerLimit(const btVector3 &angularLower)
void setLinearLowerLimit(const btVector3 &linearLower)
btGeneric6DofSpring2Constraint & operator=(const btGeneric6DofSpring2Constraint &)
void getAngularUpperLimitReversed(btVector3 &angularUpper)
const btTransform & getFrameOffsetA() const
btVector3 getAxis(int axis_index) const
const btTransform & getFrameOffsetB() const
void getLinearUpperLimit(btVector3 &linearUpper)
virtual void buildJacobian()
internal method used by the constraint solver, don't use them directly
btScalar getAngle(int axis_index) const
bool isLimited(int limitIndex)
void setLimitReversed(int axis, btScalar lo, btScalar hi)
btTranslationalLimitMotor2 * getTranslationalLimitMotor()
Jacobian entry is an abstraction that allows to describe constraints it can be used in combination wi...
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
The btRigidBody is the main class for rigid body objects.
bool m_springDampingLimited
btScalar m_targetVelocity
void testLimitValue(btScalar test_value)
btScalar m_currentLimitErrorHi
btScalar m_currentPosition
bool m_springStiffnessLimited
btRotationalLimitMotor2()
btRotationalLimitMotor2(const btRotationalLimitMotor2 &limot)
btScalar m_currentLimitError
btScalar m_springStiffness
btScalar m_equilibriumPoint
btVector3 m_targetVelocity
bool isLimited(int limitIndex)
btVector3 m_equilibriumPoint
btVector3 m_currentLinearDiff
bool m_springDampingLimited[3]
btTranslationalLimitMotor2()
btTranslationalLimitMotor2(const btTranslationalLimitMotor2 &other)
btVector3 m_currentLimitError
btVector3 m_springStiffness
void testLimitValue(int limitIndex, btScalar test_value)
btVector3 m_currentLimitErrorHi
btVector3 m_maxMotorForce
bool m_springStiffnessLimited[3]
btVector3 m_springDamping
TypedConstraint is the baseclass for Bullet constraints and vehicles.
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
btVector3 can be used to represent 3D points and vectors.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
void serialize(struct btVector3Data &dataOut) const
btTransformFloatData m_rbAFrame
btTransformFloatData m_rbBFrame
btVector3FloatData m_linearSpringDamping
btVector3FloatData m_angularBounce
btVector3FloatData m_angularMaxMotorForce
btVector3FloatData m_linearEquilibriumPoint
char m_linearSpringDampingLimited[4]
btVector3FloatData m_angularSpringDamping
char m_angularServoMotor[4]
btVector3FloatData m_linearStopERP
char m_linearEnableSpring[4]
btVector3FloatData m_linearBounce
btVector3FloatData m_angularSpringStiffness
char m_angularEnableMotor[4]
char m_linearEnableMotor[4]
btVector3FloatData m_linearSpringStiffness
btVector3FloatData m_linearServoTarget
btTypedConstraintData m_typeConstraintData
char m_linearSpringStiffnessLimited[4]
btVector3FloatData m_angularStopCFM
btVector3FloatData m_linearStopCFM
btVector3FloatData m_angularUpperLimit
char m_angularSpringDampingLimited[4]
char m_angularEnableSpring[4]
btVector3FloatData m_angularMotorCFM
char m_angularSpringStiffnessLimited[4]
char m_linearServoMotor[4]
btVector3FloatData m_linearUpperLimit
btVector3FloatData m_linearMotorCFM
btVector3FloatData m_angularLowerLimit
btVector3FloatData m_linearMaxMotorForce
btVector3FloatData m_angularMotorERP
btVector3FloatData m_angularTargetVelocity
btVector3FloatData m_angularEquilibriumPoint
btVector3FloatData m_linearLowerLimit
btVector3FloatData m_linearMotorERP
btVector3FloatData m_angularServoTarget
btVector3FloatData m_angularStopERP
btVector3FloatData m_linearTargetVelocity
btVector3DoubleData m_angularSpringStiffness
btVector3DoubleData m_linearSpringDamping
btVector3DoubleData m_angularTargetVelocity
btVector3DoubleData m_linearTargetVelocity
btVector3DoubleData m_angularMotorERP
btVector3DoubleData m_linearBounce
char m_angularSpringStiffnessLimited[4]
btVector3DoubleData m_angularStopCFM
btVector3DoubleData m_angularLowerLimit
btVector3DoubleData m_angularBounce
btVector3DoubleData m_linearSpringStiffness
char m_linearEnableMotor[4]
btVector3DoubleData m_angularMaxMotorForce
btVector3DoubleData m_angularServoTarget
char m_angularServoMotor[4]
btVector3DoubleData m_linearServoTarget
char m_angularEnableSpring[4]
btVector3DoubleData m_linearMotorERP
btVector3DoubleData m_linearMotorCFM
char m_angularSpringDampingLimited[4]
btTransformDoubleData m_rbBFrame
char m_angularEnableMotor[4]
btTypedConstraintDoubleData m_typeConstraintData
btVector3DoubleData m_linearUpperLimit
btVector3DoubleData m_linearLowerLimit
char m_linearSpringStiffnessLimited[4]
char m_linearSpringDampingLimited[4]
btVector3DoubleData m_linearEquilibriumPoint
btVector3DoubleData m_angularMotorCFM
btVector3DoubleData m_linearMaxMotorForce
btTransformDoubleData m_rbAFrame
btVector3DoubleData m_angularEquilibriumPoint
char m_linearServoMotor[4]
btVector3DoubleData m_angularSpringDamping
btVector3DoubleData m_angularUpperLimit
char m_linearEnableSpring[4]
btVector3DoubleData m_angularStopERP
btVector3DoubleData m_linearStopCFM
btVector3DoubleData m_linearStopERP
this structure is not used, except for loading pre-2.82 .bullet files