Blender  V3.3
Classes | Macros | Enumerations | Functions | Variables
btTypedConstraint.h File Reference
#include "LinearMath/btScalar.h"
#include "btSolverConstraint.h"
#include "BulletDynamics/Dynamics/btRigidBody.h"

Go to the source code of this file.

Classes

struct  btConstraintInfo1
 
struct  btConstraintInfo2
 
struct  btTypedConstraintFloatData
 do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 More...
 
struct  btTypedConstraintData
 this structure is not used, except for loading pre-2.82 .bullet files More...
 
struct  btTypedConstraintDoubleData
 
class  btAngularLimit
 

Macros

#define btTypedConstraintData2   btTypedConstraintFloatData
 
#define btTypedConstraintDataName   "btTypedConstraintFloatData"
 
#define btAssertConstrParams(_par)   btAssert(_par)
 
#define BT_BACKWARDS_COMPATIBLE_SERIALIZATION
 do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 More...
 

Enumerations

enum  btTypedConstraintType {
  POINT2POINT_CONSTRAINT_TYPE = 3 , HINGE_CONSTRAINT_TYPE , CONETWIST_CONSTRAINT_TYPE , D6_CONSTRAINT_TYPE ,
  SLIDER_CONSTRAINT_TYPE , CONTACT_CONSTRAINT_TYPE , D6_SPRING_CONSTRAINT_TYPE , GEAR_CONSTRAINT_TYPE ,
  FIXED_CONSTRAINT_TYPE , D6_SPRING_2_CONSTRAINT_TYPE , MAX_CONSTRAINT_TYPE
}
 
enum  btConstraintParams { BT_CONSTRAINT_ERP = 1 , BT_CONSTRAINT_STOP_ERP , BT_CONSTRAINT_CFM , BT_CONSTRAINT_STOP_CFM }
 

Functions

btTypedConstraintoperator= (btTypedConstraint &other)
 
btScalar getMotorFactor (btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact)
 internal method used by the constraint solver, don't use them directly More...
 
 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
virtual ~btTypedConstraint ()
 
 btTypedConstraint (btTypedConstraintType type, btRigidBody &rbA)
 
 btTypedConstraint (btTypedConstraintType type, btRigidBody &rbA, btRigidBody &rbB)
 
static btRigidBodygetFixedBody ()
 
int getOverrideNumSolverIterations () const
 
void setOverrideNumSolverIterations (int overideNumIterations)
 
virtual void buildJacobian ()
 internal method used by the constraint solver, don't use them directly More...
 
virtual void setupSolverConstraint (btConstraintArray &ca, int solverBodyA, int solverBodyB, btScalar timeStep)
 internal method used by the constraint solver, don't use them directly More...
 
virtual void getInfo1 (btConstraintInfo1 *info)=0
 internal method used by the constraint solver, don't use them directly More...
 
virtual void getInfo2 (btConstraintInfo2 *info)=0
 internal method used by the constraint solver, don't use them directly More...
 
void internalSetAppliedImpulse (btScalar appliedImpulse)
 internal method used by the constraint solver, don't use them directly More...
 
btScalar internalGetAppliedImpulse ()
 internal method used by the constraint solver, don't use them directly More...
 
btScalar getBreakingImpulseThreshold () const
 
void setBreakingImpulseThreshold (btScalar threshold)
 
bool isEnabled () const
 
void setEnabled (bool enabled)
 
virtual void solveConstraintObsolete (btSolverBody &, btSolverBody &, btScalar)
 internal method used by the constraint solver, don't use them directly More...
 
const btRigidBodygetRigidBodyA () const
 
const btRigidBodygetRigidBodyB () const
 
int getUserConstraintType () const
 
void setUserConstraintType (int userConstraintType)
 
void setUserConstraintId (int uid)
 
int getUserConstraintId () const
 
void setUserConstraintPtr (void *ptr)
 
voidgetUserConstraintPtr ()
 
void setJointFeedback (btJointFeedback *jointFeedback)
 
const btJointFeedbackgetJointFeedback () const
 
int getUid () const
 
bool needsFeedback () const
 
void enableFeedback (bool needsFeedback)
 
btScalar getAppliedImpulse () const
 
btTypedConstraintType getConstraintType () const
 
void setDbgDrawSize (btScalar dbgDrawSize)
 
btScalar getDbgDrawSize ()
 
virtual void setParam (int num, btScalar value, int axis=-1)=0
 
virtual btScalar getParam (int num, int axis=-1) const =0
 return the local value of parameter More...
 
virtual int calculateSerializeBufferSize () const
 
virtual const char * serialize (void *dataBuffer, btSerializer *serializer) const
 fills the dataBuffer and returns the struct name (and 0 on failure) More...
 
