Skip to content

API Class LocalToWorld

github-actions[bot] edited this page Nov 29, 2026 · 2 revisions

Class: LocalToWorld

Defined in: src/engine/core/LocalToWorld.ts:13

A node's local-to-world matrix and what it tells you (ADR 0163), after Unity ECS's LocalToWorld: value (the matrix), position, rotation, and the world directions right (+X), up (+Y) and forward (+Z, where cameras look; Unity's coordinates, ADR 0164). Read from transform.localToWorld, which takes a snapshot: it doesn't follow later moves.

Properties

value

readonly value: Float64Array;

Defined in: src/engine/core/LocalToWorld.ts:15

The matrix, column-major (16 numbers; translation in 12..14).

Accessors

forward

Get Signature

get forward(): Vector3;

Defined in: src/engine/core/LocalToWorld.ts:40

The node's forward (+Z) in world space, unit length.

Returns

Vector3


position

Get Signature

get position(): Vector3;

Defined in: src/engine/core/LocalToWorld.ts:24

World-space position (a new Vector3).

Returns

Vector3


right

Get Signature

get right(): Vector3;

Defined in: src/engine/core/LocalToWorld.ts:36

The node's +X axis in world space, unit length.

Returns

Vector3


rotation

Get Signature

get rotation(): Quaternion;

Defined in: src/engine/core/LocalToWorld.ts:30

World-space rotation, with scale taken out (a new Quaternion).

Returns

Quaternion


up

Get Signature

get up(): Vector3;

Defined in: src/engine/core/LocalToWorld.ts:38

The node's +Y axis in world space, unit length.

Returns

Vector3

Methods

inverseTransformDirection()

inverseTransformDirection(direction): Vector3;

Defined in: src/engine/core/LocalToWorld.ts:62

A world-space direction, in the node's local space.

Parameters

direction

Vec3Input

Returns

Vector3


inverseTransformPoint()

inverseTransformPoint(point): Vector3;

Defined in: src/engine/core/LocalToWorld.ts:55

A world-space point, in the node's local space.

Parameters

point

Vec3Input

Returns

Vector3


transformDirection()

transformDirection(direction): Vector3;

Defined in: src/engine/core/LocalToWorld.ts:49

A direction in the node's local space, in world space (rotation and scale, no translation).

Parameters

direction

Vec3Input

Returns

Vector3


transformPoint()

transformPoint(point): Vector3;

Defined in: src/engine/core/LocalToWorld.ts:43

A point in the node's local space, in world space.

Parameters

point

Vec3Input

Returns

Vector3

Clone this wiki locally