27 #ifndef BT_GENERIC_6DOF_CONSTRAINT_H
28 #define BT_GENERIC_6DOF_CONSTRAINT_H
38 #ifdef BT_USE_DOUBLE_PRECISION
39 #define btGeneric6DofConstraintData2 btGeneric6DofConstraintDoubleData2
40 #define btGeneric6DofConstraintDataName "btGeneric6DofConstraintDoubleData2"
42 #define btGeneric6DofConstraintData2 btGeneric6DofConstraintData
43 #define btGeneric6DofConstraintDataName "btGeneric6DofConstraintData"
44 #endif //BT_USE_DOUBLE_PRECISION
174 for(
int i=0; i < 3; i++)
195 for(
int i=0; i < 3; i++)
240 #define BT_6DOF_FLAGS_AXIS_SHIFT 3 // bits per axis
341 void buildLinearJacobian(
348 void calculateLinearInfo();
351 void calculateAngleInfo();
372 void calculateTransforms();
380 return m_calculatedTransformA;
389 return m_calculatedTransformB;
415 virtual void buildJacobian();
417 virtual void getInfo1 (btConstraintInfo1* info);
419 void getInfo1NonVirtual (btConstraintInfo1* info);
421 virtual void getInfo2 (btConstraintInfo2* info);
438 btScalar getAngle(
int axis_index)
const;
444 btScalar getRelativePivotPosition(
int axis_index)
const;
453 bool testAngularLimitMotor(
int axis_index);
477 for(
int i = 0; i < 3; i++)
483 for(
int i = 0; i < 3; i++)
484 angularLower[i] = m_angularLimits[i].m_loLimit;
489 for(
int i = 0; i < 3; i++)
495 for(
int i = 0; i < 3; i++)
496 angularUpper[i] = m_angularLimits[i].m_hiLimit;
502 return &m_angularLimits[index];
508 return &m_linearLimits;
539 return m_linearLimits.
isLimited(limitIndex);
542 return m_angularLimits[limitIndex-3].
isLimited();
545 virtual void calcAnchorPos(
void);
549 btConstraintInfo2 *info,
int row,
btVector3& ax1,
int rotational,
int rotAllowed =
false);
553 void setUseFrameOffset(
bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
557 virtual void setParam(
int num,
btScalar value,
int axis = -1);
559 virtual btScalar getParam(
int num,
int axis = -1)
const;
564 virtual int calculateSerializeBufferSize()
const;
567 virtual const char* serialize(
void* dataBuffer,
btSerializer* serializer)
const;
640 #endif //BT_GENERIC_6DOF_CONSTRAINT_H
btScalar m_damping
Damping for linear limit.
btTransform & getFrameOffsetB()
int m_currentLimit[3]
Current relative offset of constraint frames.
btScalar m_timeStep
temporal variables
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
bool m_useLinearReferenceFrameA
btScalar solveLinearAxis(btScalar timeStep, btScalar jacDiagABInv, btRigidBody &body1, const btVector3 &pointInA, btRigidBody &body2, const btVector3 &pointInB, int limit_index, const btVector3 &axis_normal_on_a, const btVector3 &anchorPos)
Jacobian entry is an abstraction that allows to describe constraints it can be used in combination wi...
const btTransform & getCalculatedTransformA() const
Gets the global transform of the offset for body A.
btScalar m_currentPosition
How much is violated this limit.
bool isLimited(int limitIndex)
Test limit.
btScalar m_loLimit
limit_parameters
btRotationalLimitMotor(const btRotationalLimitMotor &limot)
const btTransform & getCalculatedTransformB() const
Gets the global transform of the offset for body B.
#define btGeneric6DofConstraintData2
btTypedConstraintData m_typeConstraintData
btTranslationalLimitMotor * getTranslationalLimitMotor()
Retrieves the limit informacion.
btGeneric6DofConstraint between two rigidbodies each with a pivotpoint that descibes the axis locatio...
btScalar m_stopERP
Error tolerance factor when joint is at limit.
btScalar m_currentLimitError
temp_variables
btVector3 m_targetVelocity
target motor velocity
btTransform m_calculatedTransformA
btScalar m_normalCFM
Relaxation factor.
btScalar m_stopCFM
Constraint force mixing factor when joint is at limit.
btVector3FloatData m_linearLowerLimit
#define SIMD_FORCE_INLINE
const btTransform & getFrameOffsetA() const
void setAngularUpperLimit(const btVector3 &angularUpper)
btVector3 m_upperLimit
the constraint upper limits
btVector3DoubleData m_linearLowerLimit
void getLinearLowerLimit(btVector3 &linearLower)
btScalar m_limitSoftness
Linear_Limit_parameters.
btTransformFloatData m_rbBFrame
bool needApplyForce(int limitIndex)
int m_useOffsetForConstraintFrame
bool m_useSolveConstraintObsolete
for backwards compatibility during the transition to 'getInfo/getInfo2'
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
btVector3 m_calculatedAxisAngleDiff
bool m_useOffsetForConstraintFrame
btVector3FloatData m_angularLowerLimit
btScalar m_accumulatedImpulse
int m_useLinearReferenceFrameA
btVector3DoubleData m_angularLowerLimit
btVector3FloatData m_linearUpperLimit
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)
btVector3 m_normalCFM
Bounce parameter for linear limit.
#define btGeneric6DofConstraintDataName
btTranslationalLimitMotor m_linearLimits
Linear_Limit_parameters.
btVector3 m_stopCFM
Constraint force mixing factor when joint is at limit.
btScalar m_targetVelocity
target motor velocity
virtual int calculateSerializeBufferSize() const
btTypedConstraintDoubleData m_typeConstraintData
btVector3DoubleData m_angularUpperLimit
The btRigidBody is the main class for rigid body objects.
btVector3 m_lowerLimit
the constraint lower limits
int m_useLinearReferenceFrameA
bool isLimited(int limitIndex)
Test limit.
btTransform m_calculatedTransformB
this structure is not used, except for loading pre-2.82 .bullet files
btTransformDoubleData m_rbAFrame
btTransform & getFrameOffsetA()
void getAngularLowerLimit(btVector3 &angularLower)
btVector3 m_calculatedLinearDiff
btVector3 m_currentLimitError
int m_currentLimit
current value of angle
btTranslationalLimitMotor(const btTranslationalLimitMotor &other)
btVector3 can be used to represent 3D points and vectors.
#define ATTRIBUTE_ALIGNED16(a)
btTransform m_frameInA
relative_frames
btScalar btNormalizeAngle(btScalar angleInRadians)
btScalar m_damping
Damping.
const btTransform & getFrameOffsetB() const
btRotationalLimitMotor m_angularLimits[3]
hinge_parameters
btScalar m_hiLimit
joint limit
int testLimitValue(btScalar test_value)
calculates error
btTransform m_frameInB
the constraint space w.r.t body B
TypedConstraint is the baseclass for Bullet constraints and vehicles.
int m_useOffsetForConstraintFrame
btRotationalLimitMotor * getRotationalLimitMotor(int index)
Retrieves the angular limit informacion.
btScalar solveAngularLimits(btScalar timeStep, btVector3 &axis, btScalar jacDiagABInv, btRigidBody *body0, btRigidBody *body1)
apply the correction impulses for two bodies
int testLimitValue(int limitIndex, btScalar test_value)
bool isLimited()
Is limited.
#define BT_DECLARE_ALIGNED_ALLOCATOR()
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
void getLinearUpperLimit(btVector3 &linearUpper)
void setLinearLowerLimit(const btVector3 &linearLower)
btVector3DoubleData m_linearUpperLimit
btVector3 m_maxMotorForce
max force on motor
btScalar m_maxMotorForce
max force on motor
btScalar m_maxLimitForce
max force on limit
void setLimit(int axis, btScalar lo, btScalar hi)
btVector3 m_currentLinearDiff
How much is violated this limit.
btScalar m_bounce
restitution factor
btVector3 m_stopERP
Error tolerance factor when joint is at limit.
Rotation Limit structure for generic joints.
void getAngularUpperLimit(btVector3 &angularUpper)
void setLinearUpperLimit(const btVector3 &linearUpper)
btVector3FloatData m_angularUpperLimit
btTransformFloatData m_rbAFrame
void setAngularLowerLimit(const btVector3 &angularLower)
bool needApplyTorques()
Need apply correction.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btTranslationalLimitMotor()
void setUseFrameOffset(bool frameOffsetOnOff)
btVector3 m_accumulatedImpulse
btTransformDoubleData m_rbBFrame