SIMD_FORCE_INLINE btScalar btAdjustAngleToLimits (btScalar angleInRadians, btScalar angleLowerLimitInRadians, btScalar angleUpperLimitInRadians)
 

Variables

 btJointFeedback
 
btVector3 m_appliedForceBodyA
 
btVector3 m_appliedTorqueBodyA
 
btVector3 m_appliedForceBodyB
 
btVector3 m_appliedTorqueBodyB
 
btTypedConstraint __pad0__
 TypedConstraint is the baseclass for Bullet constraints and vehicles. More...
 
union {
   int   m_userConstraintId
 
   void *   m_userConstraintPtr
 
}; 
 
btScalar m_breakingImpulseThreshold
 
bool m_isEnabled
 
bool m_needsFeedback
 
int m_overrideNumSolverIterations
 
btRigidBodym_rbA
 
btRigidBodym_rbB
 
btScalar m_appliedImpulse
 
btScalar m_dbgDrawSize
 
btJointFeedbackm_jointFeedback
 

Macro Definition Documentation

◆ BT_BACKWARDS_COMPATIBLE_SERIALIZATION

#define BT_BACKWARDS_COMPATIBLE_SERIALIZATION

do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64

Definition at line 384 of file btTypedConstraint.h.

◆ btAssertConstrParams

#define btAssertConstrParams (   _par)    btAssert(_par)

Definition at line 58 of file btTypedConstraint.h.

◆ btTypedConstraintData2

#define btTypedConstraintData2   btTypedConstraintFloatData

Definition at line 27 of file btTypedConstraint.h.

◆ btTypedConstraintDataName

#define btTypedConstraintDataName   "btTypedConstraintFloatData"

Definition at line 28 of file btTypedConstraint.h.

Enumeration Type Documentation

◆ btConstraintParams

Enumerator
BT_CONSTRAINT_ERP 
BT_CONSTRAINT_STOP_ERP 
BT_CONSTRAINT_CFM 
BT_CONSTRAINT_STOP_CFM 

Definition at line 49 of file btTypedConstraint.h.

◆ btTypedConstraintType

Enumerator
POINT2POINT_CONSTRAINT_TYPE 
HINGE_CONSTRAINT_TYPE 
CONETWIST_CONSTRAINT_TYPE 
D6_CONSTRAINT_TYPE 
SLIDER_CONSTRAINT_TYPE 
CONTACT_CONSTRAINT_TYPE 
D6_SPRING_CONSTRAINT_TYPE 
GEAR_CONSTRAINT_TYPE 
FIXED_CONSTRAINT_TYPE 
D6_SPRING_2_CONSTRAINT_TYPE 
MAX_CONSTRAINT_TYPE 

Definition at line 34 of file btTypedConstraint.h.

Function Documentation

◆ BT_DECLARE_ALIGNED_ALLOCATOR()

BT_DECLARE_ALIGNED_ALLOCATOR ( )

◆ btAdjustAngleToLimits()

SIMD_FORCE_INLINE btScalar btAdjustAngleToLimits ( btScalar  angleInRadians,
btScalar  angleLowerLimitInRadians,
btScalar  angleUpperLimitInRadians 
)

Definition at line 331 of file btTypedConstraint.h.

References btFabs(), btNormalizeAngle(), and SIMD_2_PI.

Referenced by testAngLimits(), testAngularLimitMotor(), and testLimit().

◆ btTypedConstraint() [1/2]

btTypedConstraint::btTypedConstraint ( btTypedConstraintType  type,
btRigidBody rbA 
)

◆ btTypedConstraint() [2/2]

btTypedConstraint::btTypedConstraint ( btTypedConstraintType  type,
btRigidBody rbA,
btRigidBody rbB 
)

Definition at line 38 of file btTypedConstraint.cpp.

◆ buildJacobian()

virtual void buildJacobian ( )
virtual

internal method used by the constraint solver, don't use them directly

performs Jacobian calculation, and also calculates angle differences and axis

obsolete methods

we need it for both methods

Definition at line 163 of file btTypedConstraint.h.

References btJacobianEntry, btPlaneSpace1(), btVector3, calcAngleInfo2(), btRigidBody::getCenterOfMassPosition(), btRigidBody::getCenterOfMassTransform(), btRigidBody::getInvInertiaDiagLocal(), btRigidBody::getInvInertiaTensorWorld(), btRigidBody::getInvMass(), m_accMotorImpulse, m_accSwingLimitImpulse, m_accTwistLimitImpulse, m_angularOnly, m_appliedImpulse, m_rbA, m_rbAFrame, m_rbB, m_rbBFrame, m_useSolveConstraintObsolete, normal, and SIMD_EPSILON.

Referenced by setFrames().

◆ calculateSerializeBufferSize()

virtual int calculateSerializeBufferSize ( ) const
virtual

