q
constq:object
Defined in: math/quat.ts:21
Type Declaration
Section titled “Type Declaration”angleZ()
Section titled “angleZ()”angleZ(
a):number
The Z turn of a 2D rotation, in radians.
Parameters
Section titled “Parameters”Pick<Quat, "z" | "w">
Returns
Section titled “Returns”number
axis()
Section titled “axis()”axis(
axis,rad):Quat
A turn of rad about one axis.
Parameters
Section titled “Parameters”"x" | "y" | "z"
number
Returns
Section titled “Returns”clone()
Section titled “clone()”clone(
a):Quat
Parameters
Section titled “Parameters”Returns
Section titled “Returns”conjugate()
Section titled “conjugate()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”create()
Section titled “create()”create(
w?,x?,y?,z?):Quat
Parameters
Section titled “Parameters”number = 1
number = 0
number = 0
number = 0
Returns
Section titled “Returns”dot(
a,b):number
Parameters
Section titled “Parameters”Returns
Section titled “Returns”number
fromEuler()
Section titled “fromEuler()”fromEuler(
deg):Quat
Inverse of toEuler.
Parameters
Section titled “Parameters”readonly number[]
Returns
Section titled “Returns”mul(
a,b):Quat
a applied after b (a·b) — a world-space turn composes on the left.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”normalize()
Section titled “normalize()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”rotate()
Section titled “rotate()”rotate(
a,v):Vec3
A vector turned by this rotation (q·v·q⁻¹, expanded).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”rotationTo()
Section titled “rotationTo()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”scaled()
Section titled “scaled()”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.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”setAngleZ()
Section titled “setAngleZ()”setAngleZ(
a,deg):Quat
Set the Z turn, keeping whatever the other two axes say — the 2D way in.
Parameters
Section titled “Parameters”Quat | undefined
number
Returns
Section titled “Returns”toEuler()
Section titled “toEuler()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”[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.