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