Bullet Collision Detection & Physics Library
btTypedConstraint Class Referenceabstract

TypedConstraint is the baseclass for Bullet constraints and vehicles. More...

#include <btTypedConstraint.h>

Inheritance diagram for btTypedConstraint:
Collaboration diagram for btTypedConstraint:

Classes

struct  btConstraintInfo1
struct  btConstraintInfo2

Public Member Functions

 BT_DECLARE_ALIGNED_ALLOCATOR ()
virtual ~btTypedConstraint ()
 btTypedConstraint (btTypedConstraintType type, btRigidBody &rbA)
 btTypedConstraint (btTypedConstraintType type, btRigidBody &rbA, btRigidBody &rbB)
int getOverrideNumSolverIterations () const
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
virtual void buildJacobian ()
 internal method used by the constraint solver, don't use them directly
virtual void setupSolverConstraint (btConstraintArray &ca, int solverBodyA, int solverBodyB, btScalar timeStep)
 internal method used by the constraint solver, don't use them directly
virtual void getInfo1 (btConstraintInfo1 *info)=0
 internal method used by the constraint solver, don't use them directly
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 internalGetAppliedImpulse ()
 internal method used by the constraint solver, don't use them directly
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
const btRigidBodygetRigidBodyA () const
const btRigidBodygetRigidBodyB () const
btRigidBodygetRigidBodyA ()
btRigidBodygetRigidBodyB ()
int getUserConstraintType () const
void setUserConstraintType (int userConstraintType)
void setUserConstraintId (int uid)
int getUserConstraintId () const
void setUserConstraintPtr (void *ptr)
void * getUserConstraintPtr ()
void setJointFeedback (btJointFeedback *jointFeedback)
const btJointFeedbackgetJointFeedback () const
btJointFeedbackgetJointFeedback ()
int getUid () const
bool needsFeedback () const
void enableFeedback (bool needsFeedback)
 enableFeedback will allow to read the applied linear and angular impulse use getAppliedImpulse, getAppliedLinearImpulse and getAppliedAngularImpulse to read feedback information
btScalar getAppliedImpulse () const
 getAppliedImpulse is an estimated total applied impulse.
btTypedConstraintType getConstraintType () const
void setDbgDrawSize (btScalar dbgDrawSize)
btScalar getDbgDrawSize ()
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..5).
virtual btScalar getParam (int num, int axis=-1) const =0
 return the local value of parameter
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)
Public Member Functions inherited from btTypedObject
 btTypedObject (int objectType)
int getObjectType () const

Static Public Member Functions

static btRigidBodygetFixedBody ()

Protected Member Functions

btScalar getMotorFactor (btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact)
 internal method used by the constraint solver, don't use them directly

Protected Attributes

btRigidBodym_rbA
btRigidBodym_rbB
btScalar m_appliedImpulse
btScalar m_dbgDrawSize
btJointFeedbackm_jointFeedback

Private Member Functions

btTypedConstraintoperator= (btTypedConstraint &other)

Private Attributes

int m_userConstraintType
union { 
   int   m_userConstraintId 
   void *   m_userConstraintPtr 
}; 
btScalar m_breakingImpulseThreshold
bool m_isEnabled
bool m_needsFeedback
int m_overrideNumSolverIterations

Additional Inherited Members

Public Attributes inherited from btTypedObject
int m_objectType

Detailed Description

TypedConstraint is the baseclass for Bullet constraints and vehicles.

Definition at line 74 of file btTypedConstraint.h.

Constructor & Destructor Documentation

◆ ~btTypedConstraint()

virtual btTypedConstraint::~btTypedConstraint ( )
inlinevirtual

Definition at line 109 of file btTypedConstraint.h.

◆ btTypedConstraint() [1/2]

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

Definition at line 22 of file btTypedConstraint.cpp.

◆ btTypedConstraint() [2/2]

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

Definition at line 38 of file btTypedConstraint.cpp.

Member Function Documentation

◆ BT_DECLARE_ALIGNED_ALLOCATOR()

btTypedConstraint::BT_DECLARE_ALIGNED_ALLOCATOR ( )

◆ buildJacobian()

virtual void btTypedConstraint::buildJacobian ( )
inlinevirtual

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

Reimplemented in btConeTwistConstraint, btContactConstraint, btGeneric6DofConstraint, btGeneric6DofSpring2Constraint, btHingeConstraint, and btPoint2PointConstraint.

