Box2D: b2Transform Struct Reference

# b2Transform Struct Reference

`#include <b2Math.h>`

List of all members.

## Public Member Functions

| b2Transform ()
| The default constructor does nothing (for performance).
| b2Transform (const b2Vec2 &position, const b2Mat22 &R)
| Initialize using a position vector and a rotation matrix.
void | SetIdentity ()
| Set this to the identity transform.
void | Set (const b2Vec2 &p, float32 angle)
| Set this based on the position and angle.
float32 | GetAngle () const
| Calculate the angle that the rotation matrix represents.

## Public Attributes

b2Vec2 | position
b2Mat22 | R

## Detailed Description

A transform contains translation and rotation. It is used to represent the position and orientation of rigid frames.

## Constructor & Destructor Documentation

b2Transform::b2Transform | ( |  | ) | `[inline]`

The default constructor does nothing (for performance).

b2Transform::b2Transform | ( | const b2Vec2 & | position,
|  | const b2Mat22 & | R |
| ) |  |  | `[inline]`

Initialize using a position vector and a rotation matrix.

## Member Function Documentation

float32 b2Transform::GetAngle | ( |  | ) | const`[inline]`

Calculate the angle that the rotation matrix represents.

void b2Transform::Set | ( | const b2Vec2 & | p,
|  | float32 | angle |
| ) |  |  | `[inline]`

Set this based on the position and angle.

void b2Transform::SetIdentity | ( |  | ) | `[inline]`

Set this to the identity transform.

## Member Data Documentation

b2Vec2 b2Transform::position

b2Mat22 b2Transform::R

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

- Box2D/Box2D/Common/b2Math.h