16 #ifndef BT_TYPED_CONSTRAINT_H 17 #define BT_TYPED_CONSTRAINT_H 24 #ifdef BT_USE_DOUBLE_PRECISION 25 #define btTypedConstraintData2 btTypedConstraintDoubleData 26 #define btTypedConstraintDataName "btTypedConstraintDoubleData" 28 #define btTypedConstraintData2 btTypedConstraintFloatData 29 #define btTypedConstraintDataName "btTypedConstraintFloatData" 30 #endif //BT_USE_DOUBLE_PRECISION 61 #define btAssertConstrParams(_par) btAssert(_par) 63 #define btAssertConstrParams(_par) 121 int m_numConstraintRows,
nub;
157 return m_overrideNumSolverIterations;
164 m_overrideNumSolverIterations = overideNumIterations;
188 m_appliedImpulse = appliedImpulse;
193 return m_appliedImpulse;
199 return m_breakingImpulseThreshold;
204 m_breakingImpulseThreshold = threshold;
242 return m_userConstraintType ;
247 m_userConstraintType = userConstraintType;
252 m_userConstraintId = uid;
257 return m_userConstraintId;
262 m_userConstraintPtr = ptr;
267 return m_userConstraintPtr;
272 m_jointFeedback = jointFeedback;
277 return m_jointFeedback;
282 return m_jointFeedback;
288 return m_userConstraintId;
293 return m_needsFeedback;
300 m_needsFeedback = needsFeedback;
308 return m_appliedImpulse;
318 m_dbgDrawSize = dbgDrawSize;
322 return m_dbgDrawSize;
327 virtual void setParam(
int num,
btScalar value,
int axis = -1) = 0;
330 virtual btScalar getParam(
int num,
int axis = -1)
const = 0;
332 virtual int calculateSerializeBufferSize()
const;
335 virtual const char* serialize(
void* dataBuffer,
btSerializer* serializer)
const;
343 if(angleLowerLimitInRadians >= angleUpperLimitInRadians)
345 return angleInRadians;
347 else if(angleInRadians < angleLowerLimitInRadians)
351 return (diffLo < diffHi) ? angleInRadians : (angleInRadians +
SIMD_2_PI);
353 else if(angleInRadians > angleUpperLimitInRadians)
357 return (diffLo < diffHi) ? (angleInRadians -
SIMD_2_PI) : angleInRadians;
361 return angleInRadians;
390 #define BT_BACKWARDS_COMPATIBLE_SERIALIZATION 391 #ifdef BT_BACKWARDS_COMPATIBLE_SERIALIZATION 414 #endif //BACKWARDS_COMPATIBLE 469 m_relaxationFactor(1.0f),
499 return m_relaxationFactor;
541 #endif //BT_TYPED_CONSTRAINT_H btScalar * m_constraintError
void enableFeedback(bool needsFeedback)
enableFeedback will allow to read the applied linear and angular impulse use getAppliedImpulse, getAppliedLinearImpulse and getAppliedAngularImpulse to read feedback information
btRigidBodyFloatData * m_rbB
int getUserConstraintType() const
double m_breakingImpulseThreshold
btTypedConstraintType getConstraintType() const
void setUserConstraintPtr(void *ptr)
float m_breakingImpulseThreshold
void * m_userConstraintPtr
void setJointFeedback(btJointFeedback *jointFeedback)
bool isLimit() const
Returns true when the last test() invocation recognized limit violation.
int m_disableCollisionsBetweenLinkedBodies
int m_disableCollisionsBetweenLinkedBodies
btScalar getBreakingImpulseThreshold() const
#define SIMD_FORCE_INLINE
int m_disableCollisionsBetweenLinkedBodies
void setUserConstraintId(int uid)
int m_overrideNumSolverIterations
btJointFeedback * m_jointFeedback
int getUserConstraintId() const
btVector3 m_appliedForceBodyB
const btJointFeedback * getJointFeedback() const
void setBreakingImpulseThreshold(btScalar threshold)
btScalar m_breakingImpulseThreshold
void setDbgDrawSize(btScalar dbgDrawSize)
btTypedConstraint & operator=(btTypedConstraint &other)
btScalar getHalfRange() const
Gives half of the distance between min and max limit angle.
bool needsFeedback() const
btVector3 m_appliedForceBodyA
btScalar getSign() const
Returns sign value evaluated when test() was invoked.
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
btScalar getSoftness() const
Returns limit's softness.
void setOverrideNumSolverIterations(int overideNumIterations)
override the number of constraint solver iterations used to solve this constraint -1 will use the def...
btScalar getBiasFactor() const
Returns limit's bias factor.
virtual ~btTypedConstraint()
#define btTypedConstraintData2
The btRigidBody is the main class for rigid body objects.
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
this structure is not used, except for loading pre-2.82 .bullet files
btScalar btAdjustAngleToLimits(btScalar angleInRadians, btScalar angleLowerLimitInRadians, btScalar angleUpperLimitInRadians)
btRigidBodyDoubleData * m_rbA
btVector3 can be used to represent 3D points and vectors.
#define ATTRIBUTE_ALIGNED16(a)
void setUserConstraintType(int userConstraintType)
btScalar btNormalizeAngle(btScalar angleInRadians)
virtual void solveConstraintObsolete(btSolverBody &, btSolverBody &, btScalar)
internal method used by the constraint solver, don't use them directly
int m_overrideNumSolverIterations
float m_breakingImpulseThreshold
rudimentary class to provide type info
btVector3 m_appliedTorqueBodyB
The btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packe...
btScalar * m_J2linearAxis
btScalar getRelaxationFactor() const
Returns limit's relaxation factor.
virtual void setupSolverConstraint(btConstraintArray &ca, int solverBodyA, int solverBodyB, btScalar timeStep)
internal method used by the constraint solver, don't use them directly
TypedConstraint is the baseclass for Bullet constraints and vehicles.
btScalar internalGetAppliedImpulse()
internal method used by the constraint solver, don't use them directly
const btRigidBody & getRigidBodyA() const
void setEnabled(bool enabled)
#define BT_DECLARE_ALIGNED_ALLOCATOR()
virtual int calculateSerializeBufferSize() const
btRigidBody & getRigidBodyB()
btVector3 m_appliedTorqueBodyA
btScalar m_appliedImpulse
btScalar getCorrection() const
Returns correction value evaluated when test() was invoked.
btRigidBodyFloatData * m_rbA
btAngularLimit()
Default constructor initializes limit as inactive, allowing free constraint movement.
btScalar getAppliedImpulse() const
getAppliedImpulse is an estimated total applied impulse.
void internalSetAppliedImpulse(btScalar appliedImpulse)
internal method used by the constraint solver, don't use them directly
btRigidBody & getRigidBodyA()
void * getUserConstraintPtr()
btScalar getDbgDrawSize()
int m_overrideNumSolverIterations
const btRigidBody & getRigidBodyB() const
int getOverrideNumSolverIterations() const
int m_overrideNumSolverIterations
virtual void buildJacobian()
internal method used by the constraint solver, don't use them directly
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btRigidBodyDoubleData * m_rbB
btJointFeedback * getJointFeedback()
btScalar btFabs(btScalar x)