Definition at line 163 of file btTypedConstraint.h.

◆ calculateSerializeBufferSize()

int btTypedConstraint::calculateSerializeBufferSize ( ) const
inlinevirtual

◆ enableFeedback()

void btTypedConstraint::enableFeedback ( bool needsFeedback)
inline

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.

◆ getAppliedImpulse()

btScalar btTypedConstraint::getAppliedImpulse ( ) const
inline

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.

◆ getBreakingImpulseThreshold()

btScalar btTypedConstraint::getBreakingImpulseThreshold ( ) const
inline

Definition at line 191 of file btTypedConstraint.h.

◆ getConstraintType()

btTypedConstraintType btTypedConstraint::getConstraintType ( ) const
inline

Definition at line 302 of file btTypedConstraint.h.

◆ getDbgDrawSize()

btScalar btTypedConstraint::getDbgDrawSize ( )
inline

Definition at line 311 of file btTypedConstraint.h.

◆ getFixedBody()

btRigidBody & btTypedConstraint::getFixedBody ( )
static

Definition at line 142 of file btTypedConstraint.cpp.

◆ getInfo1()

virtual void btTypedConstraint::getInfo1 ( btConstraintInfo1 * info)
pure virtual

◆ getInfo2()

virtual void btTypedConstraint::getInfo2 ( btConstraintInfo2 * info)
pure virtual

◆ getJointFeedback() [1/2]

btJointFeedback * btTypedConstraint::getJointFeedback ( )
inline

Definition at line 272 of file btTypedConstraint.h.

◆ getJointFeedback() [2/2]

const btJointFeedback * btTypedConstraint::getJointFeedback ( ) const
inline

Definition at line 267 of file btTypedConstraint.h.

◆ 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.

◆ getOverrideNumSolverIterations()

int btTypedConstraint::getOverrideNumSolverIterations ( ) const
inline

Definition at line 150 of file btTypedConstraint.h.

◆ getParam()

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

◆ getRigidBodyA() [1/2]

btRigidBody & btTypedConstraint::getRigidBodyA ( )
inline

Definition at line 223 of file btTypedConstraint.h.

◆ getRigidBodyA() [2/2]

const btRigidBody & btTypedConstraint::getRigidBodyA ( ) const
inline

Definition at line 214 of file btTypedConstraint.h.

◆ getRigidBodyB() [1/2]

btRigidBody & btTypedConstraint::getRigidBodyB ( )
inline

Definition at line 227 of file btTypedConstraint.h.

◆ getRigidBodyB() [2/2]

const btRigidBody & btTypedConstraint::getRigidBodyB ( ) const
inline

Definition at line 218 of file btTypedConstraint.h.

◆ getUid()

int btTypedConstraint::getUid ( ) const
inline

Definition at line 277 of file btTypedConstraint.h.

◆ getUserConstraintId()

int btTypedConstraint::getUserConstraintId ( ) const
inline

Definition at line 247 of file btTypedConstraint.h.

◆ getUserConstraintPtr()

void * btTypedConstraint::getUserConstraintPtr ( )
inline

Definition at line 257 of file btTypedConstraint.h.

◆ getUserConstraintType()

int btTypedConstraint::getUserConstraintType ( ) const
inline

Definition at line 232 of file btTypedConstraint.h.

◆ internalGetAppliedImpulse()

btScalar btTypedConstraint::internalGetAppliedImpulse ( )
inline

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

Definition at line 186 of file btTypedConstraint.h.

◆ internalSetAppliedImpulse()

void btTypedConstraint::internalSetAppliedImpulse ( btScalar appliedImpulse)
inline

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

Definition at line 181 of file btTypedConstraint.h.

◆ isEnabled()

bool btTypedConstraint::isEnabled ( ) const
inline

Definition at line 201 of file btTypedConstraint.h.

◆ needsFeedback()

bool btTypedConstraint::needsFeedback ( ) const
inline

Definition at line 282 of file btTypedConstraint.h.

◆ operator=()

btTypedConstraint & btTypedConstraint::operator= ( btTypedConstraint & other)
inlineprivate

Definition at line 89 of file btTypedConstraint.h.

◆ serialize()

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

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

