Bullet Collision Detection & Physics Library: btUniversalConstraint 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
btUniversalConstraint Class Reference

Constraint similar to ODE Universal Joint has 2 rotatioonal degrees of freedom, similar to Euler rotations around Z (axis 1) and Y (axis 2) Description from ODE manual : "Given axis 1 on body 1, and axis 2 on body 2 that is perpendicular to axis 1, it keeps them perpendicular. More...

`#include <btUniversalConstraint.h>`

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

## Public Member Functions
| BT_DECLARE_ALIGNED_ALLOCATOR ()
| btUniversalConstraint (btRigidBody &rbA, btRigidBody &rbB, const btVector3 &anchor, const btVector3 &axis1, const btVector3 &axis2)
const btVector3 & | getAnchor ()
const btVector3 & | getAnchor2 ()
const btVector3 & | getAxis1 ()
const btVector3 & | getAxis2 ()
btScalar | getAngle1 ()
btScalar | getAngle2 ()
void | setUpperLimit (btScalar ang1max, btScalar ang2max)
void | setLowerLimit (btScalar ang1min, btScalar ang2min)
void | setAxis (const btVector3 &axis1, const btVector3 &axis2)
Public Member Functions inherited from btGeneric6DofConstraint
| BT_DECLARE_ALIGNED_ALLOCATOR ()
| btGeneric6DofConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
| btGeneric6DofConstraint (btRigidBody &rbB, const btTransform &frameInB, bool useLinearReferenceFrameB)
void | calculateTransforms (const btTransform &transA, const btTransform &transB)
| Calcs global transform of the offsets.
void | calculateTransforms ()
const btTransform & | getCalculatedTransformA () const
| Gets the global transform of the offset for body A.
const btTransform & | getCalculatedTransformB () const
| Gets the global transform of the offset for body B.
const btTransform & | getFrameOffsetA () const
const btTransform & | getFrameOffsetB () const
btTransform & | getFrameOffsetA ()
btTransform & | getFrameOffsetB ()
virtual void | buildJacobian ()
| performs Jacobian calculation, and also calculates angle differences and axis
virtual void | getInfo1 (btConstraintInfo1 *info)
| internal method used by the constraint solver, don't use them directly
void | getInfo1NonVirtual (btConstraintInfo1 *info)
virtual void | getInfo2 (btConstraintInfo2 *info)
| internal method used by the constraint solver, don't use them directly
void | getInfo2NonVirtual (btConstraintInfo2 *info, const btTransform &transA, const btTransform &transB, const btVector3 &linVelA, const btVector3 &linVelB, const btVector3 &angVelA, const btVector3 &angVelB)
void | updateRHS (btScalar timeStep)
btVector3 | getAxis (int axis_index) const
| Get the rotation axis in global coordinates.
btScalar | getAngle (int axis_index) const
| Get the relative Euler angle.
btScalar | getRelativePivotPosition (int axis_index) const
| Get the relative position of the constraint pivot.
void | setFrames (const btTransform &frameA, const btTransform &frameB)
bool | testAngularLimitMotor (int axis_index)
| Test angular limit.
void | setLinearLowerLimit (const btVector3 &linearLower)
void | getLinearLowerLimit (btVector3 &linearLower) const
void | setLinearUpperLimit (const btVector3 &linearUpper)
void | getLinearUpperLimit (btVector3 &linearUpper) const
void | setAngularLowerLimit (const btVector3 &angularLower)
void | getAngularLowerLimit (btVector3 &angularLower) const
void | setAngularUpperLimit (const btVector3 &angularUpper)
void | getAngularUpperLimit (btVector3 &angularUpper) const
btRotationalLimitMotor * | getRotationalLimitMotor (int index)
| Retrieves the angular limit informacion.
btTranslationalLimitMotor * | getTranslationalLimitMotor ()
| Retrieves the limit informacion.
void | setLimit (int axis, btScalar lo, btScalar hi)
bool | isLimited (int limitIndex) const
| Test limit.
virtual void | calcAnchorPos (void)
int | get_limit_motor_info2 (btRotationalLimitMotor *limot, const btTransform &transA, const btTransform &transB, const btVector3 &linVelA, const btVector3 &linVelB, const btVector3 &angVelA, const btVector3 &angVelB, btConstraintInfo2 *info, int row, btVector3 &ax1, int rotational, int rotAllowed=false)
bool | getUseFrameOffset () const
void | setUseFrameOffset (bool frameOffsetOnOff)
bool | getUseLinearReferenceFrameA () const
void | setUseLinearReferenceFrameA (bool linearReferenceFrameA)
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
void | setAxis (const btVector3 &axis1, const btVector3 &axis2)
virtual int | getFlags () const
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 | setupSolverConstraint (btConstraintArray &ca, int solverBodyA, int solverBodyB, btScalar timeStep)
| 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 ()
Public Member Functions inherited from btTypedObject
| btTypedObject (int objectType)
int | getObjectType () const

