Vecmat 0.2.3
C math and linear algebra library for 2D/3D graphics, physics, and science.
Loading...
Searching...
No Matches
matrix4i_ptr.c File Reference
#include <vecmat.h>

Go to the source code of this file.

Functions

void mat4i_identity_ptr (matrix4i *res)
 Sets the given 4x4 integer matrix to the identity matrix.
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_mul_vec4i_ptr (vector4i *res, const matrix4i *m, const vector4i *v)
 Multiplies a 4x4 integer matrix by a vector4i.
void mat4i_mul_vec3i_ptr (vector3i *res, const matrix4i *m, const vector3i *v, const vm_int_t w)
 Transforms a vector3i by a 4x4 integer matrix using homogeneous w.

Function Documentation

◆ mat4i_identity_ptr()

void mat4i_identity_ptr ( matrix4i * res)

Sets the given 4x4 integer matrix to the identity matrix.

Parameters
resPointer to the matrix structure to set to identity.

Definition at line 12 of file matrix4i_ptr.c.

References matrix4i::v.

Referenced by mat4i_identity().

◆ mat4i_inverse_ptr()

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.

If the matrix is singular (determinant is zero), the result is set to the identity matrix.

Parameters
resPointer to the matrix structure to store the inverse matrix.
mPointer to the constant matrix to be inverted.

Definition at line 81 of file matrix4i_ptr.c.

References matrix4i::v.

Referenced by mat4i_inverse().

◆ mat4i_mul_ptr()

void mat4i_mul_ptr ( matrix4i * res,
const matrix4i * a,
const matrix4i * b )

Performs matrix multiplication of two 4x4 matrices and stores the result.

Parameters
resPointer to the matrix structure to store the result of the multiplication.
aPointer to the first matrix operand.
bPointer to the second matrix operand.

Definition at line 29 of file matrix4i_ptr.c.

References matrix4i::m11, matrix4i::m12, matrix4i::m13, matrix4i::m14, matrix4i::m21, matrix4i::m22, matrix4i::m23, matrix4i::m24, matrix4i::m31, matrix4i::m32, matrix4i::m33, matrix4i::m34, matrix4i::m41, matrix4i::m42, matrix4i::m43, and matrix4i::m44.

Referenced by mat4i_mul().

◆ mat4i_mul_vec3i_ptr()

void mat4i_mul_vec3i_ptr ( vector3i * res,
const matrix4i * m,
const vector3i * v,
const vm_int_t w )

Transforms a vector3i by a 4x4 integer matrix using homogeneous w.

Parameters
resOutput value.
mInput matrix.
vInput vector.
wHomogeneous w component.

Definition at line 149 of file matrix4i_ptr.c.

References matrix4i::m11, matrix4i::m12, matrix4i::m13, matrix4i::m14, matrix4i::m21, matrix4i::m22, matrix4i::m23, matrix4i::m24, matrix4i::m31, matrix4i::m32, matrix4i::m33, matrix4i::m34, vector3i::x, vector3i::y, and vector3i::z.

Referenced by mat4i_mul_vec3i().

◆ mat4i_mul_vec4i_ptr()

void mat4i_mul_vec4i_ptr ( vector4i * res,
const matrix4i * m,
const vector4i * v )

Multiplies a 4x4 integer matrix by a vector4i.

Parameters
resOutput value.
mInput matrix.
vInput vector.

Definition at line 129 of file matrix4i_ptr.c.

References matrix4i::m11, matrix4i::m12, matrix4i::m13, matrix4i::m14, matrix4i::m21, matrix4i::m22, matrix4i::m23, matrix4i::m24, matrix4i::m31, matrix4i::m32, matrix4i::m33, matrix4i::m34, matrix4i::m41, matrix4i::m42, matrix4i::m43, matrix4i::m44, vector4i::w, vector4i::x, vector4i::y, and vector4i::z.

Referenced by mat4i_mul_vec4i().

◆ mat4i_transpose_ptr()

void mat4i_transpose_ptr ( matrix4i * res,
const matrix4i * m )

Transposes the given 4x4 integer matrix and stores the result in the provided matrix structure.

Parameters
resPointer to the matrix structure to store the transposed matrix.
mPointer to the input matrix to be transposed.

Definition at line 61 of file matrix4i_ptr.c.

References matrix4i::v.

Referenced by mat4i_transpose().