MotionScript

@motion-script/core


@motion-script/core / Transform3D

Interface: Transform3D

Defined in: render3d/transform.ts:10

Placement of a single 3D object. Every field is optional; an omitted field means identity, so {} is a valid no-op transform.

Rotation is in degrees — motion-script's 2D rotation is degrees, so 3D matches and authors never write Math.PI. The renderer converts.

Extended by

Properties

castShadow?

optional castShadow?: boolean

Defined in: render3d/transform.ts:32


key?

optional key?: string

Defined in: render3d/transform.ts:48

Explicit reconciler identity.

By default the renderer caches one live 3D object per op, keyed by the op's structural path — its group() nesting plus its index within that group. That is stable for a builder that emits the same ops in the same order every frame, which is the normal case.

Set key when your builder emits ops conditionally, so a slot's meaning shifts between frames (if (t > 2) g.box(...)). Without it, inserting an op renumbers every later slot and forces the tail of the cache to rebuild.


lookAt?

optional lookAt?: Vector3Input

Defined in: render3d/transform.ts:29

World-space point to orient toward, applied after position. Wins over both rotation and quaternion.


position?

optional position?: Vector3Input

Defined in: render3d/transform.ts:12

Position in the parent's local space. Default origin.


quaternion?

optional quaternion?: Quaternion

Defined in: render3d/transform.ts:22

Rotation as a unit quaternion. Wins over rotation — use it (with slerpQuaternion) for tumbles where Euler interpolation would gimbal.


receiveShadow?

optional receiveShadow?: boolean

Defined in: render3d/transform.ts:33


renderOrder?

optional renderOrder?: number

Defined in: render3d/transform.ts:35

Draw-order override, for tuning transparent sorting.


rotation?

optional rotation?: Vector3Input | Euler3

Defined in: render3d/transform.ts:17

Euler rotation in degrees, applied in order (default "XYZ"). Ignored when quaternion is set.


scale?

optional scale?: Vector3Input

Defined in: render3d/transform.ts:24

Per-axis scale; a scalar scales uniformly. Default 1.


visible?

optional visible?: boolean

Defined in: render3d/transform.ts:31

Hide without removing (keeps the cached object alive). Default true.