Reimplemented in btConeTwistConstraint, btGearConstraint, btGeneric6DofConstraint, btGeneric6DofSpring2Constraint, btGeneric6DofSpringConstraint, btHingeConstraint, btPoint2PointConstraint, and btSliderConstraint.

Definition at line 104 of file btTypedConstraint.cpp.

◆ setBreakingImpulseThreshold()

void btTypedConstraint::setBreakingImpulseThreshold ( btScalar threshold)
inline

Definition at line 196 of file btTypedConstraint.h.

◆ setDbgDrawSize()

void btTypedConstraint::setDbgDrawSize ( btScalar dbgDrawSize)
inline

Definition at line 307 of file btTypedConstraint.h.

◆ setEnabled()

void btTypedConstraint::setEnabled ( bool enabled)
inline

Definition at line 206 of file btTypedConstraint.h.

◆ setJointFeedback()

void btTypedConstraint::setJointFeedback ( btJointFeedback * jointFeedback)
inline

Definition at line 262 of file btTypedConstraint.h.

◆ setOverrideNumSolverIterations()

void btTypedConstraint::setOverrideNumSolverIterations ( int overideNumIterations)
inline

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.

◆ setParam()

virtual void btTypedConstraint::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.

Implemented in btConeTwistConstraint, btGearConstraint, btGeneric6DofConstraint, btGeneric6DofSpring2Constraint, btHingeConstraint, btPoint2PointConstraint, and btSliderConstraint.

◆ setupSolverConstraint()

virtual void btTypedConstraint::setupSolverConstraint ( btConstraintArray & ca,
int solverBodyA,
int solverBodyB,
btScalar timeStep )
inlinevirtual

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

Definition at line 166 of file btTypedConstraint.h.

◆ setUserConstraintId()

void btTypedConstraint::setUserConstraintId ( int uid)
inline

Definition at line 242 of file btTypedConstraint.h.

◆ setUserConstraintPtr()

void btTypedConstraint::setUserConstraintPtr ( void * ptr)
inline

Definition at line 252 of file btTypedConstraint.h.

◆ setUserConstraintType()

void btTypedConstraint::setUserConstraintType ( int userConstraintType)
inline

Definition at line 237 of file btTypedConstraint.h.

◆ solveConstraintObsolete()

virtual void btTypedConstraint::solveConstraintObsolete ( btSolverBody & ,
btSolverBody & ,
btScalar  )
inlinevirtual

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

Reimplemented in btConeTwistConstraint.

Definition at line 212 of file btTypedConstraint.h.

Member Data Documentation

◆ [union]

union { ... } btTypedConstraint

◆ m_appliedImpulse

btScalar btTypedConstraint::m_appliedImpulse
protected

Definition at line 99 of file btTypedConstraint.h.

◆ m_breakingImpulseThreshold

btScalar btTypedConstraint::m_breakingImpulseThreshold
private

Definition at line 84 of file btTypedConstraint.h.

◆ m_dbgDrawSize

btScalar btTypedConstraint::m_dbgDrawSize
protected

Definition at line 100 of file btTypedConstraint.h.

◆ m_isEnabled

bool btTypedConstraint::m_isEnabled
private

Definition at line 85 of file btTypedConstraint.h.

◆ m_jointFeedback

btJointFeedback* btTypedConstraint::m_jointFeedback
protected

Definition at line 101 of file btTypedConstraint.h.

◆ m_needsFeedback

bool btTypedConstraint::m_needsFeedback
private

Definition at line 86 of file btTypedConstraint.h.

◆ m_overrideNumSolverIterations

int btTypedConstraint::m_overrideNumSolverIterations
private

Definition at line 87 of file btTypedConstraint.h.

◆ m_rbA

btRigidBody& btTypedConstraint::m_rbA
protected

Definition at line 97 of file btTypedConstraint.h.

◆ m_rbB

btRigidBody& btTypedConstraint::m_rbB
protected

Definition at line 98 of file btTypedConstraint.h.

◆ m_userConstraintId

int btTypedConstraint::m_userConstraintId

Definition at line 80 of file btTypedConstraint.h.

◆ m_userConstraintPtr

void* btTypedConstraint::m_userConstraintPtr

Definition at line 81 of file btTypedConstraint.h.

◆ m_userConstraintType

int btTypedConstraint::m_userConstraintType
private

Definition at line 77 of file btTypedConstraint.h.


The documentation for this class was generated from the following files: