B.Math.Matrix4()Represents a column-major 4x4 matrix.
To create the object use B.Math.makeMatrix4(). Note: the order of transformations coincides with the order in which the matrices are multiplied (from left to right). CONSTANTS:{B.Math.Matrix4} ZERO = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0] Zero matrix. {B.Math.Matrix4} IDENTITY = [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1] Identity matrix. PROPERTIES:{Array.<number>} m Matrix element array. METHODS:clone() Clones this matrix to a new matrix. RETURNS:this copy(matrix) Copies a given matrix into this matrix. set(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) Sets all elements of this matrix. PARAMETERS:{number} m00 {number} m01 {number} m02 {number} m03 {number} m10 {number} m11 {number} m12 {number} m13 {number} m20 {number} m21 {number} m22 {number} m23 {number} m30 {number} m31 {number} m32 {number} m33 RETURNS:this get(row, column) Gets an element by its row and column indices. PARAMETERS:{number} row index [0, 3] {number} column index [0, 3] RETURNS:{number} THROWS:{Error} if the index is out of range. setMatrix3(matrix) Sets 3x3 top left part of this matrix. getMatrix3(result) Returns 3x3 top left part of this matrix. setAxisX(axis) Sets the X-axis vector. getAxisX(result) Returns the X-axis vector. setAxisY(axis) Sets the Y-axis vector. getAxisY(result) Returns the Y-axis vector. setAxisZ(axis) Sets the Z-axis vector. getAxisZ(result) Returns the Z-axis vector. setPosition(position) Sets the position vector. getPosition(result) Returns the position vector. extractScale(result) Extracts scale factors. fromArray(array, offset) Sets this matrix elements from a part of array. PARAMETERS:{Array.<number>} array {number} [offset] = 0 RETURNS:{number} new offset toArray(array, offset) Sets this matrix elements to a part of array. PARAMETERS:{Array.<number>} array {number} [offset] = 0 RETURNS:{number} new offset fromAngles(angles) Sets this matrix from Euler angles. fromQuaternion(q) Sets this matrix from a quaternion. identity() Sets this matrix to the identity. RETURNS:this translation(x, y, z) Sets this matrix to translation transform. rotationX(angle) Sets this matrix to X-axis rotation transform. rotationY(angle) Sets this matrix to Y-axis rotation transform. rotationZ(angle) Sets this matrix to Z-axis rotation transform. rotationAxis(axis, angle) Sets this matrix to arbitrary axis rotation transform. scale(x, y, z) Sets this matrix to scale transform. lookAt(eye, target, up) Sets this matrix to right-handed view transform. PARAMETERS:RETURNS:this orthographic(width, height, zNear, zFar) Sets this matrix to orthographic projection transform. PARAMETERS:{number} width {number} height {number} zNear {number} zFar RETURNS:this perspective(fov, aspect, zNear, zFar) Sets this matrix to perspective projection transform. PARAMETERS:{number} fov field of view angle {number} aspect output surface width to height ratio {number} zNear {number} zFar RETURNS:this add(matrix) Adds a matrix to this matrix. mulScalar(scalar) Multiplies this matrix by a given scalar. mulMatrices(a, b) Multiplies two given matrices and sets the result to this. mul(value) Multiplies this matrix by a given matrix or a scalar. determinant() Calculates the determinant of this matrix. RETURNS:{number} transpose() Transposes this matrix. RETURNS:this invert() Inverts this matrix. equal(matrix) Checks for strict equality of this matrix and another matrix. |
CONSTANTS:PROPERTIES:METHODS: |