Part of a fork of @toji's
gl-matrix split into smaller pieces: this
package contains glMatrix.mat4
.
Will load all of the module's functionality and expose it on a single object. Note that any of the methods may also be required directly from their files.
For example, the following are equivalent:
var scale = require('gl-mat4').scale
var scale = require('gl-mat4/scale')
- add()
- adjoint()
- clone()
- copy()
- create()
- determinant()
- fromQuat()
- fromRotation()
- fromRotationTranslation()
- fromScaling()
- fromTranslation()
- fromXRotation()
- fromYRotation()
- fromZRotation()
- frustum()
- identity()
- invert()
- lookAt()
- multiply()
- ortho()
- perspective()
- perspectiveFromFieldOfView()
- rotate()
- rotateX()
- rotateY()
- rotateZ()
- scale()
- str()
- sub()
- translate()
- transpose()
Adds two mat4's
Calculates the adjugate of a mat4
Creates a new mat4 initialized with values from an existing matrix
Copy the values from one mat4 to another
Creates a new identity mat4
Calculates the determinant of a mat4
Creates a matrix from a quaternion rotation.
Creates a matrix from a given angle around a given axis This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.rotate(dest, dest, rad, axis);
Creates a matrix from a quaternion rotation and vector translation. This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, vec);
var quatMat = mat4.create();
quat4.toMat4(quat, quatMat);
mat4.multiply(dest, quatMat);
Creates a matrix from a vector scaling. This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, dest, vec);
Creates a matrix from a vector translation. This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, dest, vec);
Creates a matrix from a vector translation This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, dest, vec);
Creates a matrix from the given angle around the X axis This is equivalent to (but much faster than):
mat4.identity(dest)
mat4.rotateX(dest, dest, rad)
Creates a matrix from the given angle around the Y axis This is equivalent to (but much faster than):
mat4.identity(dest)
mat4.rotateY(dest, dest, rad)
Creates a matrix from the given angle around the Z axis This is equivalent to (but much faster than):
mat4.identity(dest)
mat4.rotateZ(dest, dest, rad)
Generates a frustum matrix with the given bounds
Set a mat4 to the identity matrix
Inverts a mat4
Generates a look-at matrix with the given eye position, focal point, and up axis
Multiplies two mat4's
Generates a orthogonal projection matrix with the given bounds
Generates a perspective projection matrix with the given bounds
Generates a perspective projection matrix with the given field of view.
Rotates a mat4 by the given angle
Rotates a matrix by the given angle around the X axis
Rotates a matrix by the given angle around the Y axis
Rotates a matrix by the given angle around the Z axis
Scales the mat4 by the dimensions in the given vec3
Returns a string representation of a mat4
Subtracts two mat4's
Translate a mat4 by the given vector
Transpose the values of a mat4
zlib. See LICENSE.md for details.