Skip to content

Class: Transform ​

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

Constructors ​

Constructor ​

new Transform(position?, rotation?): Transform

Parameters ​

position? ​

Vec2Value

rotation? ​

number

Returns ​

Transform

Properties ​

p ​

p: Vec2

position


q ​

q: Rot

rotation

Methods ​

set() ​

Call Signature ​

set(position, rotation): void

Set position and angle

Parameters ​
position ​

Vec2Value

rotation ​

number

Returns ​

void

Call Signature ​

set(xf): void

Copy from another transform

Parameters ​
xf ​

TransformValue

Returns ​

void


setIdentity() ​

setIdentity(): void

Set this to the identity transform

Returns ​

void


setNum() ​

setNum(position, rotation): void

Set position and angle

Parameters ​

position ​

Vec2Value

rotation ​

number

Returns ​

void


setTransform() ​

setTransform(xf): void

Parameters ​

xf ​

TransformValue

Returns ​

void


assert() ​

static assert(o): void

Parameters ​

o ​

any

Returns ​

void


clone() ​

static clone(xf): Transform

Parameters ​

xf ​

Transform

Returns ​

Transform


identity() ​

static identity(): Transform

Returns ​

Transform


isValid() ​

static isValid(obj): boolean

Parameters ​

obj ​

any

Returns ​

boolean


mul() ​

Call Signature ​

static mul(a, b): Vec2

Parameters ​
a ​

TransformValue

b ​

Vec2Value

Returns ​

Vec2

Call Signature ​

static mul(a, b): Transform

Parameters ​
a ​

TransformValue

b ​

TransformValue

Returns ​

Transform


mulAll() ​

Call Signature ​

static mulAll(a, b): Vec2[]

Parameters ​
a ​

Transform

b ​

Vec2Value[]

Returns ​

Vec2[]

Call Signature ​

static mulAll(a, b): Transform[]

Parameters ​
a ​

Transform

b ​

Transform[]

Returns ​

Transform[]


mulT() ​

Call Signature ​

static mulT(a, b): Vec2

Parameters ​
a ​

TransformValue

b ​

Vec2Value

Returns ​

Vec2

Call Signature ​

static mulT(a, b): Transform

Parameters ​
a ​

TransformValue

b ​

TransformValue

Returns ​

Transform


mulTVec2() ​

static mulTVec2(a, b): Vec2

Parameters ​

a ​

TransformValue

b ​

Vec2Value

Returns ​

Vec2


mulTXf() ​

static mulTXf(a, b): Transform

Parameters ​

a ​

TransformValue

b ​

TransformValue

Returns ​

Transform


mulVec2() ​

static mulVec2(a, b): Vec2

Parameters ​

a ​

TransformValue

b ​

Vec2Value

Returns ​

Vec2


mulXf() ​

static mulXf(a, b): Transform

Parameters ​

a ​

TransformValue

b ​

TransformValue

Returns ​

Transform