16 #ifndef BT_TYPED_CONSTRAINT_H 17 #define BT_TYPED_CONSTRAINT_H 23 #ifdef BT_USE_DOUBLE_PRECISION 24 #define btTypedConstraintData2 btTypedConstraintDoubleData 25 #define btTypedConstraintDataName "btTypedConstraintDoubleData" 27 #define btTypedConstraintData2 btTypedConstraintFloatData 28 #define btTypedConstraintDataName "btTypedConstraintFloatData" 29 #endif //BT_USE_DOUBLE_PRECISION 58 #define btAssertConstrParams(_par) btAssert(_par) 60 #define btAssertConstrParams(_par) 115 int m_numConstraintRows,
nub;
152 return m_overrideNumSolverIterations;
159 m_overrideNumSolverIterations = overideNumIterations;
175 virtual void getInfo1(btConstraintInfo1 * info) = 0;
178 virtual void getInfo2(btConstraintInfo2 * info) = 0;
183 m_appliedImpulse = appliedImpulse;
188 return m_appliedImpulse;
193 return m_breakingImpulseThreshold;
198 m_breakingImpulseThreshold = threshold;
208 m_isEnabled = enabled;
234 return m_userConstraintType;
239 m_userConstraintType = userConstraintType;
244 m_userConstraintId = uid;
249 return m_userConstraintId;
254 m_userConstraintPtr = ptr;
259 return m_userConstraintPtr;
264 m_jointFeedback = jointFeedback;
269 return m_jointFeedback;
274 return m_jointFeedback;
279 return m_userConstraintId;
284 return m_needsFeedback;
291 m_needsFeedback = needsFeedback;
299 return m_appliedImpulse;
309 m_dbgDrawSize = dbgDrawSize;
313 return m_dbgDrawSize;
318 virtual void setParam(
int num,
btScalar value,
int axis = -1) = 0;
321 virtual btScalar getParam(
int num,
int axis = -1)
const = 0;
323 virtual int calculateSerializeBufferSize()
const;
326 virtual const char* serialize(
void* dataBuffer,
btSerializer* serializer)
const;
333 if (angleLowerLimitInRadians >= angleUpperLimitInRadians)
335 return angleInRadians;
337 else if (angleInRadians < angleLowerLimitInRadians)
341 return (diffLo < diffHi) ? angleInRadians : (angleInRadians +
SIMD_2_PI);
343 else if (angleInRadians > angleUpperLimitInRadians)
347 return (diffLo < diffHi) ? (angleInRadians -
SIMD_2_PI) : angleInRadians;
351 return angleInRadians;
384 #define BT_BACKWARDS_COMPATIBLE_SERIALIZATION 385 #ifdef BT_BACKWARDS_COMPATIBLE_SERIALIZATION 408 #endif //BACKWARDS_COMPATIBLE 532 #endif //BT_TYPED_CONSTRAINT_H btScalar * m_constraintError
btScalar getCorrection() const
Returns correction value evaluated when test() was invoked.
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 getUserConstraintId() const
double m_breakingImpulseThreshold
void setUserConstraintPtr(void *ptr)
float m_breakingImpulseThreshold
void * m_userConstraintPtr
void setJointFeedback(btJointFeedback *jointFeedback)
int getUserConstraintType() const
int m_disableCollisionsBetweenLinkedBodies
const btRigidBody & getRigidBodyA() const
int m_disableCollisionsBetweenLinkedBodies
btScalar getHalfRange() const
Gives half of the distance between min and max limit angle.
#define SIMD_FORCE_INLINE
int m_disableCollisionsBetweenLinkedBodies
void setUserConstraintId(int uid)
const btJointFeedback * getJointFeedback() const
btScalar getRelaxationFactor() const
Returns limit's relaxation factor.
int m_overrideNumSolverIterations
const btRigidBody & getRigidBodyB() const
btScalar getBreakingImpulseThreshold() const
btJointFeedback * m_jointFeedback
btVector3 m_appliedForceBodyB
void setBreakingImpulseThreshold(btScalar threshold)
btScalar getBiasFactor() const
Returns limit's bias factor.
btScalar getAppliedImpulse() const
getAppliedImpulse is an estimated total applied impulse.
btScalar m_breakingImpulseThreshold
void setDbgDrawSize(btScalar dbgDrawSize)
btTypedConstraint & operator=(btTypedConstraint &other)
bool needsFeedback() const
btVector3 m_appliedForceBodyA
btScalar m_relaxationFactor
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 getSign() const
Returns sign value evaluated when test() was invoked.
void fit(btScalar &angle) const
Checks given angle against limit.
int getOverrideNumSolverIterations() const
virtual ~btTypedConstraint()
#define btTypedConstraintData2
The btRigidBody is the main class for rigid body objects.
btScalar getError() const
Returns correction value multiplied by sign value.
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
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.
bool isLimit() const
Returns true when the last test() invocation recognized limit violation.
btScalar internalGetAppliedImpulse()
internal method used by the constraint solver, don't use them directly
void setEnabled(bool enabled)
#define BT_DECLARE_ALIGNED_ALLOCATOR()
btRigidBody & getRigidBodyB()
btVector3 m_appliedTorqueBodyA
btScalar m_appliedImpulse
virtual int calculateSerializeBufferSize() const
btRigidBodyFloatData * m_rbA
btTypedConstraintType getConstraintType() const
btAngularLimit()
Default constructor initializes limit as inactive, allowing free constraint movement.
void test(const btScalar angle)
Checks conastaint angle against limit.
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
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)