Table of Contents

Struct b2Transform

Namespace
Gym.Box2D
Assembly
Gym.Environments.dll

A rigid transform, a translation p and a rotation q: a body's frame in the world.

public struct b2Transform
Inherited Members
Extension Methods

Remarks

Constructors

b2Transform(b2Vec2, b2Rot)

A transform of the given translation and rotation.

public b2Transform(b2Vec2 position, b2Rot rotation)

Parameters

position b2Vec2

The translation.

rotation b2Rot

The rotation.

Fields

p

The translation.

public b2Vec2 p

Field Value

b2Vec2

q

The rotation.

public b2Rot q

Field Value

b2Rot

Properties

angle

The rotation's angle in radians (pybox2d's angle).

public float angle { readonly get; set; }

Property Value

float

position

The translation (pybox2d's position, Box2D's p).

public b2Vec2 position { readonly get; set; }

Property Value

b2Vec2

Methods

Set(b2Vec2, float)

Sets the translation and the rotation's angle.

public void Set(b2Vec2 position, float angle)

Parameters

position b2Vec2

The translation.

angle float

The angle in radians.

SetIdentity()

Sets this to the identity transform.

public void SetIdentity()

Operators

operator *(b2Transform, b2Vec2)

Maps a local point into the frame, as pybox2d's b2Transform.mul computes it: (q.c * v.x - q.s * v.y) + p.x and (q.s * v.x + q.c * v.y) + p.y in float32. Gymnasium's renderers place every fixture vertex with it.

public static b2Vec2 operator *(b2Transform t, b2Vec2 v)

Parameters

t b2Transform

The transform.

v b2Vec2

The local point.

Returns

b2Vec2

The world point.