◆ enableFeedback()

void enableFeedback ( bool  needsFeedback)

enableFeedback will allow to read the applied linear and angular impulse use getAppliedImpulse, getAppliedLinearImpulse and getAppliedAngularImpulse to read feedback information

Definition at line 289 of file btTypedConstraint.h.

References m_needsFeedback, and needsFeedback().

◆ getAppliedImpulse()

btScalar getAppliedImpulse ( ) const

getAppliedImpulse is an estimated total applied impulse. This feedback could be used to determine breaking constraints or playing sounds.

Definition at line 296 of file btTypedConstraint.h.

References btAssert, m_appliedImpulse, and m_needsFeedback.

◆ getBreakingImpulseThreshold()

btScalar getBreakingImpulseThreshold ( ) const

Definition at line 191 of file btTypedConstraint.h.

References m_breakingImpulseThreshold.

◆ getConstraintType()

btTypedConstraintType getConstraintType ( ) const

Definition at line 302 of file btTypedConstraint.h.

◆ getDbgDrawSize()

btScalar getDbgDrawSize ( )

Definition at line 311 of file btTypedConstraint.h.

References m_dbgDrawSize.

◆ getFixedBody()

static btRigidBody& getFixedBody ( )
static

◆ getInfo1()

virtual void getInfo1 ( btConstraintInfo1 info)
pure virtual

internal method used by the constraint solver, don't use them directly

◆ getInfo2()

virtual void getInfo2 ( btConstraintInfo2 info)
pure virtual

internal method used by the constraint solver, don't use them directly

◆ getJointFeedback()

btJointFeedback * getJointFeedback ( ) const

Definition at line 267 of file btTypedConstraint.h.

References m_jointFeedback.

◆ getMotorFactor()

btScalar btTypedConstraint::getMotorFactor ( btScalar  pos,
btScalar  lowLim,
btScalar  uppLim,
btScalar  vel,
btScalar  timeFact 
)
protected

internal method used by the constraint solver, don't use them directly

Definition at line 54 of file btTypedConstraint.cpp.

References pos.

Referenced by get_limit_motor_info2(), getInfo2Internal(), getInfo2InternalUsingFrameOffset(), and getInfo2NonVirtual().

◆ getOverrideNumSolverIterations()

int getOverrideNumSolverIterations ( ) const

Definition at line 150 of file btTypedConstraint.h.

References m_overrideNumSolverIterations.

◆ getParam()

virtual btScalar getParam ( int  num,
int  axis = -1 
) const
pure virtual

return the local value of parameter

◆ getRigidBodyA()

const btRigidBody& getRigidBodyA ( ) const

Definition at line 214 of file btTypedConstraint.h.

References m_rbA.

◆ getRigidBodyB()

const btRigidBody& getRigidBodyB ( ) const

Definition at line 218 of file btTypedConstraint.h.

References m_rbB.

◆ getUid()

int getUid ( ) const

Definition at line 277 of file btTypedConstraint.h.

References m_userConstraintId.

◆ getUserConstraintId()

int getUserConstraintId ( ) const

Definition at line 247 of file btTypedConstraint.h.

References m_userConstraintId.

◆ getUserConstraintPtr()

void* getUserConstraintPtr ( )

Definition at line 257 of file btTypedConstraint.h.

References m_userConstraintPtr.

◆ getUserConstraintType()

int getUserConstraintType ( ) const

Definition at line 232 of file btTypedConstraint.h.

◆ internalGetAppliedImpulse()

btScalar internalGetAppliedImpulse ( )

internal method used by the constraint solver, don't use them directly

Definition at line 186 of file btTypedConstraint.h.

References m_appliedImpulse.

◆ internalSetAppliedImpulse()

void internalSetAppliedImpulse ( btScalar  appliedImpulse)

internal method used by the constraint solver, don't use them directly

Definition at line 181 of file btTypedConstraint.h.

References m_appliedImpulse.

◆ isEnabled()

bool isEnabled ( ) const

Definition at line 201 of file btTypedConstraint.h.

References m_isEnabled.

Referenced by convertJoints(), and solveSingleIteration().

◆ needsFeedback()

bool needsFeedback ( ) const

Definition at line 282 of file btTypedConstraint.h.

References m_needsFeedback.

Referenced by enableFeedback().

◆ operator=()

btTypedConstraint& operator= ( btTypedConstraint other)

Definition at line 89 of file btTypedConstraint.h.

References btAssert, and void.

◆ serialize()

virtual const char* serialize ( void dataBuffer,
btSerializer serializer 
) const
virtual

fills the dataBuffer and returns the struct name (and 0 on failure)

◆ setBreakingImpulseThreshold()

void setBreakingImpulseThreshold ( btScalar  threshold)

