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
60 #define btAssertConstrParams(_par) btAssert(_par)
62 #define btAssertConstrParams(_par)
119 int m_numConstraintRows,
nub;
160 return m_overrideNumSolverIterations;
167 m_overrideNumSolverIterations = overideNumIterations;
183 virtual void getInfo1 (btConstraintInfo1* info)=0;
186 virtual void getInfo2 (btConstraintInfo2* info)=0;
191 m_appliedImpulse = appliedImpulse;
196 return m_appliedImpulse;
202 return m_breakingImpulseThreshold;
207 m_breakingImpulseThreshold = threshold;
245 return m_userConstraintType ;
250 m_userConstraintType = userConstraintType;
255 m_userConstraintId = uid;
260 return m_userConstraintId;
265 m_userConstraintPtr = ptr;
270 return m_userConstraintPtr;
275 m_jointFeedback = jointFeedback;
280 return m_jointFeedback;
285 return m_jointFeedback;
291 return m_userConstraintId;
296 return m_needsFeedback;
303 m_needsFeedback = needsFeedback;
311 return m_appliedImpulse;
321 m_dbgDrawSize = dbgDrawSize;
325 return m_dbgDrawSize;
330 virtual void setParam(
int num,
btScalar value,
int axis = -1) = 0;
333 virtual btScalar getParam(
int num,
int axis = -1)
const = 0;
335 virtual int calculateSerializeBufferSize()
const;
338 virtual const char* serialize(
void* dataBuffer,
btSerializer* serializer)
const;
346 if(angleLowerLimitInRadians >= angleUpperLimitInRadians)
348 return angleInRadians;
350 else if(angleInRadians < angleLowerLimitInRadians)
354 return (diffLo < diffHi) ? angleInRadians : (angleInRadians +
SIMD_2_PI);
356 else if(angleInRadians > angleUpperLimitInRadians)
360 return (diffLo < diffHi) ? (angleInRadians -
SIMD_2_PI) : angleInRadians;
364 return angleInRadians;
393 #define BT_BACKWARDS_COMPATIBLE_SERIALIZATION
394 #ifdef BT_BACKWARDS_COMPATIBLE_SERIALIZATION
417 #endif //BACKWARDS_COMPATIBLE
544 #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
void set(btScalar low, btScalar high, btScalar _softness=0.9f, btScalar _biasFactor=0.3f, btScalar _relaxationFactor=1.0f)
Sets all limit's parameters.
btScalar m_relaxationFactor
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 getError() const
Returns correction value multiplied by sign value.
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()
void fit(btScalar &angle) const
Checks given angle against limit.
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.
void test(const btScalar angle)
Checks conastaint angle against limit.
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)