Skip to content

q

const q: object

Defined in: math/quat.ts:21

angleZ(a): number

The Z turn of a 2D rotation, in radians.

Pick<Quat, "z" | "w">

number

axis(axis, rad): Quat

A turn of rad about one axis.

"x" | "y" | "z"

number

Quat

clone(a): Quat

Quat

Quat

conjugate(a): Quat

The opposite turn. For a unit quaternion — which every stored rotation is — this is the inverse, and a world direction taken into a local frame by it.

Quat

Quat

create(w?, x?, y?, z?): Quat

number = 1

number = 0

number = 0

number = 0

Quat

dot(a, b): number

Quat

Quat

number

fromEuler(deg): Quat

Inverse of toEuler.

readonly number[]

Quat

mul(a, b): Quat

a applied after b (a·b) — a world-space turn composes on the left.

Quat

Quat

Quat

neg(a): Quat

Negated. -q and q are the same rotation; which one is stored decides whether a component-wise interpolation takes the short arc or the long one.

Quat

Quat

normalize(a): Quat

Unit length. Interpolating quaternions component-wise leaves a shorter one, and writing that scales the model — so anything that lerps must end here.

Quat

Quat

rotate(a, v): Vec3

A vector turned by this rotation (q·v·q⁻¹, expanded).

Quat

Vec3

Vec3

rotationTo(from, to): Quat

The shortest turn taking from to to; either may be any length. A direction is a way of naming a rotation, so it comes in here — what is stored stays the rotation. Roll about the axis is unconstrained by the pair and is left at none, which is what an aim has to say about it.

Vec3

Vec3

Quat

scaled(a, t): Quat

The same turn, t of the way through it — the shortest arc, so a rotation stored as -q scales the short way round rather than the long one. What a caller handed one frame’s worth of turn needs to spend it over two steps.

Quat

number

Quat

setAngleZ(a, deg): Quat

Set the Z turn, keeping whatever the other two axes say — the 2D way in.

Quat | undefined

number

Quat

toEuler(a): [number, number, number]

A rotation as three degrees, applied X then Y then Z about fixed axes — the order every DCC’s inspector shows. A rotation purely about Z reads back as (0, 0, angle) and rebuilds exactly.

Quat

[number, number, number]

core-sys.ts

Engine infrastructure surface: platform, lifecycle, logging, diagnostics, timers, entity helpers, networking, screen.

These are the “runs under everything else” primitives that a consuming application might touch (logging, timers, platform detection, runtime config) but that are not directly part of the ECS or render pipeline.

Re-exported wholesale by core.ts.