Skip to content

mat4 ​

Namespace of @v12-engine/client/lite-views

Members ​

compose beta ​

ts
compose: (scale: XYZ, rotation: XYZW, translation: XYZ) => Mat4

A size, a turn and a place as one matrix, a new one

composeAt beta ​

ts
export declare function composeAt(scale: XYZ, rotation: XYZW, translation: XYZ, out: Float32Array | number[], offset: number): void;

A size, a turn and a place into sixteen floats of an array at offset: a batch's copy written where it stands. The size first, then the turn, then the place

composeToRef beta ​

ts
export declare function composeToRef(scale: XYZ, rotation: XYZW, translation: XYZ, out: Mat4): Mat4;

A size, a turn and a place as one matrix

copyToArray beta ​

ts
export declare function copyToArray(m: MatrixLike, array: Float32Array | number[], offset?: number): void;

A matrix into an array, at offset: one of a batch's

copyToRef beta ​

ts
export declare function copyToRef(m: MatrixLike, out: Mat4): Mat4;

m's sixteen floats into out

decompose beta ​

ts
export declare function decompose(m: MatrixLike, scale?: XYZ, rotation?: XYZW, translation?: XYZ): boolean;

A matrix taken apart into its size, its turn and its place: each written where one is given. A matrix that mirrors has its y size under 0. False, and the turn none, where a size is 0

determinant beta ​

ts
export declare function determinant(m: MatrixLike): number;

m's determinant: 0 where a size is 0, under 0 where it mirrors

equalsWithEpsilon beta ​

ts
export declare function equalsWithEpsilon(a: MatrixLike, b: MatrixLike, epsilon?: number): boolean;

Whether two matrices are the same to within epsilon a float

fromArrayToRef beta ​

ts
export declare function fromArrayToRef(array: MatrixLike, offset: number, out: Mat4): Mat4;

Sixteen floats of an array, from offset, into a matrix

fromQuaternionToRef beta ​

ts
export declare function fromQuaternionToRef(rotation: XYZW, out: Mat4): Mat4;

A quaternion's turn as a matrix

getTranslationToRef beta ​

ts
export declare function getTranslationToRef(m: MatrixLike, out: XYZ): XYZ;

m's place (its 12..14) into out

identity beta ​

ts
export declare function identity(): Mat4;

A new matrix that changes nothing

identityToRef beta ​

ts
export declare function identityToRef(out: Mat4): Mat4;

The matrix that changes nothing, into out

invert beta ​

ts
export declare function invert(m: MatrixLike): Mat4;

The matrix that undoes m, in a new one: a copy of m where there is none

invertToRef beta ​

ts
export declare function invertToRef(m: MatrixLike, out: Mat4): boolean;

The matrix that undoes m. False, and out a copy of m, where there is none (a scale of 0): as Babylon's invertToRef leaves it. out may be m

lookAtLHToRef beta ​

ts
export declare function lookAtLHToRef(eye: XYZ, target: XYZ, up: XYZ, out: Mat4): Mat4;

A view from eye towards target: Babylon's LookAtLHToRef

lookToToRef beta ​

ts
export declare function lookToToRef(eye: XYZ, forward: XYZ, up: XYZ, out: Mat4): Mat4;

A view from eye along forward (of any length), up being up on the screen as nearly as it can: the world as the camera sees it, x to its right, y up, z into the view

Mat4 beta ​

ts
export type Mat4 = Float32Array;

A matrix: 16 floats, the translation at 12..14

multiply beta ​

ts
multiply: (a: MatrixLike, b: MatrixLike) => Mat4

a then b, in a new matrix

multiplyInto beta ​

ts
export declare function multiplyInto(a: MatrixLike, aOffset: number, b: MatrixLike, bOffset: number, out: Float32Array | number[], offset: number): void;

a then b, into an array at offset. out may be either's own array at its own offset

multiplyToRef beta ​

ts
export declare function multiplyToRef(a: MatrixLike, b: MatrixLike, out: Mat4): Mat4;

a then b. out may be either

orthoOffCenterLHToRef beta ​

ts
export declare function orthoOffCenterLHToRef(left: number, right: number, bottom: number, top: number, near: number, far: number, out: Mat4): Mat4;

A view without perspective, of a box: depth 0 at near and 1 at far

perspectiveFovLHToRef beta ​

ts
export declare function perspectiveFovLHToRef(fov: number, aspect: number, near: number, far: number, out: Mat4): Mat4;

A lens of fov radians from top to bottom, depth 0 at near and 1 at far: Babylon's with the depth WebGPU's

rotationToRef beta ​

ts
export declare function rotationToRef<T extends XYZW>(m: MatrixLike, out: T): T;

The turn a matrix of no size makes (its three rows of length 1), as a quaternion

rotationX beta ​

ts
rotationX: (angle: number) => Mat4

A turn of angle radians about x, in a new matrix

rotationXToRef beta ​

ts
export declare function rotationXToRef(angle: number, out: Mat4): Mat4;

A turn of angle radians about x, into out

rotationYawPitchRollToRef beta ​

ts
export declare function rotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, out: Mat4): Mat4;

A turn about the vertical axis (yaw), then tilted (pitch, about x), after a roll about z: Babylon's order

rotationYToRef beta ​

ts
export declare function rotationYToRef(angle: number, out: Mat4): Mat4;

A turn of angle radians about y, the vertical, into out

rotationZToRef beta ​

ts
export declare function rotationZToRef(angle: number, out: Mat4): Mat4;

A turn of angle radians about z, into out

scalingToRef beta ​

ts
export declare function scalingToRef(x: number, y: number, z: number, out: Mat4): Mat4;

A size of x, y, z along each axis and nothing else, into out

setTranslation beta ​

ts
export declare function setTranslation(m: Mat4, x: number, y: number, z: number): Mat4;

m's place set to x, y, z, the rest as it was

transformNormalInto beta ​

ts
export declare function transformNormalInto(m: MatrixLike, x: number, y: number, z: number, out: Float32Array | number[], offset?: number): void;

A direction through a matrix into three floats of an array at offset: its turn and size, not its place

transformPointInto beta ​

ts
export declare function transformPointInto(m: MatrixLike, x: number, y: number, z: number, out: Float32Array | number[], offset?: number): void;

A point through a matrix into three floats of an array at offset, divided by its fourth (a point through a projection): Babylon's TransformCoordinates

translation beta ​

ts
translation: (x: number, y: number, z: number) => Mat4

A move to x, y, z and nothing else, in a new matrix

translationToRef beta ​

ts
export declare function translationToRef(x: number, y: number, z: number, out: Mat4): Mat4;

A move to x, y, z and nothing else, into out

transposeToRef beta ​

ts
export declare function transposeToRef(m: MatrixLike, out: Mat4): Mat4;

m with its rows as columns, into out. out may be m