Skip to Content
Bear documentation

worldTransform

Import from bear/engine/worldTransform.

Functions

composeBelow()

function composeBelow(node, ancestor): Matrix4;

Defined in: bear/engine/worldTransform.ts:26

The product of local transforms from just below ancestor down to node (inclusive): node's pose in ancestor's frame. A null ancestor composes from the tree root, i.e. building space.

Parameters

ParameterType
nodeAncestorNode | null
ancestorAncestorNode | null

Returns

Matrix4


relativeTransform()

function relativeTransform(target, frame): Matrix4;

Defined in: bear/engine/worldTransform.ts:48

target's pose expressed in frame's space, composed through their lowest common ancestor. Everything above the shared assembly cancels, so it is never consulted: a subtree can be placed relative to itself before anything above it is known.

Parameters

ParameterType
targetAncestorNode
frameAncestorNode | null

Returns

Matrix4


worldPosition()

function worldPosition(node): Vector3;

Defined in: bear/engine/worldTransform.ts:17

A node's origin in world space.

Parameters

ParameterType
nodeAncestorNode

Returns

Vector3


worldTransform()

function worldTransform(node): Matrix4;

Defined in: bear/engine/worldTransform.ts:12

Compose a node's world transform by walking up the ancestor chain. Returns a Matrix4 that transforms from the node's local space to world space. Node transforms are local to their parent; this module is the one place that composes them.

Parameters

ParameterType
nodeAncestorNode

Returns

Matrix4

On this page