Bullet Collision Detection & Physics Library: btTransform Class Reference

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
btTransform Class Reference

The btTransform class supports rigid transforms with only translation and rotation and no scaling/shear. More...

`#include <btTransform.h>`

Collaboration diagram for btTransform:
[legend]

## Public Member Functions
| BT_DECLARE_ALIGNED_ALLOCATOR ()
| btTransform ()
| No initialization constructor.
| btTransform (const btQuaternion &q, const btVector3 &c=btVector3(btScalar(0), btScalar(0), btScalar(0)))
| Constructor from btQuaternion (optional btVector3 )
| btTransform (const btMatrix3x3 &b, const btVector3 &c=btVector3(btScalar(0), btScalar(0), btScalar(0)))
| Constructor from btMatrix3x3 (optional btVector3)
| btTransform (const btTransform &other)
| Copy constructor.
btTransform & | operator= (const btTransform &other)
| Assignment Operator.
void | mult (const btTransform &t1, const btTransform &t2)
| Set the current transform as the value of the product of two transforms.
btVector3 | operator() (const btVector3 &x) const
| Return the transform of the vector.
btVector3 | operator* (const btVector3 &x) const
| Return the transform of the vector.
btQuaternion | operator* (const btQuaternion &q) const
| Return the transform of the btQuaternion.
btMatrix3x3 & | getBasis ()
| Return the basis matrix for the rotation.
const btMatrix3x3 & | getBasis () const
| Return the basis matrix for the rotation.
btVector3 & | getOrigin ()
| Return the origin vector translation.
const btVector3 & | getOrigin () const
| Return the origin vector translation.
btQuaternion | getRotation () const
| Return a quaternion representing the rotation.
void | setFromOpenGLMatrix (const btScalar *m)
| Set from an array.
void | getOpenGLMatrix (btScalar *m) const
| Fill an array representation.
void | setOrigin (const btVector3 &origin)
| Set the translational element.
btVector3 | invXform (const btVector3 &inVec) const
void | setBasis (const btMatrix3x3 &basis)
| Set the rotational element by btMatrix3x3.
void | setRotation (const btQuaternion &q)
| Set the rotational element by btQuaternion.
void | setIdentity ()
| Set this transformation to the identity.
btTransform & | operator*= (const btTransform &t)
| Multiply this Transform by another(this = this * another)
btTransform | inverse () const
| Return the inverse of this transform.
btTransform | inverseTimes (const btTransform &t) const
| Return the inverse of this transform times the other transform.
btTransform | operator* (const btTransform &t) const
| Return the product of this transform and the other.
void | serialize (struct btTransformData &dataOut) const
void | serializeFloat (struct btTransformFloatData &dataOut) const
void | deSerialize (const struct btTransformData &dataIn)
void | deSerializeDouble (const struct btTransformDoubleData &dataIn)
void | deSerializeFloat (const struct btTransformFloatData &dataIn)

## Static Public Member Functions
static const btTransform & | getIdentity ()
| Return an identity transform.

## Private Attributes
btMatrix3x3 | m_basis
| Storage for the rotation.
btVector3 | m_origin
| Storage for the translation.

## Detailed Description

The btTransform class supports rigid transforms with only translation and rotation and no scaling/shear.

It can be used in combination with btVector3, btQuaternion and btMatrix3x3 linear algebra classes.

Definition at line 28 of file btTransform.h.

## Constructor & Destructor Documentation

## ◆ btTransform() [1/4]

btTransform::btTransform | ( |  | ) |
| inline

No initialization constructor.

Definition at line 39 of file btTransform.h.

## ◆ btTransform() [2/4]

btTransform::btTransform | ( | const btQuaternion & | q,
|  | const btVector3 & | c = btVector3(btScalar(0), btScalar(0), btScalar(0)) )
| inlineexplicit

Constructor from btQuaternion (optional btVector3 )

Parameters

  q | Rotation from quaternion
  c | Translation from Vector (default 0,0,0)

Definition at line 43 of file btTransform.h.

## ◆ btTransform() [3/4]

btTransform::btTransform | ( | const btMatrix3x3 & | b,
|  | const btVector3 & | c = btVector3(btScalar(0), btScalar(0), btScalar(0)) )
| inlineexplicit

Constructor from btMatrix3x3 (optional btVector3)

Parameters

  b | Rotation from Matrix
  c | Translation from Vector default (0,0,0)

Definition at line 53 of file btTransform.h.

## ◆ btTransform() [4/4]

btTransform::btTransform | ( | const btTransform & | other | ) |
| inline

Copy constructor.

Definition at line 60 of file btTransform.h.

## Member Function Documentation

## ◆ BT_DECLARE_ALIGNED_ALLOCATOR()

btTransform::BT_DECLARE_ALIGNED_ALLOCATOR | ( |  | ) |

## ◆ deSerialize()

void btTransform::deSerialize | ( | const struct btTransformData & | dataIn | ) |
| inline

Definition at line 269 of file btTransform.h.

## ◆ deSerializeDouble()

void btTransform::deSerializeDouble | ( | const struct btTransformDoubleData & | dataIn | ) |
| inline

Definition at line 281 of file btTransform.h.

## ◆ deSerializeFloat()

void btTransform::deSerializeFloat | ( | const struct btTransformFloatData & | dataIn | ) |
| inline

Definition at line 275 of file btTransform.h.

## ◆ getBasis() [1/2]

