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"
58#define btAssertConstrParams(_par) btAssert(_par)
60#define btAssertConstrParams(_par)
152 return m_overrideNumSolverIterations;
159 m_overrideNumSolverIterations = overideNumIterations;
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;
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
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)
btScalar btFabs(btScalar x)
#define SIMD_FORCE_INLINE
#define btTypedConstraintData2
btScalar btAdjustAngleToLimits(btScalar angleInRadians, btScalar angleLowerLimitInRadians, btScalar angleUpperLimitInRadians)
@ CONETWIST_CONSTRAINT_TYPE
@ POINT2POINT_CONSTRAINT_TYPE
@ D6_SPRING_2_CONSTRAINT_TYPE
@ CONTACT_CONSTRAINT_TYPE
@ D6_SPRING_CONSTRAINT_TYPE
bool isLimit() const
Returns true when the last test() invocation recognized limit violation.
btScalar m_relaxationFactor
btScalar getBiasFactor() const
Returns limit's bias factor.
btScalar getSoftness() const
Returns limit's softness.
btScalar getCorrection() const
Returns correction value evaluated when test() was invoked.
btScalar getError() const
Returns correction value multiplied by sign value.
btScalar getSign() const
Returns sign value evaluated when test() was invoked.
void test(const btScalar angle)
Checks conastaint angle against limit.
void set(btScalar low, btScalar high, btScalar _softness=0.9f, btScalar _biasFactor=0.3f, btScalar _relaxationFactor=1.0f)
Sets all limit's parameters.
void fit(btScalar &angle) const
Checks given angle against limit.
btAngularLimit()
Default constructor initializes limit as inactive, allowing free constraint movement.
btScalar getHalfRange() const
Gives half of the distance between min and max limit angle.
btScalar getRelaxationFactor() const
Returns limit's relaxation factor.
The btRigidBody is the main class for rigid body objects.
TypedConstraint is the baseclass for Bullet constraints and vehicles.
virtual void solveConstraintObsolete(btSolverBody &, btSolverBody &, btScalar)
internal method used by the constraint solver, don't use them directly
void setDbgDrawSize(btScalar dbgDrawSize)
btScalar m_appliedImpulse
void setEnabled(bool enabled)
virtual btScalar getParam(int num, int axis=-1) const =0
return the local value of parameter
int getOverrideNumSolverIterations() const
btJointFeedback * m_jointFeedback
btScalar internalGetAppliedImpulse()
internal method used by the constraint solver, don't use them directly
void setUserConstraintPtr(void *ptr)
void enableFeedback(bool needsFeedback)
enableFeedback will allow to read the applied linear and angular impulse use getAppliedImpulse,...
btTypedConstraint & operator=(btTypedConstraint &other)
virtual void buildJacobian()
internal method used by the constraint solver, don't use them directly
BT_DECLARE_ALIGNED_ALLOCATOR()
btTypedConstraintType getConstraintType() const
void setOverrideNumSolverIterations(int overideNumIterations)
override the number of constraint solver iterations used to solve this constraint -1 will use the def...
btJointFeedback * getJointFeedback()
void setUserConstraintId(int uid)
void setUserConstraintType(int userConstraintType)
int m_overrideNumSolverIterations
void setJointFeedback(btJointFeedback *jointFeedback)
int getUserConstraintType() const
void setBreakingImpulseThreshold(btScalar threshold)
int getUserConstraintId() const
btRigidBody & getRigidBodyA()
virtual void getInfo2(btConstraintInfo2 *info)=0
internal method used by the constraint solver, don't use them directly
void internalSetAppliedImpulse(btScalar appliedImpulse)
internal method used by the constraint solver, don't use them directly
btScalar m_breakingImpulseThreshold
btRigidBody & getRigidBodyB()
bool needsFeedback() const
btScalar getDbgDrawSize()
const btRigidBody & getRigidBodyA() const
virtual void setParam(int num, btScalar value, int axis=-1)=0
override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0...
void * getUserConstraintPtr()
btScalar getBreakingImpulseThreshold() const
void * m_userConstraintPtr
virtual void setupSolverConstraint(btConstraintArray &ca, int solverBodyA, int solverBodyB, btScalar timeStep)
internal method used by the constraint solver, don't use them directly
const btRigidBody & getRigidBodyB() const
virtual void getInfo1(btConstraintInfo1 *info)=0
internal method used by the constraint solver, don't use them directly
btScalar getAppliedImpulse() const
getAppliedImpulse is an estimated total applied impulse.
virtual ~btTypedConstraint()
virtual int calculateSerializeBufferSize() const
const btJointFeedback * getJointFeedback() const
btVector3 can be used to represent 3D points and vectors.
btVector3 m_appliedForceBodyA
btVector3 m_appliedTorqueBodyA
BT_DECLARE_ALIGNED_ALLOCATOR()
btVector3 m_appliedForceBodyB
btVector3 m_appliedTorqueBodyB
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
The btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packe...
this structure is not used, except for loading pre-2.82 .bullet files
int m_disableCollisionsBetweenLinkedBodies
float m_breakingImpulseThreshold
int m_overrideNumSolverIterations
btRigidBodyDoubleData * m_rbB
int m_disableCollisionsBetweenLinkedBodies
double m_breakingImpulseThreshold
int m_overrideNumSolverIterations
btRigidBodyDoubleData * m_rbA
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
int m_disableCollisionsBetweenLinkedBodies
btRigidBodyFloatData * m_rbB
float m_breakingImpulseThreshold
btRigidBodyFloatData * m_rbA
int m_overrideNumSolverIterations
btScalar * m_J1angularAxis
rudimentary class to provide type info