Bullet Collision Detection & Physics Library: btGearConstraint Class Reference

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes | List of all members
btGearConstraint Class Reference

The btGeatConstraint will couple the angular velocity for two bodies around given local axis and ratio. More...

`#include <btGearConstraint.h>`

Inheritance diagram for btGearConstraint:
[legend]
Collaboration diagram for btGearConstraint:
[legend]

## Public Member Functions
| btGearConstraint (btRigidBody &rbA, btRigidBody &rbB, const btVector3 &axisInA, const btVector3 &axisInB, btScalar ratio=1.f)
| Implemented by Erwin Coumans. The idea for the constraint comes from Dimitris Papavasiliou.
virtual | ~btGearConstraint ()
virtual void | getInfo1 (btConstraintInfo1 *info)
| internal method used by the constraint solver, don't use them directly
virtual void | getInfo2 (btConstraintInfo2 *info)
| internal method used by the constraint solver, don't use them directly
void | setAxisA (btVector3 &axisA)
void | setAxisB (btVector3 &axisB)
void | setRatio (btScalar ratio)
const btVector3 & | getAxisA () const
const btVector3 & | getAxisB () const
btScalar | getRatio () const
virtual void | setParam (int num, btScalar value, int axis=-1)
| 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
| 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 btTypedConstraint
| 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 btRigidBody & | getRigidBodyA () const
const btRigidBody & | getRigidBodyB () const
btRigidBody & | getRigidBodyA ()
btRigidBody & | getRigidBodyB ()
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 btJointFeedback * | getJointFeedback () const
btJointFeedback * | getJointFeedback ()
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

## Protected Attributes
btVector3 | m_axisInA
btVector3 | m_axisInB
bool | m_useFrameA
btScalar | m_ratio
Protected Attributes inherited from btTypedConstraint
btRigidBody & | m_rbA
btRigidBody & | m_rbB
btScalar | m_appliedImpulse
btScalar | m_dbgDrawSize
btJointFeedback * | m_jointFeedback

## Additional Inherited Members
Static Public Member Functions inherited from btTypedConstraint
static btRigidBody & | getFixedBody ()
Public Attributes inherited from btTypedObject
int | m_objectType
Protected Member Functions inherited from btTypedConstraint
btScalar | getMotorFactor (btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact)
| internal method used by the constraint solver, don't use them directly

## Detailed Description

The btGeatConstraint will couple the angular velocity for two bodies around given local axis and ratio.

See Bullet/Demos/ConstraintDemo for an example use.

Definition at line 31 of file btGearConstraint.h.

## Constructor & Destructor Documentation

## ◆ btGearConstraint()

btGearConstraint::btGearConstraint | ( | btRigidBody & | rbA,
|  | btRigidBody & | rbB,
|  | const btVector3 & | axisInA,
|  | const btVector3 & | axisInB,
|  | btScalar | ratio = `1.f`
| ) |  |

Implemented by Erwin Coumans. The idea for the constraint comes from Dimitris Papavasiliou.

Definition at line 20 of file btGearConstraint.cpp.

## ◆ ~btGearConstraint()

btGearConstraint::~btGearConstraint | ( |  | ) |
| virtual

Definition at line 28 of file btGearConstraint.cpp.

## Member Function Documentation

## ◆ calculateSerializeBufferSize()

int btGearConstraint::calculateSerializeBufferSize | ( |  | ) | const
| inlinevirtual

Reimplemented from btTypedConstraint.

Definition at line 119 of file btGearConstraint.h.

## ◆ getAxisA()

const btVector3 & btGearConstraint::getAxisA | ( |  | ) | const
| inline

Definition at line 61 of file btGearConstraint.h.

## ◆ getAxisB()

const btVector3 & btGearConstraint::getAxisB | ( |  | ) | const
| inline

Definition at line 65 of file btGearConstraint.h.

## ◆ getInfo1()

void btGearConstraint::getInfo1 | ( | btConstraintInfo1 * | info | ) |
| virtual

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

Implements btTypedConstraint.

Definition at line 32 of file btGearConstraint.cpp.

## ◆ getInfo2()

void btGearConstraint::getInfo2 | ( | btConstraintInfo2 * | info | ) |
| virtual

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

Implements btTypedConstraint.

Definition at line 38 of file btGearConstraint.cpp.

## ◆ getParam()

virtual btScalar btGearConstraint::getParam | ( | int | num,
|  | int | axis = `-1`
| ) |  | const
| inlinevirtual

return the local value of parameter

Implements btTypedConstraint.

Definition at line 83 of file btGearConstraint.h.

## ◆ getRatio()

btScalar btGearConstraint::getRatio | ( |  | ) | const
| inline

Definition at line 69 of file btGearConstraint.h.

## ◆ serialize()

const char * btGearConstraint::serialize | ( | void * | dataBuffer,
|  | btSerializer * | serializer
| ) |  | const
| inlinevirtual

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

Reimplemented from btTypedConstraint.

Definition at line 125 of file btGearConstraint.h.

## ◆ setAxisA()

void btGearConstraint::setAxisA | ( | btVector3 & | axisA | ) |
| inline

Definition at line 49 of file btGearConstraint.h.

## ◆ setAxisB()

void btGearConstraint::setAxisB | ( | btVector3 & | axisB | ) |
| inline

Definition at line 53 of file btGearConstraint.h.

## ◆ setParam()

virtual void btGearConstraint::setParam | ( | int | num,
|  | btScalar | value,
|  | int | axis = `-1`
| ) |  |
| inlinevirtual

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.

Implements btTypedConstraint.

Definition at line 74 of file btGearConstraint.h.

## ◆ setRatio()

void btGearConstraint::setRatio | ( | btScalar | ratio | ) |
| inline

Definition at line 57 of file btGearConstraint.h.

## Member Data Documentation

## ◆ m_axisInA

btVector3 btGearConstraint::m_axisInA
| protected

Definition at line 34 of file btGearConstraint.h.

## ◆ m_axisInB

btVector3 btGearConstraint::m_axisInB
| protected

Definition at line 35 of file btGearConstraint.h.

## ◆ m_ratio

btScalar btGearConstraint::m_ratio
| protected

Definition at line 37 of file btGearConstraint.h.

## ◆ m_useFrameA

bool btGearConstraint::m_useFrameA
| protected

Definition at line 36 of file btGearConstraint.h.

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

- btGearConstraint.h
- btGearConstraint.cpp