75 const vm_int_t cofactor_1 = m.
v[5] * m.
v[10] * m.
v[15] - m.
v[5] * m.
v[14] * m.
v[11] - m.
v[9] * m.
v[6] * m.
v[15] +
76 m.
v[9] * m.
v[14] * m.
v[7] + m.
v[13] * m.
v[6] * m.
v[11] - m.
v[13] * m.
v[10] * m.
v[7];
78 const vm_int_t cofactor_2 = -m.
v[4] * m.
v[10] * m.
v[15] + m.
v[4] * m.
v[14] * m.
v[11] + m.
v[8] * m.
v[6] * m.
v[15] -
79 m.
v[8] * m.
v[14] * m.
v[7] - m.
v[12] * m.
v[6] * m.
v[11] + m.
v[12] * m.
v[10] * m.
v[7];
81 const vm_int_t cofactor_3 = m.
v[4] * m.
v[9] * m.
v[15] - m.
v[4] * m.
v[13] * m.
v[11] - m.
v[8] * m.
v[5] * m.
v[15] +
82 m.
v[8] * m.
v[13] * m.
v[7] + m.
v[12] * m.
v[5] * m.
v[11] - m.
v[12] * m.
v[9] * m.
v[7];
84 const vm_int_t cofactor_4 = -m.
v[4] * m.
v[9] * m.
v[14] + m.
v[4] * m.
v[13] * m.
v[10] + m.
v[8] * m.
v[5] * m.
v[14] -
85 m.
v[8] * m.
v[13] * m.
v[6] - m.
v[12] * m.
v[5] * m.
v[10] + m.
v[12] * m.
v[9] * m.
v[6];
87 return m.
v[0] * cofactor_1 + m.
v[1] * cofactor_2 + m.
v[2] * cofactor_3 + m.
v[3] * cofactor_4;
matrix4i mat4i_transpose(const matrix4i m)
Computes the transpose of a 4x4 integer matrix.
matrix4i mat4i_identity(void)
Constructs the 4x4 identity matrix.
matrix4i mat4i_mul(const matrix4i a, const matrix4i b)
Multiplies two 4x4 integer matrices.
vector3i mat4i_mul_vec3i(const matrix4i m, const vector3i v, const vm_int_t w)
Transforms a vector3i by a 4x4 integer matrix using homogeneous w.
matrix4i mat4i_inverse(const matrix4i m)
Computes the inverse of a 4x4 integer matrix.
vm_int_t mat4i_determinant(const matrix4i m)
Computes the determinant of a 4x4 integer matrix (Laplace expansion along first row).
vector4i mat4i_mul_vec4i(const matrix4i m, const vector4i v)
Multiplies a 4x4 integer matrix by a vector4i.
vm_int_t v[VECMAT_MAT4_SIZE]
void mat4i_mul_vec3i_ptr(vector3i *res, const matrix4i *m, const vector3i *v, vm_int_t w)
Transforms a vector3i by a 4x4 integer matrix using homogeneous w.
void mat4i_mul_ptr(matrix4i *res, const matrix4i *a, const matrix4i *b)
Performs matrix multiplication of two 4x4 matrices and stores the result.
void mat4i_transpose_ptr(matrix4i *res, const matrix4i *m)
Transposes the given 4x4 integer matrix and stores the result in the provided matrix structure.
void mat4i_inverse_ptr(matrix4i *res, const matrix4i *m)
Computes the inverse of the given 4x4 integer matrix and stores the result in the specified matrix.
void mat4i_identity_ptr(matrix4i *res)
Sets the given 4x4 integer matrix to the identity matrix.
void mat4i_mul_vec4i_ptr(vector4i *res, const matrix4i *m, const vector4i *v)
Multiplies a 4x4 integer matrix by a vector4i.