Skip to main content

Class: TransformManager

Defined in: render/transform.ts:9

Wrapper for Unity Transform RPCs. Provides strongly-typed parameters and returns.

Constructors

Constructor

new TransformManager(): TransformManager;

Returns

TransformManager

Methods

GetLocalPosition()

static GetLocalPosition(entity): vec3;

Defined in: render/transform.ts:160

Gets local position vector.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component

Returns

vec3

The position vector


GetLocalRotation()

static GetLocalRotation(entity): quat;

Defined in: render/transform.ts:222

Gets local rotation quaternion.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component

Returns

quat

The rotation quaternion


GetLocalScale()

static GetLocalScale(entity): vec3;

Defined in: render/transform.ts:252

Gets local scale vector.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component

Returns

vec3

The position vector


GetParent()

static GetParent(entity): number;

Defined in: render/transform.ts:102

Gets the parent entity handle, or -1 if none.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component

Returns

number

The parent entity handle


GetTransform()

static GetTransform(entity): mat4;

Defined in: render/transform.ts:53

Retrieves the world transform matrix (column-major).

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component

Returns

mat4

The transformation matrix


GetWorldPosition()

static GetWorldPosition(entity): vec3;

Defined in: render/transform.ts:147

Gets world position vector.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component

Returns

vec3

The position vector


GetWorldRotation()

static GetWorldRotation(entity): quat;

Defined in: render/transform.ts:209

Gets local rotation quaternion.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component

Returns

quat

The rotation quaternion


HasComponent()

static HasComponent(entity): boolean;

Defined in: render/transform.ts:15

Checks if the entity has a Transform component.

Parameters

ParameterTypeDescription
entitynumberThe entity to check

Returns

boolean

boolean indicating if transform component exists


SetLocalPosition()

static SetLocalPosition(entity, pos): boolean;

Defined in: render/transform.ts:131

Sets local position vector.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component
posvec3The position vector

Returns

boolean

boolean indicating success


SetLocalRotation()

static SetLocalRotation(entity, quat): boolean;

Defined in: render/transform.ts:192

Sets local rotation quaternion.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component
quatquatThe rotation quaternion [x, y, z, w]

Returns

boolean

boolean indicating success


SetLocalScale()

static SetLocalScale(entity, scale): boolean;

Defined in: render/transform.ts:236

Sets local scale vector.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component
scalevec3The scale vector

Returns

boolean

boolean indicating success


SetParent()

static SetParent(entity, parent): boolean;

Defined in: render/transform.ts:88

Sets this entity's parent transform.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component
parentnumberThe parent entity

Returns

boolean

boolean indicating success


SetTransform()

static SetTransform(entity, srcMatrix): boolean;

Defined in: render/transform.ts:30

Sets the world transform given a 16-element row-major matrix. Transposes to column-major and flips Z-axis for Unity. TODO: double check if this is correct, what are we using internally? Use the coords provided by gl matrix or unity.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component
srcMatrixmat4The source transformation matrix

Returns

boolean

boolean indicating success


SetWorldPosition()

static SetWorldPosition(entity, pos): boolean;

Defined in: render/transform.ts:114

Sets world position vector.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component
posvec3The position vector

Returns

boolean

boolean indicating success


SetWorldRotation()

static SetWorldRotation(entity, quat): boolean;

Defined in: render/transform.ts:174

Sets world rotation quaternion.

Parameters

ParameterTypeDescription
entitynumberThe entity with the transform component
quatquatThe rotation quaternion [x, y, z, w]

Returns

boolean

boolean indicating success