26#ifndef BT_GENERIC_6DOF_CONSTRAINT_H
27#define BT_GENERIC_6DOF_CONSTRAINT_H
35#ifdef BT_USE_DOUBLE_PRECISION
36#define btGeneric6DofConstraintData2 btGeneric6DofConstraintDoubleData2
37#define btGeneric6DofConstraintDataName "btGeneric6DofConstraintDoubleData2"
39#define btGeneric6DofConstraintData2 btGeneric6DofConstraintData
40#define btGeneric6DofConstraintDataName "btGeneric6DofConstraintData"
165 for (
int i = 0; i < 3; i++)
186 for (
int i = 0; i < 3; i++)
228#define BT_6DOF_FLAGS_AXIS_SHIFT 3
325 void buildLinearJacobian(
332 void calculateLinearInfo();
335 void calculateAngleInfo();
353 void calculateTransforms();
361 return m_calculatedTransformA;
370 return m_calculatedTransformB;
394 virtual void buildJacobian();
396 virtual void getInfo1(btConstraintInfo1 * info);
398 void getInfo1NonVirtual(btConstraintInfo1 * info);
400 virtual void getInfo2(btConstraintInfo2 * info);
416 btScalar getAngle(
int axis_index)
const;
422 btScalar getRelativePivotPosition(
int axis_index)
const;
431 bool testAngularLimitMotor(
int axis_index);
455 for (
int i = 0; i < 3; i++)
461 for (
int i = 0; i < 3; i++)
462 angularLower[i] = m_angularLimits[i].m_loLimit;
467 for (
int i = 0; i < 3; i++)
473 for (
int i = 0; i < 3; i++)
474 angularUpper[i] = m_angularLimits[i].m_hiLimit;
480 return &m_angularLimits[index];
486 return &m_linearLimits;
501 m_angularLimits[axis - 3].
m_loLimit = lo;
502 m_angularLimits[axis - 3].
m_hiLimit = hi;
517 return m_linearLimits.
isLimited(limitIndex);
519 return m_angularLimits[limitIndex - 3].
isLimited();
522 virtual void calcAnchorPos(
void);
526 btConstraintInfo2* info,
int row,
btVector3& ax1,
int rotational,
int rotAllowed =
false);
530 void setUseFrameOffset(
bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
537 virtual void setParam(
int num,
btScalar value,
int axis = -1);
539 virtual btScalar getParam(
int num,
int axis = -1)
const;
548 virtual int calculateSerializeBufferSize()
const;
551 virtual const char* serialize(
void* dataBuffer,
btSerializer* serializer)
const;
601 for (i = 0; i < 3; i++)
#define btGeneric6DofConstraintDataName
#define btGeneric6DofConstraintData2
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
btGeneric6DofConstraint between two rigidbodies each with a pivotpoint that descibes the axis locatio...
btTransform m_frameInA
relative_frames
void getAngularUpperLimit(btVector3 &angularUpper) const
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)
void getAngularLowerLimit(btVector3 &angularLower) const
void setLinearLowerLimit(const btVector3 &linearLower)
const btTransform & getCalculatedTransformB() const
Gets the global transform of the offset for body B.
void setUseFrameOffset(bool frameOffsetOnOff)
btTransform m_calculatedTransformA
virtual int calculateSerializeBufferSize() const
btVector3 m_calculatedLinearDiff
void getLinearUpperLimit(btVector3 &linearUpper) const
btTransform & getFrameOffsetB()
btScalar m_timeStep
temporal variables
void setAngularLowerLimit(const btVector3 &angularLower)
btRotationalLimitMotor * getRotationalLimitMotor(int index)
Retrieves the angular limit informacion.
void setLimit(int axis, btScalar lo, btScalar hi)
virtual int getFlags() const
bool getUseLinearReferenceFrameA() const
btTransform m_frameInB
the constraint space w.r.t body B
const btTransform & getFrameOffsetB() const
btTransform & getFrameOffsetA()
void getLinearLowerLimit(btVector3 &linearLower) const
bool m_useOffsetForConstraintFrame
const btTransform & getFrameOffsetA() const
const btTransform & getCalculatedTransformA() const
Gets the global transform of the offset for body A.
BT_DECLARE_ALIGNED_ALLOCATOR()
bool m_useLinearReferenceFrameA
bool getUseFrameOffset() const
bool m_useSolveConstraintObsolete
for backwards compatibility during the transition to 'getInfo/getInfo2'
bool isLimited(int limitIndex) const
Test limit.
btTranslationalLimitMotor * getTranslationalLimitMotor()
Retrieves the limit informacion.
void setUseLinearReferenceFrameA(bool linearReferenceFrameA)
btTranslationalLimitMotor m_linearLimits
Linear_Limit_parameters.
void setAngularUpperLimit(const btVector3 &angularUpper)
void setLinearUpperLimit(const btVector3 &linearUpper)
btRotationalLimitMotor m_angularLimits[3]
hinge_parameters
btVector3 m_calculatedAxisAngleDiff
btTransform m_calculatedTransformB
Jacobian entry is an abstraction that allows to describe constraints it can be used in combination wi...
The btRigidBody is the main class for rigid body objects.
Rotation Limit structure for generic joints.
btScalar m_currentPosition
How much is violated this limit.
btScalar m_targetVelocity
target motor velocity
btRotationalLimitMotor(const btRotationalLimitMotor &limot)
btScalar m_hiLimit
joint limit
btScalar m_normalCFM
Relaxation factor.
btScalar m_maxMotorForce
max force on motor
btScalar m_damping
Damping.
btScalar m_bounce
restitution factor
btScalar m_loLimit
limit_parameters
btScalar m_currentLimitError
temp_variables
btScalar m_stopERP
Error tolerance factor when joint is at limit.
bool needApplyTorques() const
Need apply correction.
bool isLimited() const
Is limited.
btScalar m_accumulatedImpulse
int testLimitValue(btScalar test_value)
calculates error
btScalar m_maxLimitForce
max force on limit
int m_currentLimit
current value of angle
btScalar solveAngularLimits(btScalar timeStep, btVector3 &axis, btScalar jacDiagABInv, btRigidBody *body0, btRigidBody *body1)
apply the correction impulses for two bodies
btScalar m_stopCFM
Constraint force mixing factor when joint is at limit.
btVector3 m_stopERP
Error tolerance factor when joint is at limit.
int m_currentLimit[3]
Current relative offset of constraint frames.
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)
btVector3 m_stopCFM
Constraint force mixing factor when joint is at limit.
btVector3 m_maxMotorForce
max force on motor
btVector3 m_accumulatedImpulse
int testLimitValue(int limitIndex, btScalar test_value)
btVector3 m_currentLinearDiff
How much is violated this limit.
btVector3 m_normalCFM
Bounce parameter for linear limit.
bool needApplyForce(int limitIndex) const
btVector3 m_currentLimitError
btTranslationalLimitMotor()
btScalar m_limitSoftness
Linear_Limit_parameters.
btVector3 m_targetVelocity
target motor velocity
btVector3 m_lowerLimit
the constraint lower limits
btTranslationalLimitMotor(const btTranslationalLimitMotor &other)
bool isLimited(int limitIndex) const
Test limit.
btScalar m_damping
Damping for linear limit.
btVector3 m_upperLimit
the constraint upper limits
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)
btTransformFloatData m_rbBFrame
int m_useLinearReferenceFrameA
btVector3FloatData m_linearUpperLimit
int m_useOffsetForConstraintFrame
btTypedConstraintData m_typeConstraintData
btVector3FloatData m_linearLowerLimit
btVector3FloatData m_angularLowerLimit
btVector3FloatData m_angularUpperLimit
btTransformFloatData m_rbAFrame
btVector3DoubleData m_linearUpperLimit
btVector3DoubleData m_angularLowerLimit
int m_useOffsetForConstraintFrame
btTypedConstraintDoubleData m_typeConstraintData
btTransformDoubleData m_rbAFrame
btVector3DoubleData m_linearLowerLimit
btVector3DoubleData m_angularUpperLimit
btTransformDoubleData m_rbBFrame
int m_useLinearReferenceFrameA
this structure is not used, except for loading pre-2.82 .bullet files