## Protected Attributes
btVector3 | m_anchor
btVector3 | m_axis1
btVector3 | m_axis2
Protected Attributes inherited from btGeneric6DofConstraint
btTransform | m_frameInA
| relative_frames
btTransform | m_frameInB
| the constraint space w.r.t body B
btJacobianEntry | m_jacLinear [3]
| Jacobians.
btJacobianEntry | m_jacAng [3]
| 3 orthogonal angular constraints
btTranslationalLimitMotor | m_linearLimits
| Linear_Limit_parameters.
btRotationalLimitMotor | m_angularLimits [3]
| hinge_parameters
btScalar | m_timeStep
| temporal variables
btTransform | m_calculatedTransformA
btTransform | m_calculatedTransformB
btVector3 | m_calculatedAxisAngleDiff
btVector3 | m_calculatedAxis [3]
btVector3 | m_calculatedLinearDiff
btScalar | m_factA
btScalar | m_factB
bool | m_hasStaticBody
btVector3 | m_AnchorPos
bool | m_useLinearReferenceFrameA
bool | m_useOffsetForConstraintFrame
int | m_flags
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 btGeneric6DofConstraint
bool | m_useSolveConstraintObsolete
| for backwards compatibility during the transition to 'getInfo/getInfo2'
Public Attributes inherited from btTypedConstraint
Public Attributes inherited from btTypedObject
int | m_objectType
Protected Member Functions inherited from btGeneric6DofConstraint
btGeneric6DofConstraint & | operator= (btGeneric6DofConstraint &other)
int | setAngularLimits (btConstraintInfo2 *info, int row_offset, const btTransform &transA, const btTransform &transB, const btVector3 &linVelA, const btVector3 &linVelB, const btVector3 &angVelA, const btVector3 &angVelB)
int | setLinearLimits (btConstraintInfo2 *info, int row, const btTransform &transA, const btTransform &transB, const btVector3 &linVelA, const btVector3 &linVelB, const btVector3 &angVelA, const btVector3 &angVelB)
void | buildLinearJacobian (btJacobianEntry &jacLinear, const btVector3 &normalWorld, const btVector3 &pivotAInW, const btVector3 &pivotBInW)
void | buildAngularJacobian (btJacobianEntry &jacAngular, const btVector3 &jointAxisW)
void | calculateLinearInfo ()
void | calculateAngleInfo ()
| calcs the euler angles between the two bodies.
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

Constraint similar to ODE Universal Joint has 2 rotatioonal degrees of freedom, similar to Euler rotations around Z (axis 1) and Y (axis 2) Description from ODE manual : "Given axis 1 on body 1, and axis 2 on body 2 that is perpendicular to axis 1, it keeps them perpendicular.

In other words, rotation of the two bodies about the direction perpendicular to the two axes will be equal."

Definition at line 30 of file btUniversalConstraint.h.

## Constructor & Destructor Documentation

## ◆ btUniversalConstraint()

btUniversalConstraint::btUniversalConstraint | ( | btRigidBody & | rbA,
|  | btRigidBody & | rbB,
|  | const btVector3 & | anchor,
|  | const btVector3 & | axis1,
|  | const btVector3 & | axis2 )

Definition at line 25 of file btUniversalConstraint.cpp.

## Member Function Documentation

## ◆ BT_DECLARE_ALIGNED_ALLOCATOR()

btUniversalConstraint::BT_DECLARE_ALIGNED_ALLOCATOR | ( |  | ) |

## ◆ getAnchor()

const btVector3 & btUniversalConstraint::getAnchor | ( |  | ) |
| inline

Definition at line 46 of file btUniversalConstraint.h.

## ◆ getAnchor2()

const btVector3 & btUniversalConstraint::getAnchor2 | ( |  | ) |
| inline

Definition at line 47 of file btUniversalConstraint.h.

## ◆ getAngle1()

btScalar btUniversalConstraint::getAngle1 | ( |  | ) |
| inline

Definition at line 50 of file btUniversalConstraint.h.

## ◆ getAngle2()

btScalar btUniversalConstraint::getAngle2 | ( |  | ) |
| inline

Definition at line 51 of file btUniversalConstraint.h.

## ◆ getAxis1()

const btVector3 & btUniversalConstraint::getAxis1 | ( |  | ) |
| inline

Definition at line 48 of file btUniversalConstraint.h.

## ◆ getAxis2()

const btVector3 & btUniversalConstraint::getAxis2 | ( |  | ) |
| inline

Definition at line 49 of file btUniversalConstraint.h.

## ◆ setAxis()

void btUniversalConstraint::setAxis | ( | const btVector3 & | axis1,
|  | const btVector3 & | axis2 )

Definition at line 59 of file btUniversalConstraint.cpp.

## ◆ setLowerLimit()

void btUniversalConstraint::setLowerLimit | ( | btScalar | ang1min,
|  | btScalar | ang2min )
| inline

Definition at line 54 of file btUniversalConstraint.h.

## ◆ setUpperLimit()

void btUniversalConstraint::setUpperLimit | ( | btScalar | ang1max,
|  | btScalar | ang2max )
| inline

Definition at line 53 of file btUniversalConstraint.h.

## Member Data Documentation

## ◆ m_anchor

btVector3 btUniversalConstraint::m_anchor
| protected

Definition at line 34 of file btUniversalConstraint.h.

## ◆ m_axis1

btVector3 btUniversalConstraint::m_axis1
| protected

Definition at line 35 of file btUniversalConstraint.h.

## ◆ m_axis2

btVector3 btUniversalConstraint::m_axis2
| protected

Definition at line 36 of file btUniversalConstraint.h.

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

- btUniversalConstraint.h
- btUniversalConstraint.cpp