=encoding UTF-8 =head1 NAME BH_Mat4f - real 4x4 matrix =head1 SYNTAX #include cc prog.c -o prog -lbh =head1 DESCRIPTION The BH_Mat4f module provides a set of functions for working with real 4x4 matrices. These functions allow you to perform various operations on matrices, such as addition, subtraction, multiplication, transposition, determinant calculation, and others. =head1 API CALLS =head2 BH_Mat4fIdentity void BH_Mat4fIdentity(float out[16]); Writes an identity matrix to I. =head2 BH_Mat4fAdd void BH_Mat4fAdd(const float a[16], const float b[16], float out[16]); Calculates the sum of two matrices I and I. The I parameter describes the resulting matrix. =head2 BH_Mat4fSub void BH_Mat4fSub(const float a[16], const float b[16], float out[16]); Calculates the difference between two matrices I and I. The I parameter describes the resulting matrix. =head2 BH_Mat4fMul void BH_Mat4fMul(const float a[16], const float b[16], float out[16]); Calculates the result of multiplying two matrices I and I. The I parameter describes the resulting matrix. =head2 BH_Mat4fScale void BH_Mat4fScale(const float a[16], float b, float out[16]); Calculates the result of multiplying matrix I by value I. The I parameter describes the resulting matrix. =head2 BH_Mat4fTranspose void BH_Mat4fTranspose(const float in[16], float out[16]); Transposes matrix I. The I parameter describes the resulting matrix. =head2 BH_Mat4fTrace float BH_Mat4fTrace(const float in[16]); Calculates the sum of the elements of the main diagonal of matrix I. =head2 BH_Mat4fDet float BH_Mat4fDet(const float in[16]); Calculates the determinant of matrix I. =head2 BH_Mat4fInverse int BH_Mat4fInverse(const float in[16], float out[16]); Calculates the inverse matrix for I. The I parameter describes the resulting matrix. If successful, the function returns 0, otherwise it returns an error code. =head2 BH_Mat4fFromScale void BH_Mat4fFromScale(float x, float y, float z, float out[16]); Calculates a scaling matrix with scales I, I, and I. The I parameter describes the resulting matrix. =head2 BH_Mat4fFromTranslation void BH_Mat4fFromTranslation(float x, float y, float z, float out[16]); Calculates a translation matrix with values I, I, and I. The I parameter describes the resulting matrix. =head2 BH_Mat4fFromRotationX void BH_Mat4fFromRotationX(float angle, float out[16]); Calculates a rotation matrix around the X axis with a given I. The I parameter describes the resulting matrix. =head2 BH_Mat4fFromRotationY void BH_Mat4fFromRotationY(float angle, float out[16]); Calculates a rotation matrix around the Y axis with a given I. The I parameter describes the resulting matrix. =head2 BH_Mat4fFromRotationZ void BH_Mat4fFromRotationZ(float angle, float out[16]); Calculates a rotation matrix around the Z axis with a given I. The I parameter describes the resulting matrix. =head2 BH_Mat4fFromAxis void BH_Mat4fFromAxis(const float axis[3], float angle, float out[16]); Calculates a rotation matrix around the axis I with a given I. The I parameter describes the resulting matrix. =head2 BH_Mat4fFromEuler void BH_Mat4fFromEuler(float roll, float pitch, float yaw, float out[16]); Calculates a rotation matrix from the angles of the associated coordinate system I, I, and I. The order of rotation application is ZYX (yaw, pitch, roll). The I parameter describes the resulting matrix. =head2 BH_Mat4fFromQuat4f void BH_Mat4fFromQuat4f(const float in[4], float out[16]); Calculates a rotation matrix from quaternion I. The I parameter describes the resulting matrix. =head2 BH_Mat4fFromOrtho void BH_Mat4fFromOrtho(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax, float out[16]); Calculates an orthographic projection matrix. The I and I parameters define the valid range of X coordinates. The I and I parameters define the valid range of Y coordinates. The I and I parameters define the valid range of Z coordinates. The I parameter describes the resulting matrix. =head2 BH_Mat4fFromFrustum void BH_Mat4fFromFrustum(float fov, float aspect, float zMin, float zMax, float out[16]); Calculates a perspective projection matrix. The I parameter defines the field of view. The I parameter defines the aspect ratio. The I and I parameters define the valid range of Z coordinates. The I parameter describes the resulting matrix. =head2 BH_Mat4fFromLookAt void BH_Mat4fFromLookAt(const float position[3], const float at[3], const float up[3], float out[16]); Calculates the camera view matrix. The I parameter defines the position of the camera in space. The I parameter defines the point where the camera is aimed. The I parameter defines the "up" direction of the camera. The I parameter describes the resulting matrix. =head2 BH_Mat4fApplyVec4f void BH_Mat4fApplyVec4f(const float a[16], const float b[4], float out[4]); Calculates the result of multiplying matrix I by vector I. The I parameter describes the resulting vector. =head2 BH_Mat4fApplyVec3f void BH_Mat4fApplyVec3f(const float a[16], const float b[3], float out[3]); Calculates the result of multiplying matrix I by vector I. The I parameter describes the resulting vector. =head1 SEE ALSO L