| Bullet Collision Detection & Physics Library
    | 
 
 
 
Go to the documentation of this file.
   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 
  
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.
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,...
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
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.
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
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