Definition at line 196 of file btTypedConstraint.h.

References m_breakingImpulseThreshold, and threshold.

◆ setDbgDrawSize()

void setDbgDrawSize ( btScalar  dbgDrawSize)

Definition at line 307 of file btTypedConstraint.h.

References m_dbgDrawSize.

◆ setEnabled()

void setEnabled ( bool  enabled)

Definition at line 206 of file btTypedConstraint.h.

References enabled, and m_isEnabled.

◆ setJointFeedback()

void setJointFeedback ( btJointFeedback jointFeedback)

Definition at line 262 of file btTypedConstraint.h.

References m_jointFeedback.

◆ setOverrideNumSolverIterations()

void setOverrideNumSolverIterations ( int  overideNumIterations)

override the number of constraint solver iterations used to solve this constraint -1 will use the default number of iterations, as specified in SolverInfo.m_numIterations

Definition at line 157 of file btTypedConstraint.h.

References m_overrideNumSolverIterations.

◆ setParam()

virtual void setParam ( int  num,
btScalar  value,
int  axis = -1 
)
pure virtual

override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). If no axis is provided, it uses the default axis for this constraint.

◆ setupSolverConstraint()

virtual void setupSolverConstraint ( btConstraintArray ca,
int  solverBodyA,
int  solverBodyB,
btScalar  timeStep 
)
virtual

internal method used by the constraint solver, don't use them directly

Definition at line 166 of file btTypedConstraint.h.

References void.

◆ setUserConstraintId()

void setUserConstraintId ( int  uid)

Definition at line 242 of file btTypedConstraint.h.

References m_userConstraintId.

◆ setUserConstraintPtr()

void setUserConstraintPtr ( void ptr)

Definition at line 252 of file btTypedConstraint.h.

References m_userConstraintPtr, and ptr.

◆ setUserConstraintType()

void setUserConstraintType ( int  userConstraintType)

Definition at line 237 of file btTypedConstraint.h.

◆ solveConstraintObsolete()

virtual void solveConstraintObsolete ( btSolverBody bodyA,
btSolverBody bodyB,
btScalar  timeStep 
)
virtual

◆ ~btTypedConstraint()

virtual ~btTypedConstraint ( )
virtual

Definition at line 109 of file btTypedConstraint.h.

Variable Documentation

◆ 

union { ... }

◆ __pad0__

TypedConstraint is the baseclass for Bullet constraints and vehicles.

Definition at line 75 of file btTypedConstraint.h.

◆ btJointFeedback

btJointFeedback
Initial value:

Definition at line 64 of file btTypedConstraint.h.

Referenced by convertJoints(), internalInitMultipleJoints(), and writeBackJoints().

◆ m_appliedForceBodyA

btVector3 m_appliedForceBodyA

Definition at line 67 of file btTypedConstraint.h.

◆ m_appliedForceBodyB

btVector3 m_appliedForceBodyB

Definition at line 69 of file btTypedConstraint.h.

◆ m_appliedImpulse

btScalar m_appliedImpulse
protected

◆ m_appliedTorqueBodyA

btVector3 m_appliedTorqueBodyA

Definition at line 68 of file btTypedConstraint.h.

◆ m_appliedTorqueBodyB

btVector3 m_appliedTorqueBodyB

Definition at line 70 of file btTypedConstraint.h.

◆ m_breakingImpulseThreshold

btScalar m_breakingImpulseThreshold

Definition at line 84 of file btTypedConstraint.h.

Referenced by getBreakingImpulseThreshold(), and setBreakingImpulseThreshold().

◆ m_dbgDrawSize

btScalar m_dbgDrawSize
protected

Definition at line 100 of file btTypedConstraint.h.

Referenced by getDbgDrawSize(), and setDbgDrawSize().

◆ m_isEnabled

bool m_isEnabled

Definition at line 85 of file btTypedConstraint.h.

Referenced by isEnabled(), and setEnabled().

◆ m_jointFeedback

btJointFeedback* m_jointFeedback
protected

Definition at line 101 of file btTypedConstraint.h.

Referenced by getJointFeedback(), and setJointFeedback().

◆ m_needsFeedback

bool m_needsFeedback

Definition at line 86 of file btTypedConstraint.h.

Referenced by enableFeedback(), getAppliedImpulse(), and needsFeedback().

◆ m_overrideNumSolverIterations

int m_overrideNumSolverIterations

◆ m_rbA

btRigidBody& m_rbA
protected

◆ m_rbB

btRigidBody& m_rbB
protected

◆ m_userConstraintId

int m_userConstraintId

◆ m_userConstraintPtr

void* m_userConstraintPtr

Definition at line 81 of file btTypedConstraint.h.

Referenced by getUserConstraintPtr(), and setUserConstraintPtr().