btMatrix3x3 & btTransform::getBasis | ( |  | ) |
| inline

Return the basis matrix for the rotation.

Definition at line 109 of file btTransform.h.

## ◆ getBasis() [2/2]

const btMatrix3x3 & btTransform::getBasis | ( |  | ) | const
| inline

Return the basis matrix for the rotation.

Definition at line 111 of file btTransform.h.

## ◆ getIdentity()

static const btTransform & btTransform::getIdentity | ( |  | ) |
| inlinestatic

Return an identity transform.

Definition at line 198 of file btTransform.h.

## ◆ getOpenGLMatrix()

void btTransform::getOpenGLMatrix | ( | btScalar * | m | ) | const
| inline

Fill an array representation.

Parameters

  m | A pointer to a 16 element array (12 rotation(row major padded on the right by 1), and 3 translation

Definition at line 136 of file btTransform.h.

## ◆ getOrigin() [1/2]

btVector3 & btTransform::getOrigin | ( |  | ) |
| inline

Return the origin vector translation.

Definition at line 114 of file btTransform.h.

## ◆ getOrigin() [2/2]

const btVector3 & btTransform::getOrigin | ( |  | ) | const
| inline

Return the origin vector translation.

Definition at line 116 of file btTransform.h.

## ◆ getRotation()

btQuaternion btTransform::getRotation | ( |  | ) | const
| inline

Return a quaternion representing the rotation.

Definition at line 119 of file btTransform.h.

## ◆ inverse()

btTransform btTransform::inverse | ( |  | ) | const
| inline

Return the inverse of this transform.

Definition at line 183 of file btTransform.h.

## ◆ inverseTimes()

btTransform btTransform::inverseTimes | ( | const btTransform & | t | ) | const
| inline

Return the inverse of this transform times the other transform.

Parameters

  t | The other transform return this.inverse() * the other

Definition at line 223 of file btTransform.h.

## ◆ invXform()

btVector3 btTransform::invXform | ( | const btVector3 & | inVec | ) | const
| inline

Definition at line 216 of file btTransform.h.

## ◆ mult()

void btTransform::mult | ( | const btTransform & | t1,
|  | const btTransform & | t2 )
| inline

Set the current transform as the value of the product of two transforms.

Parameters

  t1 | Transform 1
  t2 | Transform 2 This = Transform1 * Transform2

Definition at line 77 of file btTransform.h.

## ◆ operator()()

btVector3 btTransform::operator() | ( | const btVector3 & | x | ) | const
| inline

Return the transform of the vector.

Definition at line 91 of file btTransform.h.

## ◆ operator*() [1/3]

btQuaternion btTransform::operator* | ( | const btQuaternion & | q | ) | const
| inline

Return the transform of the btQuaternion.

Definition at line 103 of file btTransform.h.

## ◆ operator*() [2/3]

btTransform btTransform::operator* | ( | const btTransform & | t | ) | const
| inline

Return the product of this transform and the other.

Definition at line 231 of file btTransform.h.

## ◆ operator*() [3/3]

btVector3 btTransform::operator* | ( | const btVector3 & | x | ) | const
| inline

Return the transform of the vector.

Definition at line 97 of file btTransform.h.

## ◆ operator*=()

btTransform & btTransform::operator*= | ( | const btTransform & | t | ) |
| inline

Multiply this Transform by another(this = this * another)

Parameters

  t | The other transform

Definition at line 175 of file btTransform.h.

## ◆ operator=()

btTransform & btTransform::operator= | ( | const btTransform & | other | ) |
| inline

Assignment Operator.

Definition at line 66 of file btTransform.h.

## ◆ serialize()

void btTransform::serialize | ( | struct btTransformData & | dataOut | ) | const
| inline

Definition at line 257 of file btTransform.h.

## ◆ serializeFloat()

void btTransform::serializeFloat | ( | struct btTransformFloatData & | dataOut | ) | const
| inline

Definition at line 263 of file btTransform.h.

## ◆ setBasis()

void btTransform::setBasis | ( | const btMatrix3x3 & | basis | ) |
| inline

Set the rotational element by btMatrix3x3.

Definition at line 155 of file btTransform.h.

## ◆ setFromOpenGLMatrix()

void btTransform::setFromOpenGLMatrix | ( | const btScalar * | m | ) |
| inline

Set from an array.

Parameters

  m | A pointer to a 16 element array (12 rotation(row major padded on the right by 1), and 3 translation

Definition at line 128 of file btTransform.h.

## ◆ setIdentity()

void btTransform::setIdentity | ( |  | ) |
| inline

Set this transformation to the identity.

Definition at line 167 of file btTransform.h.

## ◆ setOrigin()

void btTransform::setOrigin | ( | const btVector3 & | origin | ) |
| inline

Set the translational element.

Parameters

  origin | The vector to set the translation to

Definition at line 147 of file btTransform.h.

## ◆ setRotation()

void btTransform::setRotation | ( | const btQuaternion & | q | ) |
| inline

Set the rotational element by btQuaternion.

Definition at line 161 of file btTransform.h.

## Member Data Documentation

## ◆ m_basis

btMatrix3x3 btTransform::m_basis
| private

Storage for the rotation.

Definition at line 32 of file btTransform.h.

## ◆ m_origin

btVector3 btTransform::m_origin
| private

Storage for the translation.

Definition at line 34 of file btTransform.h.

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

- btTransform.h