Skip to content

scalar

const scalar: object

Defined in: math/scalar.ts:13

readonly approximately(a, b, epsilon?): boolean

Within epsilon (default 1e-6).

number

number

number = 1e-6

boolean

readonly clamp(x, min, max): number

Clamp x to [min, max].

number

number

number

number

readonly clamp01(x): number

Clamp x to [0, 1].

number

number

readonly deg2rad(deg): number

number

number

readonly inverseLerp(a, b, value): number

Inverse of lerp: the t for which lerp(a,b,t)===value (0 if a===b).

number

number

number

number

readonly lerp(a, b, t): number

Linear interpolate a→b by t (t is not clamped).

number

number

number

number

readonly mod(x, n): number

Euclidean modulo — result has the sign of n (unlike JS %).

number

number

number

readonly rad2deg(rad): number

number

number

readonly remap(value, inMin, inMax, outMin, outMax): number

Map value from [inMin,inMax] onto [outMin,outMax].

number

number

number

number

number

number

readonly sign(x): number

number

number

readonly smoothstep(edge0, edge1, x): number

Hermite smoothstep of x across the [edge0, edge1] edge (clamped).

number

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.