gl-matrix's mat4, in c, split into smaller pieces
npm install mat4.cPart of a fork of @toji's
gl-matrix in c, split into smaller pieces: this
package contains glMatrix.mat4.
__main.c__
``c
#include
#include
mat4 m4 = mat4_create();
`
gcc main.c -o main -Inode_modules/mat4.c/include
__CMakeLists.txt__
``
cmake_minimum_required(VERSION 3.2)
project (mat4-test)
file(GLOB CMAKE_INCLUDES "node_modules/*/CMakeLists.txt")
include(${CMAKE_INCLUDES})
add_executable(main main.c)
- mat4_adjoint()
- mat4_clone()
- mat4_copy()
- mat4_create()
- mat4_determinant()
- mat4_fromQuat()
- mat4_fromRotationTranslation()
- mat4_frustum()
- mat4_identity()
- mat4_invert()
- mat4_lookAt()
- mat4_multiply()
- mat4_ortho()
- mat4_perspective()
- mat4_perspectiveFromFieldOfView()
- mat4_rotate()
- mat4_rotateX()
- mat4_rotateY()
- mat4_rotateZ()
- mat4_scale()
- mat4_translate()
- mat4_transpose()
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 quaternion rotation and vector translation
This is equivalent to (but much faster than):
`c``
mat4_identity(dest);
mat4_translate(dest, vec);
mat4 quatMat = mat4_create();
quat4_toMat4(quat, quatMat);
mat4_multiply(dest, quatMat);
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
Translate a mat4 by the given vector
Transpose the values of a mat4
zlib. See LICENSE.md for details.