import * as mat4 from '../glmatrix/mat4'; import Vector3 from './Vector3'; import type Quaternion from './Quaternion'; import Matrix2d from './Matrix2d'; declare class Matrix4 { private _axisX; private _axisY; private _axisZ; array: mat4.Mat4Array; /** * Set components from array * @param arr */ setArray(arr: mat4.Mat4Array): this; /** * Calculate the adjugate of self, in-place */ adjoint(): this; /** * Clone a new Matrix4 */ clone(): Matrix4; /** * Copy from b * @param b */ copy(a: Matrix4): this; /** * Calculate matrix determinant */ determinant(): number; /** * Set upper 3x3 part from quaternion * @param q */ fromQuat(q: Quaternion): this; /** * Set from a quaternion rotation and a vector translation * @param q * @param v */ fromRotationTranslation(q: Quaternion, v: Vector3): this; /** * Set from Matrix2d, it is used when converting a 2d shape to 3d space. * In 3d space it is equivalent to ranslate on xy plane and rotate about z axis * @param m2d */ fromMat2d(m2d: Matrix2d): this; /** * Set from frustum bounds * @param left * @param right * @param bottom * @param top * @param near * @param far */ frustum(left: number, right: number, bottom: number, top: number, near: number, far: number): this; /** * Set to a identity matrix */ identity(): this; /** * Invert self */ invert(): this; /** * Set as a matrix with the given eye position, focal point, and up axis * @param eye * @param center * @param up */ lookAt(eye: Vector3, center: Vector3, up: Vector3): this; /** * Alias for mutiply * @param b */ mul(b: Matrix4): this; /** * Alias for multiplyLeft * @param a */ mulLeft(a: Matrix4): this; /** * Multiply self and b * @param b */ multiply(b: Matrix4): this; /** * Multiply a and self, a is on the left * @param a */ multiplyLeft(a: Matrix4): this; /** * Set as a orthographic projection matrix * @param left * @param right * @param bottom * @param top * @param near * @param far */ ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): this; /** * Set as a perspective projection matrix * @param fovy * @param aspect * @param near * @param far */ perspective(fovy: number, aspect: number, near: number, far: number): this; /** * Rotate self by rad about axis. * Equal to right-multiply a rotaion matrix * @param rad * @param axis */ rotate(rad: number, axis: Vector3): this; /** * Rotate self by a given radian about X axis. * Equal to right-multiply a rotaion matrix * @param rad */ rotateX(rad: number): this; /** * Rotate self by a given radian about Y axis. * Equal to right-multiply a rotaion matrix * @param rad */ rotateY(rad: number): this; /** * Rotate self by a given radian about Z axis. * Equal to right-multiply a rotaion matrix * @param rad */ rotateZ(rad: number): this; /** * Scale self by s * Equal to right-multiply a scale matrix * @param s */ scale(v: Vector3): this; /** * Translate self by v. * Equal to right-multiply a translate matrix * @param v */ translate(v: Vector3): this; /** * Transpose self, in-place. */ transpose(): this; /** * Decompose a matrix to SRT * @param scale * @param rotation * @param position * @see http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.matrix.decompose.aspx */ decomposeMatrix(scale: Vector3 | undefined, rotation: Quaternion, position: Vector3): void; /** * Z Axis of local transform * @name z * @type {clay.Vector3} * @memberOf clay.Matrix4 * @instance */ get z(): Vector3; set z(v: Vector3); /** * Y Axis of local transform * @name y * @type {clay.Vector3} * @memberOf clay.Matrix4 * @instance */ get y(): Vector3; set y(v: Vector3); /** * X Axis of local transform * @name x * @type {clay.Vector3} * @memberOf clay.Matrix4 * @instance */ get x(): Vector3; set x(v: Vector3); toString(): string; toArray(): mat4.Mat4Array; /** * @param out * @param a */ static adjoint(out: Matrix4, a: Matrix4): Matrix4; /** * @param out * @param a */ static copy(out: Matrix4, a: Matrix4): Matrix4; /** * @param a */ static determinant(a: Matrix4): number; /** * @param out */ static identity(out: Matrix4): Matrix4; /** * @param out * @param left * @param right * @param bottom * @param top * @param near * @param far */ static ortho(out: Matrix4, left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4; /** * @param out * @param fovy * @param aspect * @param near * @param far */ static perspective(out: Matrix4, fovy: number, aspect: number, near: number, far: number): Matrix4; /** * @param out * @param eye * @param center * @param up */ static lookAt(out: Matrix4, eye: Vector3, center: Vector3, up: Vector3): Matrix4; /** * @param out * @param a */ static invert(out: Matrix4, a: Matrix4): Matrix4; /** * @param out * @param a * @param b */ static mul(out: Matrix4, a: Matrix4, b: Matrix4): Matrix4; /** * @function * @param out * @param a * @param b */ static multiply: typeof Matrix4.mul; /** * @param out * @param q */ static fromQuat(out: Matrix4, q: Quaternion): Matrix4; /** * @param out * @param q * @param v */ static fromRotationTranslation(out: Matrix4, q: Quaternion, v: Vector3): Matrix4; /** * @param m4 * @param m2d */ static fromMat2d(m4: Matrix4, m2d: Matrix2d): Matrix4; /** * @param out * @param a * @param rad * @param axis */ static rotate(out: Matrix4, a: Matrix4, rad: number, axis: Vector3): Matrix4; /** * @param out * @param a * @param rad */ static rotateX(out: Matrix4, a: Matrix4, rad: number): Matrix4; /** * @param out * @param a * @param rad */ static rotateY(out: Matrix4, a: Matrix4, rad: number): Matrix4; /** * @param out * @param a * @param rad */ static rotateZ(out: Matrix4, a: Matrix4, rad: number): Matrix4; /** * @param out * @param a * @param v */ static scale(out: Matrix4, a: Matrix4, v: Vector3): Matrix4; /** * @param out * @param a */ static transpose(out: Matrix4, a: Matrix4): Matrix4; /** * @param out * @param a * @param v */ static translate(out: Matrix4, a: Matrix4, v: Vector3): Matrix4; } export default Matrix4;