import { Vec3 } from './vec3'; /** * Class representing a 4x4 Matrix and providing static utilities for mathematical operations */ export declare class Mat4 { readonly array: ReadonlyArray; /** * Internally-referenced static identity matrix */ private static readonly IDENTITY; /** * Add two Mat4s * * @param left the first Mat4 * @param right the second Mat4 * * @returns the result of the addition */ static add(left: Mat4, right: Mat4): Mat4; /** * Subtract the right Mat4 from the left * * @param left the Mat4 to subtract from * @param right the Mat4 to subtract * * @returns the result of the subtraction */ static sub(left: Mat4, right: Mat4): Mat4; /** * Multiply two Mat4s * * @param left the first Mat4 * @param right the second Mat4 * * @returns the result of the multiplication */ static mult(left: Mat4, right: Mat4): Mat4; /** * Multiply a Mat4 by a given scalar factor * * @param m the Mat4 to multiply * @param factor the factor to multiply by * * @returns the multiplied Mat4 */ static multScalar(m: Mat4, factor: number): Mat4; /** * Invert a Mat4 * * @param m the Mat4 to invert * * @returns the inverse of the Mat4 */ static invert(m: Mat4): Mat4 | null; /** * Transpose a Mat4 * * @param m the Mat4 to transpose * * @return the transposed Mat4 */ static transpose(m: Mat4): Mat4; /** * Calculate the adjugate of a Mat4 * * @param m the Mat4 * * @returns the adjugate of the Mat4 */ static adjoint(m: Mat4): Mat4; /** * Translate a Mat4 by a Vec3 along the x, y and z axes * * @param m the Mat4 to translate * @param translate the translation vector * * @returns the translated Mat4 */ static translate(m: Mat4, translate: Vec3): Mat4; /** * Rotate a Mat4 by a given angle (radians) around the X axis * * @param m the Mat4 to rotate * @param angle the angle to rotate by * * @returns the rotated Mat4 */ static rotateX(m: Mat4, angle: number): Mat4; /** * Rotate a Mat4 by a given angle (radians) around the Y axis * * @param m the Mat4 to rotate * @param angle the angle to rotate by * * @returns the rotated Mat4 */ static rotateY(m: Mat4, angle: number): Mat4; /** * Rotate a Mat4 by a given angle (radians) around the Z axis * * @param m the Mat4 to rotate * @param angle the angle to rotate by * * @returns the rotated Mat4 */ static rotateZ(m: Mat4, angle: number): Mat4; /** * Create a Mat4 representing a rotation by a given angle (radians) around an arbitrary given axis * * Useful convenience method effectively equivalent to rotating a new Mat4 by angles scaled along the x, y and z axes * * @param axis the axis to rotate around * @param angle the angle (radians) to rotate by * * @returns the rotation Matrix */ static fromAxisRotation(axis: Vec3, angle: number): Mat4; /** * Scale a Mat4 by factors on the x, y and z axes, given as a Vec3 * * @param m the Mat4 to scale * @param factor the axis factors to scale by * * @returns the scaled Mat4 */ static scale(m: Mat4, factor: Vec3): Mat4; /** * Create a 4x4 perspective projection matrix for a given field of view, aspect ratio and near and far planes * * If far is not provided, an infinite projection matrix will be created * * @param fov the vertical field of view * @param aspect the aspect ratio * @param near the near plane * @param far the far plane * * @returns the 4x4 perspective projection matrix */ static perspective(fov: number, aspect: number, near: number, far?: number): Mat4; /** * Create a 4x4 orthographic projection matrix for a given viewing box definition * * @param left the left of the viewing box * @param right the right of the viewing box * @param bottom the bottom of the viewing box * @param top the top of the viewing box * @param near the near plane * @param far the far plane * * @returns the 4x4 orthographic projection matrix */ static ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4; /** * Create a 4x4 lookAt matrix, representing the orientation required to have an object face a target * * Note: **does not** produce a View Matrix, instead a more generally-useful lookAt Matrix. For use as a View, must be inverted * * @param eye the position of the object * @param target the target to look at * @param up the up axis of the object * * @returns the lookAt matrix */ static lookAt(eye: Vec3, target: Vec3, up: Vec3): Mat4; /** * Constructor. Take and store the Mat4's values * * @param values the Mat4's values; defaults to Mat4.IDENTITY */ constructor(array?: ReadonlyArray); /** * Getter for the Mat4's determinant */ get determinant(): number; /** * Getter for the Mat4's forward vector */ get forwardVector(): Vec3; /** * Getter for the Mat4's forward vector */ get rightVector(): Vec3; /** * Getter for the Mat4's up vector */ get upVector(): Vec3; /** * Getter for the Float32Array form of the Mat4 */ get float32Array(): Float32Array; /** * Getter for the readable string form of the Mat4 */ get string(): string; /** * Reset the Mat4's values to match the identity matrix */ reset(): void; /** * Clone the Mat4 * * @returns a new Mat4 with the same values as this one */ clone(): Mat4; /** * Getter for a Mutable cast of the Mat4 instance; used for enabling internal-only mutation * * @returns the typecasted Mutable Mat4 instance */ private get mutable(); }