Next: , Previous: , Up: C API   [Contents][Index]


5.32 libmat

5.32.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/mat/index.html.

5.32.2 API

Function: void lw6mat_dmat2_zero (lw6mat_dmat2_t * dmat2)

dmat2: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_dmat2_identity (lw6mat_dmat2_t * dmat2)

dmat2: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_dmat2_translation (lw6mat_dmat2_t * dmat2, double d)

dmat2: the matrix to initialize.

d: value which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_dmat2_scale (lw6mat_dmat2_t * dmat2, double d)

dmat2: the matrix to initialize.

d: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: int lw6mat_dmat2_is_same (const lw6mat_dmat2_t * dmat2_a, const lw6mat_dmat2_t * dmat2_b)

dmat2_a: 1st matrix to compare

dmat2_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_dmat2_transpose (lw6mat_dmat2_t * dmat2)

dmat2: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: double lw6mat_dmat2_det (const lw6mat_dmat2_t * dmat2)

dmat2: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_dmat2_mul_scale (lw6mat_dmat2_t * dmat2, double f)

dmat2: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_dmat2_inv (lw6sys_context_t * sys_context, lw6mat_dmat2_t * dmat2_dst, const lw6mat_dmat2_t * dmat2_src)

sys_context: global system context

dmat2_dst: the matrix inverted

dmat2_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_dmat2_mul_dmat2 (lw6mat_dmat2_t * dmat2, const lw6mat_dmat2_t * dmat2_a, const lw6mat_dmat2_t * dmat2_b)

dmat2: the result matrix

dmat2_a: the 1st matrix to multiply, on the left

dmat2_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_dmat2_mul_dvec2 (lw6mat_dvec2_t * dvec2_dst, const lw6mat_dmat2_t * dmat2, const lw6mat_dvec2_t * dvec2_src)

dvec2_dst: the result vector

dvec2_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: char * lw6mat_dmat2_repr (lw6sys_context_t * sys_context, const lw6mat_dmat2_t * dmat2)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_dmat3_zero (lw6mat_dmat3_t * dmat3)

dmat3: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_dmat3_identity (lw6mat_dmat3_t * dmat3)

dmat3: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_dmat3_translation (lw6mat_dmat3_t * dmat3, const lw6mat_dvec2_t * dvec2)

dmat3: the matrix to initialize.

dvec2: vector which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_dmat3_scale (lw6mat_dmat3_t * dmat3, const lw6mat_dvec2_t * dvec2)

dmat3: the matrix to initialize.

dvec2: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: void lw6mat_dmat3_rot (lw6mat_dmat3_t * dmat3, double r)

dmat3: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over a virtual Z axis such as Z is the cross product of X and Y.

Return value: none.

Function: int lw6mat_dmat3_is_same (const lw6mat_dmat3_t * dmat3_a, const lw6mat_dmat3_t * dmat3_b)

dmat3_a: 1st matrix to compare

dmat3_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_dmat3_transpose (lw6mat_dmat3_t * dmat3)

dmat3: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: double lw6mat_dmat3_det (const lw6mat_dmat3_t * dmat3)

dmat3: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_dmat3_mul_scale (lw6mat_dmat3_t * dmat3, double f)

dmat3: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_dmat3_inv (lw6sys_context_t * sys_context, lw6mat_dmat3_t * dmat3_dst, const lw6mat_dmat3_t * dmat3_src)

sys_context: global system context

dmat3_dst: the matrix inverted

dmat3_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_dmat3_mul_dmat3 (lw6mat_dmat3_t * dmat3, const lw6mat_dmat3_t * dmat3_a, const lw6mat_dmat3_t * dmat3_b)

dmat3: the result matrix

dmat3_a: the 1st matrix to multiply, on the left

dmat3_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_dmat3_mul_dvec3 (lw6mat_dvec3_t * dvec3_dst, const lw6mat_dmat3_t * dmat3, const lw6mat_dvec3_t * dvec3_src)

dvec3_dst: the result vector

dvec3_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: void lw6mat_dmat3_mul_dvec2 (lw6mat_dvec2_t * dvec2_dst, const lw6mat_dmat3_t * dmat3, const lw6mat_dvec2_t * dvec2_src)

dvec2_dst: the result vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.

Return value: none.

Function: char * lw6mat_dmat3_repr (lw6sys_context_t * sys_context, const lw6mat_dmat3_t * dmat3)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_dmat4_zero (lw6mat_dmat4_t * dmat4)

dmat4: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_dmat4_identity (lw6mat_dmat4_t * dmat4)

dmat4: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_dmat4_translation (lw6mat_dmat4_t * dmat4, const lw6mat_dvec3_t * dvec3)

dmat4: the matrix to initialize.

dvec3: vector which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_dmat4_scale (lw6mat_dmat4_t * dmat4, const lw6mat_dvec3_t * dvec3)

dmat4: the matrix to initialize.

dvec3: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: void lw6mat_dmat4_rot_x (lw6mat_dmat4_t * dmat4, double r)

dmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the X axis.

Return value: none.

Function: void lw6mat_dmat4_rot_y (lw6mat_dmat4_t * dmat4, double r)

dmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the Y axis.

Return value: none.

Function: void lw6mat_dmat4_rot_z (lw6mat_dmat4_t * dmat4, double r)

dmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the Z axis.

Return value: none.

Function: void lw6mat_dmat4_ortho (lw6mat_dmat4_t * dmat4, double left, double right, double bottom, double top, double nearval, double farval)

dmat4: the matrix to initialize.

left: left plane coordinate

right: right plane coordinate

bottom: bottom plane coordinate

top: top plane coordinate

nearval: near plane coordinate

farval: far plane coordinate

Loads the matrix with an orthogonal projection matrix. Does it the way glOrtho would, see https://www.opengl.org/sdk/docs/man2/xhtml/glOrtho.xml for details.

Note: use -nearVal and -farVal to initialize. It’s a little akward, if you expect to pass vectors with positions ranging from nearVal to farVal then you need to pass -nearVal and -farVal to this function. This is probably due to the fact that with a right-handed basis and X,Y set up "as usual", then Z is negative when going farther and farther. This tweak allows farVal to yield +1 and nearVal -1. We keep this function as is here, as this is the way OpenGL functions seem to work.

Return value: none.

Function: void lw6mat_dmat4_perspective (lw6mat_dmat4_t * dmat4, double fovy, double aspect, double znear, double zfar)

dmat4: the matrix to initialize.

fovy: vertical field of view (degrees, not radians)

aspect: x/y ratio

znear: near plane coordinate (use -znear to initialize)

zfar: far plane coordinate (use -zfar to initialize)

Loads the matrix with a projection matrix. Does it the way gluPerspective would, see https://www.opengl.org/sdk/docs/man2/xhtml/gluPerspective.xml for details.

Return value: none.

Function: int lw6mat_dmat4_is_same (const lw6mat_dmat4_t * dmat4_a, const lw6mat_dmat4_t * dmat4_b)

dmat4_a: 1st matrix to compare

dmat4_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_dmat4_transpose (lw6mat_dmat4_t * dmat4)

dmat4: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: double lw6mat_dmat4_det (const lw6mat_dmat4_t * dmat4)

dmat4: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_dmat4_mul_scale (lw6mat_dmat4_t * dmat4, double f)

dmat4: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_dmat4_inv (lw6sys_context_t * sys_context, lw6mat_dmat4_t * dmat4_dst, const lw6mat_dmat4_t * dmat4_src)

sys_context: global system context

dmat4_dst: the matrix inverted

dmat4_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_dmat4_mul_dmat4 (lw6mat_dmat4_t * dmat4, const lw6mat_dmat4_t * dmat4_a, const lw6mat_dmat4_t * dmat4_b)

dmat4: the result matrix

dmat4_a: the 1st matrix to multiply, on the left

dmat4_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_dmat4_mul_dvec4 (lw6mat_dvec4_t * dvec4_dst, const lw6mat_dmat4_t * dmat4, const lw6mat_dvec4_t * dvec4_src)

dvec4_dst: the result vector

dmat4: the matrix to use

dvec4_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: void lw6mat_dmat4_mul_dvec3 (lw6mat_dvec3_t * dvec3_dst, const lw6mat_dmat4_t * dmat4, const lw6mat_dvec3_t * dvec3_src)

dvec3_dst: the result vector

dmat4: the matrix to use

dvec3_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.

Return value: none.

Function: char * lw6mat_dmat4_repr (lw6sys_context_t * sys_context, const lw6mat_dmat4_t * dmat4)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_dvec2_zero (lw6mat_dvec2_t * dvec2)

dvec2: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_dvec2_is_same (const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dvec2_a: 1st vector to compare

dvec2_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: double lw6mat_dvec2_len_sq (const lw6mat_dvec2_t * dvec2)

dvec2: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: double lw6mat_dvec2_len (const lw6mat_dvec2_t * dvec2)

dvec2: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_dvec2_normalize (lw6sys_context_t * sys_context, lw6mat_dvec2_t * dvec2)

sys_context: global system context

dvec2: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_dvec2_homogeneous (lw6sys_context_t * sys_context, lw6mat_dvec2_t * dvec2)

sys_context: global system context

dvec2: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_dvec2_neg (lw6mat_dvec2_t * dvec2)

dvec2: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_dvec2_add (lw6mat_dvec2_t * dvec2, const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dvec2: result vector

dvec2_a: 1st vector to add

dvec2_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_dvec2_sub (lw6mat_dvec2_t * dvec2, const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dvec2: result vector

dvec2_a: 1st vector

dvec2_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: double lw6mat_dvec2_dot (const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dvec2_a: 1st vector

dvec2_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_dvec2_cross (lw6mat_dvec3_t * dvec3, const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dvec3: result vector

dvec2_a: 1st vector

dvec2_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 2D vectors as 3D vectors with z set t zero, that is, a vector in the xy plane.

Return value: none

Function: void lw6mat_dvec2_mul_scale (lw6mat_dvec2_t * dvec2, double f)

dvec2: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_dvec2_mul_dvec2 (lw6mat_dmat2_t * dmat2, const lw6mat_dvec2_t * dvec2_a, const lw6mat_dvec2_t * dvec2_b)

dmat2: result matrix

dvec2_a: 1st row vector

dvec2_b: 2nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_dvec2_repr (lw6sys_context_t * sys_context, const lw6mat_dvec2_t * dvec2)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: void lw6mat_dvec3_zero (lw6mat_dvec3_t * dvec3)

dvec3: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_dvec3_is_same (const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dvec3_a: 1st vector to compare

dvec3_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: double lw6mat_dvec3_len_sq (const lw6mat_dvec3_t * dvec3)

dvec3: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: double lw6mat_dvec3_len (const lw6mat_dvec3_t * dvec3)

dvec3: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_dvec3_normalize (lw6sys_context_t * sys_context, lw6mat_dvec3_t * dvec3)

sys_context: global system context

dvec3: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_dvec3_homogeneous (lw6sys_context_t * sys_context, lw6mat_dvec3_t * dvec3)

sys_context: global system context

dvec3: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_dvec3_neg (lw6mat_dvec3_t * dvec3)

dvec3: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_dvec3_add (lw6mat_dvec3_t * dvec3, const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dvec3: result vector

dvec3_a: 1st vector to add

dvec3_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_dvec3_sub (lw6mat_dvec3_t * dvec3, const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dvec3: result vector

dvec3_a: 1st vector

dvec3_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: double lw6mat_dvec3_dot (const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dvec3_a: 1st vector

dvec3_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_dvec3_cross (lw6mat_dvec3_t * dvec3, const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dvec3: result vector

dvec3_a: 1st vector

dvec3_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors.

Return value: none

Function: void lw6mat_dvec3_mul_scale (lw6mat_dvec3_t * dvec3, double f)

dvec3: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_dvec3_mul_dvec3 (lw6mat_dmat3_t * dmat3, const lw6mat_dvec3_t * dvec3_a, const lw6mat_dvec3_t * dvec3_b)

dmat3: result matrix

dvec3_a: 1st row vector

dvec3_b: 3nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_dvec3_repr (lw6sys_context_t * sys_context, const lw6mat_dvec3_t * dvec3)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: void lw6mat_dvec4_zero (lw6mat_dvec4_t * dvec4)

dvec4: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_dvec4_is_same (const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dvec4_a: 1st vector to compare

dvec4_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: double lw6mat_dvec4_len_sq (const lw6mat_dvec4_t * dvec4)

dvec4: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: double lw6mat_dvec4_len (const lw6mat_dvec4_t * dvec4)

dvec4: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_dvec4_normalize (lw6sys_context_t * sys_context, lw6mat_dvec4_t * dvec4)

sys_context: global system context

dvec4: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_dvec4_homogeneous (lw6sys_context_t * sys_context, lw6mat_dvec4_t * dvec4)

sys_context: global system context

dvec4: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_dvec4_neg (lw6mat_dvec4_t * dvec4)

dvec4: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_dvec4_add (lw6mat_dvec4_t * dvec4, const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dvec4: result vector

dvec4_a: 1st vector to add

dvec4_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_dvec4_sub (lw6mat_dvec4_t * dvec4, const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dvec4: result vector

dvec4_a: 1st vector

dvec4_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: double lw6mat_dvec4_dot (const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dvec4_a: 1st vector

dvec4_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_dvec4_cross (lw6mat_dvec3_t * dvec3, const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dvec3: result vector

dvec4_a: 1st vector

dvec4_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 4D vectors as 3D vectors only, ignoring the last value.

Return value: none

Function: void lw6mat_dvec4_mul_scale (lw6mat_dvec4_t * dvec4, double f)

dvec4: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_dvec4_mul_dvec4 (lw6mat_dmat4_t * dmat4, const lw6mat_dvec4_t * dvec4_a, const lw6mat_dvec4_t * dvec4_b)

dmat4: result matrix

dvec4_a: 1st row vector

dvec4_b: 4nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_dvec4_repr (lw6sys_context_t * sys_context, const lw6mat_dvec4_t * dvec4)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: void lw6mat_fmat2_zero (lw6mat_fmat2_t * fmat2)

fmat2: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_fmat2_identity (lw6mat_fmat2_t * fmat2)

fmat2: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_fmat2_translation (lw6mat_fmat2_t * fmat2, float f)

fmat2: the matrix to initialize.

f: value which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_fmat2_scale (lw6mat_fmat2_t * fmat2, float f)

fmat2: the matrix to initialize.

f: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: int lw6mat_fmat2_is_same (const lw6mat_fmat2_t * fmat2_a, const lw6mat_fmat2_t * fmat2_b)

fmat2_a: 1st matrix to compare

fmat2_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_fmat2_transpose (lw6mat_fmat2_t * fmat2)

fmat2: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: float lw6mat_fmat2_det (const lw6mat_fmat2_t * fmat2)

fmat2: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_fmat2_mul_scale (lw6mat_fmat2_t * fmat2, float f)

fmat2: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_fmat2_inv (lw6sys_context_t * sys_context, lw6mat_fmat2_t * fmat2_dst, const lw6mat_fmat2_t * fmat2_src)

sys_context: global system context

fmat2_dst: the matrix inverted

fmat2_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_fmat2_mul_fmat2 (lw6mat_fmat2_t * fmat2, const lw6mat_fmat2_t * fmat2_a, const lw6mat_fmat2_t * fmat2_b)

fmat2: the result matrix

fmat2_a: the 1st matrix to multiply, on the left

fmat2_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_fmat2_mul_fvec2 (lw6mat_fvec2_t * fvec2_dst, const lw6mat_fmat2_t * fmat2, const lw6mat_fvec2_t * fvec2_src)

fvec2_dst: the result vector

fvec2_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: char * lw6mat_fmat2_repr (lw6sys_context_t * sys_context, const lw6mat_fmat2_t * fmat2)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_fmat3_zero (lw6mat_fmat3_t * fmat3)

fmat3: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_fmat3_identity (lw6mat_fmat3_t * fmat3)

fmat3: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_fmat3_translation (lw6mat_fmat3_t * fmat3, const lw6mat_fvec2_t * fvec2)

fmat3: the matrix to initialize.

fvec2: vector which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_fmat3_scale (lw6mat_fmat3_t * fmat3, const lw6mat_fvec2_t * fvec2)

fmat3: the matrix to initialize.

fvec2: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: void lw6mat_fmat3_rot (lw6mat_fmat3_t * fmat3, float r)

fmat3: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over a virtual Z axis such as Z is the cross product of X and Y.

Return value: none.

Function: int lw6mat_fmat3_is_same (const lw6mat_fmat3_t * fmat3_a, const lw6mat_fmat3_t * fmat3_b)

fmat3_a: 1st matrix to compare

fmat3_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_fmat3_transpose (lw6mat_fmat3_t * fmat3)

fmat3: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: float lw6mat_fmat3_det (const lw6mat_fmat3_t * fmat3)

fmat3: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_fmat3_mul_scale (lw6mat_fmat3_t * fmat3, float f)

fmat3: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_fmat3_inv (lw6sys_context_t * sys_context, lw6mat_fmat3_t * fmat3_dst, const lw6mat_fmat3_t * fmat3_src)

sys_context: global system context

fmat3_dst: the matrix inverted

fmat3_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_fmat3_mul_fmat3 (lw6mat_fmat3_t * fmat3, const lw6mat_fmat3_t * fmat3_a, const lw6mat_fmat3_t * fmat3_b)

fmat3: the result matrix

fmat3_a: the 1st matrix to multiply, on the left

fmat3_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_fmat3_mul_fvec3 (lw6mat_fvec3_t * fvec3_dst, const lw6mat_fmat3_t * fmat3, const lw6mat_fvec3_t * fvec3_src)

fvec3_dst: the result vector

fvec3_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: void lw6mat_fmat3_mul_fvec2 (lw6mat_fvec2_t * fvec2_dst, const lw6mat_fmat3_t * fmat3, const lw6mat_fvec2_t * fvec2_src)

fvec2_dst: the result vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.

Return value: none.

Function: char * lw6mat_fmat3_repr (lw6sys_context_t * sys_context, const lw6mat_fmat3_t * fmat3)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_fmat4_zero (lw6mat_fmat4_t * fmat4)

fmat4: the matrix to initialize.

Fills the matrix with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: void lw6mat_fmat4_identity (lw6mat_fmat4_t * fmat4)

fmat4: the matrix to initialize.

Loads the matrix with the identity matrix, that is, zero everywhere but one on the main diag.

Return value: none.

Function: void lw6mat_fmat4_translation (lw6mat_fmat4_t * fmat4, const lw6mat_fvec3_t * fvec3)

fmat4: the matrix to initialize.

fvec3: vector which defines the translation.

Loads the matrix with a translation transformation matrix. By multiplicating by this matrix, a translation is done.

Return value: none.

Function: void lw6mat_fmat4_scale (lw6mat_fmat4_t * fmat4, const lw6mat_fvec3_t * fvec3)

fmat4: the matrix to initialize.

fvec3: value used to scale matrix.

Loads the matrix with a scale matrix. By multiplicating by this matrix, a scaling is done.

Return value: none.

Function: void lw6mat_fmat4_rot_x (lw6mat_fmat4_t * fmat4, float r)

fmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the X axis.

Return value: none.

Function: void lw6mat_fmat4_rot_y (lw6mat_fmat4_t * fmat4, float r)

fmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the Y axis.

Return value: none.

Function: void lw6mat_fmat4_rot_z (lw6mat_fmat4_t * fmat4, float r)

fmat4: the matrix to initialize.

r: value used to for the rotation, angle in radians.

Loads the matrix with a rotation matrix. By multiplicating by this matrix, a rotation is done, over the Z axis.

Return value: none.

Function: void lw6mat_fmat4_ortho (lw6mat_fmat4_t * fmat4, float left, float right, float bottom, float top, float nearval, float farval)

fmat4: the matrix to initialize.

left: left plane coordinate

right: right plane coordinate

bottom: bottom plane coordinate

top: top plane coordinate

nearval: near plane coordinate

farval: far plane coordinate

Loads the matrix with an orthogonal projection matrix. Does it the way glOrtho would, see https://www.opengl.org/sdk/docs/man2/xhtml/glOrtho.xml for details.

Note: use -nearVal and -farVal to initialize. It’s a little akward, if you expect to pass vectors with positions ranging from nearVal to farVal then you need to pass -nearVal and -farVal to this function. This is probably due to the fact that with a right-handed basis and X,Y set up "as usual", then Z is negative when going farther and farther. This tweak allows farVal to yield +1 and nearVal -1. We keep this function as is here, as this is the way OpenGL functions seem to work.

Return value: none.

Function: void lw6mat_fmat4_perspective (lw6mat_fmat4_t * fmat4, float fovy, float aspect, float znear, float zfar)

fmat4: the matrix to initialize.

fovy: vertical field of view (degrees, not radians)

aspect: x/y ratio

znear: near plane coordinate (use -znear to initialize)

zfar: far plane coordinate (use -zfar to initialize)

Loads the matrix with a projection matrix. Does it the way gluPerspective would, see https://www.opengl.org/sdk/docs/man2/xhtml/gluPerspective.xml for details.

Return value: none.

Function: int lw6mat_fmat4_is_same (const lw6mat_fmat4_t * fmat4_a, const lw6mat_fmat4_t * fmat4_b)

fmat4_a: 1st matrix to compare

fmat4_b: 2nd matrix to compare

Compares two matrix, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: void lw6mat_fmat4_transpose (lw6mat_fmat4_t * fmat4)

fmat4: the matrix to transpose

Transposes the matrix, that is, inverts rows and columns.

Return value: none.

Function: float lw6mat_fmat4_det (const lw6mat_fmat4_t * fmat4)

fmat4: the matrix used to calculate the determinant

Calulates the determinant of the matrix.

Return value: the determinant.

Function: void lw6mat_fmat4_mul_scale (lw6mat_fmat4_t * fmat4, float f)

fmat4: matrix to modify

f: scale factor

Scales the matrix by multiplying all its members by a scalar value.

Return value: none

Function: int lw6mat_fmat4_inv (lw6sys_context_t * sys_context, lw6mat_fmat4_t * fmat4_dst, const lw6mat_fmat4_t * fmat4_src)

sys_context: global system context

fmat4_dst: the matrix inverted

fmat4_src: the matrix to invert

Inverts a matrix. Probably not the fastest implementation, but should work in all cases. Use hardware accelerated API such as OpenGL on dedicated hardware if you want power.

Return value: 1 if inverted, 0 if error, typically if determinant was 0, matrix can not be inverted.

Function: void lw6mat_fmat4_mul_fmat4 (lw6mat_fmat4_t * fmat4, const lw6mat_fmat4_t * fmat4_a, const lw6mat_fmat4_t * fmat4_b)

fmat4: the result matrix

fmat4_a: the 1st matrix to multiply, on the left

fmat4_b: the 2nd matrix to multiply, on the right

Classic matrix multiplication.

Return value: none.

Function: void lw6mat_fmat4_mul_fvec4 (lw6mat_fvec4_t * fvec4_dst, const lw6mat_fmat4_t * fmat4, const lw6mat_fvec4_t * fvec4_src)

fvec4_dst: the result vector

fmat4: the matrix to use

fvec4_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish.

Return value: none.

Function: void lw6mat_fmat4_mul_fvec3 (lw6mat_fvec3_t * fvec3_dst, const lw6mat_fmat4_t * fmat4, const lw6mat_fvec3_t * fvec3_src)

fvec3_dst: the result vector

fmat4: the matrix to use

fvec3_src: the source vector

Multiplication of matrix by vector. The result is a vector, the convention used is that of OpenGL, matrix are column major and vector are columns, that is, should you do it on a paper, vector is placed vertically, on the right of matrix. The other multiplication is not implemented, transposing the matrix will do it the other way if you wish. The vector, here, is smaller than the matrix, the last element is supposed to be 1, this is how one implements translation through multiplication.

Return value: none.

Function: char * lw6mat_fmat4_repr (lw6sys_context_t * sys_context, const lw6mat_fmat4_t * fmat4)

sys_context: global system context

Gives a readable version of the matrix, the representation uses newlines, with a different line for each row

Return value: newly allocated string

Function: void lw6mat_fvec2_zero (lw6mat_fvec2_t * fvec2)

fvec2: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_fvec2_is_same (const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fvec2_a: 1st vector to compare

fvec2_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: float lw6mat_fvec2_len_sq (const lw6mat_fvec2_t * fvec2)

fvec2: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: float lw6mat_fvec2_len (const lw6mat_fvec2_t * fvec2)

fvec2: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_fvec2_normalize (lw6sys_context_t * sys_context, lw6mat_fvec2_t * fvec2)

sys_context: global system context

fvec2: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_fvec2_homogeneous (lw6sys_context_t * sys_context, lw6mat_fvec2_t * fvec2)

sys_context: global system context

fvec2: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_fvec2_neg (lw6mat_fvec2_t * fvec2)

fvec2: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_fvec2_add (lw6mat_fvec2_t * fvec2, const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fvec2: result vector

fvec2_a: 1st vector to add

fvec2_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_fvec2_sub (lw6mat_fvec2_t * fvec2, const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fvec2: result vector

fvec2_a: 1st vector

fvec2_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: float lw6mat_fvec2_dot (const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fvec2_a: 1st vector

fvec2_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_fvec2_cross (lw6mat_fvec3_t * fvec3, const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fvec3: result vector

fvec2_a: 1st vector

fvec2_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 2D vectors as 3D vectors with z set t zero, that is, a vector in the xy plane.

Return value: none

Function: void lw6mat_fvec2_mul_scale (lw6mat_fvec2_t * fvec2, float f)

fvec2: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_fvec2_mul_fvec2 (lw6mat_fmat2_t * fmat2, const lw6mat_fvec2_t * fvec2_a, const lw6mat_fvec2_t * fvec2_b)

fmat2: result matrix

fvec2_a: 1st row vector

fvec2_b: 2nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_fvec2_repr (lw6sys_context_t * sys_context, const lw6mat_fvec2_t * fvec2)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: void lw6mat_fvec3_zero (lw6mat_fvec3_t * fvec3)

fvec3: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_fvec3_is_same (const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fvec3_a: 1st vector to compare

fvec3_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: float lw6mat_fvec3_len_sq (const lw6mat_fvec3_t * fvec3)

fvec3: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: float lw6mat_fvec3_len (const lw6mat_fvec3_t * fvec3)

fvec3: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_fvec3_normalize (lw6sys_context_t * sys_context, lw6mat_fvec3_t * fvec3)

sys_context: global system context

fvec3: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_fvec3_homogeneous (lw6sys_context_t * sys_context, lw6mat_fvec3_t * fvec3)

sys_context: global system context

fvec3: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_fvec3_neg (lw6mat_fvec3_t * fvec3)

fvec3: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_fvec3_add (lw6mat_fvec3_t * fvec3, const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fvec3: result vector

fvec3_a: 1st vector to add

fvec3_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_fvec3_sub (lw6mat_fvec3_t * fvec3, const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fvec3: result vector

fvec3_a: 1st vector

fvec3_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: float lw6mat_fvec3_dot (const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fvec3_a: 1st vector

fvec3_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_fvec3_cross (lw6mat_fvec3_t * fvec3, const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fvec3: result vector

fvec3_a: 1st vector

fvec3_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors.

Return value: none

Function: void lw6mat_fvec3_mul_scale (lw6mat_fvec3_t * fvec3, float f)

fvec3: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_fvec3_mul_fvec3 (lw6mat_fmat3_t * fmat3, const lw6mat_fvec3_t * fvec3_a, const lw6mat_fvec3_t * fvec3_b)

fmat3: result matrix

fvec3_a: 1st row vector

fvec3_b: 3nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_fvec3_repr (lw6sys_context_t * sys_context, const lw6mat_fvec3_t * fvec3)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: void lw6mat_fvec4_zero (lw6mat_fvec4_t * fvec4)

fvec4: the vector to initialize.

Fills the vector with zeros, regardless of what was there before. Internally, does a memset the only advantage is that this function should use the right sizeof and therefore avoids typo errors.

Return value: none.

Function: int lw6mat_fvec4_is_same (const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fvec4_a: 1st vector to compare

fvec4_b: 2nd vector to compare

Compares two vectors, returns true if they are equal.

Return value: 1 if equal, 0 if different.

Function: float lw6mat_fvec4_len_sq (const lw6mat_fvec4_t * fvec4)

fvec4: the vector to query.

Returns the square of a vector length. To get the real length one should then apply a square root but at this stage one has at least an idea about vector length, and this information is enough to compare them.

Return value: sigma(coord*coord)

Function: float lw6mat_fvec4_len (const lw6mat_fvec4_t * fvec4)

fvec4: the vector to query.

Returns the size/length of a vector, this is the distance of the point from origin, not the number of elements.

Return value: the length of the vector.

Function: int lw6mat_fvec4_normalize (lw6sys_context_t * sys_context, lw6mat_fvec4_t * fvec4)

sys_context: global system context

fvec4: the vector to normalize.

Normalizes a vector, that is, make its length be 1.

Return value: 1 if OK, 0 if error, such as trying to normalize vector zero.

Function: int lw6mat_fvec4_homogeneous (lw6sys_context_t * sys_context, lw6mat_fvec4_t * fvec4)

sys_context: global system context

fvec4: the vector to homogeneous.

Transforms a vector into homegeneous coords, that is, scales it so that its last member is 1.

Return value: 1 if OK, 0 if error, such as trying to operate on vector zero.

Function: void lw6mat_fvec4_neg (lw6mat_fvec4_t * fvec4)

fvec4: vector to modify

Calcs the opposite vector, by making a negation on all its members

Return value: none

Function: void lw6mat_fvec4_add (lw6mat_fvec4_t * fvec4, const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fvec4: result vector

fvec4_a: 1st vector to add

fvec4_b: 2nd vector to add

Adds two vectors.

Return value: none

Function: void lw6mat_fvec4_sub (lw6mat_fvec4_t * fvec4, const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fvec4: result vector

fvec4_a: 1st vector

fvec4_b: 2nd vector, will be substracted to 1st vector

Substracts vector b from vector a.

Return value: none

Function: float lw6mat_fvec4_dot (const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fvec4_a: 1st vector

fvec4_b: 2nd vector

Calculates the dot AKA scalar product of the two vectors.

Return value: none

Function: void lw6mat_fvec4_cross (lw6mat_fvec3_t * fvec3, const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fvec3: result vector

fvec4_a: 1st vector

fvec4_b: 2nd vector

Calculates the cross AKA vectorial product of the two vectors. Since cross product only really makes sense in 3D, this function will interpret the 4D vectors as 3D vectors only, ignoring the last value.

Return value: none

Function: void lw6mat_fvec4_mul_scale (lw6mat_fvec4_t * fvec4, float f)

fvec4: vector to modify

f: scale factor

Scales the vector by multiplying all its members by a scalar value.

Return value: none

Function: void lw6mat_fvec4_mul_fvec4 (lw6mat_fmat4_t * fmat4, const lw6mat_fvec4_t * fvec4_a, const lw6mat_fvec4_t * fvec4_b)

fmat4: result matrix

fvec4_a: 1st row vector

fvec4_b: 4nd column vector

Multiplication of a row vector by a column vector to give a matrix.

Return value: none

Function: char * lw6mat_fvec4_repr (lw6sys_context_t * sys_context, const lw6mat_fvec4_t * fvec4)

sys_context: global system context

Gives a readable version of the vector

Return value: newly allocated string

Function: int lw6mat_is_similar_f (float f_a, float f_b)

f_a: 1st value to compare

f_b: 2nd value to compare

Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.

Return value: 1 if similar, 0 if not.

Function: int lw6mat_is_similar_i (int32_t i_a, int32_t i_b)

i_a: 1st value to compare

i_b: 2nd value to compare

Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.

Return value: 1 if similar, 0 if not.

Function: int lw6mat_is_similar_d (double d_a, double d_b)

d_a: 1st value to compare

d_b: 2nd value to compare

Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.

Return value: 1 if similar, 0 if not.

Function: int lw6mat_is_similar_x (int32_t x_a, int32_t x_b)

x_a: 1st value to compare

x_b: 2nd value to compare

Compares two value, and returns true if they look the same. This similarity is based on a percentage of difference for big enough values, and for very small values, they are just considered equal whatever happens. This is far from perfect but the purpose is usually just to track blunders in matrix code.

Return value: 1 if similar, 0 if not.

Function: int lw6mat_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libmat module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6mat_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the mat module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.

Struct: lw6mat_dmat2_t

Double 2x2 matrix (AKA 2D rectangle).

Member of lw6mat_dmat2_t: m

Type: double

Definition: double lw6mat_dmat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_dmat2_t: v

Type: double

Definition: double lw6mat_dmat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*2+j.

Struct: lw6mat_dmat3_t

Double 3x3 matrix (AKA 3D triangle).

Member of lw6mat_dmat3_t: m

Type: double

Definition: double lw6mat_dmat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_dmat3_t: v

Type: double

Definition: double lw6mat_dmat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*3+j.

Struct: lw6mat_dmat4_t

Double 4x4 matrix (AKA 3D transformation/composition matrix).

Member of lw6mat_dmat4_t: m

Type: double

Definition: double lw6mat_dmat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_dmat4_t: v

Type: double

Definition: double lw6mat_dmat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*4+j.

Struct: lw6mat_dvec2_t

Double vector with 2 elements (AKA 2D point).

Member of lw6mat_dvec2_t: x

Type: double

Definition: double lw6mat_dvec2_t::x

Member of lw6mat_dvec2_t: y

Type: double

Definition: double lw6mat_dvec2_t::y

Member of lw6mat_dvec2_t: p

Type: struct lw6mat_dvec2_t::16

Definition: struct lw6mat_dvec2_t::16 lw6mat_dvec2_t::p

Accessor with named/point coords.

Member of lw6mat_dvec2_t: s

Type: double

Definition: double lw6mat_dvec2_t::s

Member of lw6mat_dvec2_t: t

Type: double

Definition: double lw6mat_dvec2_t::t

Member of lw6mat_dvec2_t: t

Type: struct lw6mat_dvec2_t::17

Definition: struct lw6mat_dvec2_t::17 lw6mat_dvec2_t::t

Accessor with texture-like name.

Member of lw6mat_dvec2_t: v

Type: double

Definition: double lw6mat_dvec2_t::v[LW6MAT_VEC2_V_SIZE]

Accessor with array index.

Struct: lw6mat_dvec3_t

Double vector with 3 elements (AKA 3D point).

Member of lw6mat_dvec3_t: x

Type: double

Definition: double lw6mat_dvec3_t::x

Member of lw6mat_dvec3_t: y

Type: double

Definition: double lw6mat_dvec3_t::y

Member of lw6mat_dvec3_t: z

Type: double

Definition: double lw6mat_dvec3_t::z

Member of lw6mat_dvec3_t: p

Type: struct lw6mat_dvec3_t::18

Definition: struct lw6mat_dvec3_t::18 lw6mat_dvec3_t::p

Accessor with named/point coords.

Member of lw6mat_dvec3_t: r

Type: double

Definition: double lw6mat_dvec3_t::r

Member of lw6mat_dvec3_t: g

Type: double

Definition: double lw6mat_dvec3_t::g

Member of lw6mat_dvec3_t: b

Type: double

Definition: double lw6mat_dvec3_t::b

Member of lw6mat_dvec3_t: c

Type: struct lw6mat_dvec3_t::19

Definition: struct lw6mat_dvec3_t::19 lw6mat_dvec3_t::c

Accessor with color-like name.

Member of lw6mat_dvec3_t: s

Type: double

Definition: double lw6mat_dvec3_t::s

Member of lw6mat_dvec3_t: t

Type: double

Definition: double lw6mat_dvec3_t::t

Member of lw6mat_dvec3_t: p

Type: double

Definition: double lw6mat_dvec3_t::p

Member of lw6mat_dvec3_t: t

Type: struct lw6mat_dvec3_t::20

Definition: struct lw6mat_dvec3_t::20 lw6mat_dvec3_t::t

Accessor with texture-like name.

Member of lw6mat_dvec3_t: v

Type: double

Definition: double lw6mat_dvec3_t::v[LW6MAT_VEC3_V_SIZE]

Accessor with array index.

Member of lw6mat_dvec3_t: v2

Type: lw6mat_dvec2_t

Definition: lw6mat_dvec2_t lw6mat_dvec3_t::v2

Accessor with smaller-sized vector, only 2 dimensions.

Struct: lw6mat_dvec4_t

Double vector with 4 elements (AKA quaternion).

Member of lw6mat_dvec4_t: x

Type: double

Definition: double lw6mat_dvec4_t::x

Member of lw6mat_dvec4_t: y

Type: double

Definition: double lw6mat_dvec4_t::y

Member of lw6mat_dvec4_t: z

Type: double

Definition: double lw6mat_dvec4_t::z

Member of lw6mat_dvec4_t: w

Type: double

Definition: double lw6mat_dvec4_t::w

Member of lw6mat_dvec4_t: p

Type: struct lw6mat_dvec4_t::21

Definition: struct lw6mat_dvec4_t::21 lw6mat_dvec4_t::p

Accessor with named/point coords.

Member of lw6mat_dvec4_t: r

Type: double

Definition: double lw6mat_dvec4_t::r

Member of lw6mat_dvec4_t: g

Type: double

Definition: double lw6mat_dvec4_t::g

Member of lw6mat_dvec4_t: b

Type: double

Definition: double lw6mat_dvec4_t::b

Member of lw6mat_dvec4_t: a

Type: double

Definition: double lw6mat_dvec4_t::a

Member of lw6mat_dvec4_t: c

Type: struct lw6mat_dvec4_t::22

Definition: struct lw6mat_dvec4_t::22 lw6mat_dvec4_t::c

Accessor with color-like name.

Member of lw6mat_dvec4_t: s

Type: double

Definition: double lw6mat_dvec4_t::s

Member of lw6mat_dvec4_t: t

Type: double

Definition: double lw6mat_dvec4_t::t

Member of lw6mat_dvec4_t: p

Type: double

Definition: double lw6mat_dvec4_t::p

Member of lw6mat_dvec4_t: q

Type: double

Definition: double lw6mat_dvec4_t::q

Member of lw6mat_dvec4_t: t

Type: struct lw6mat_dvec4_t::23

Definition: struct lw6mat_dvec4_t::23 lw6mat_dvec4_t::t

Accessor with texture-like name.

Member of lw6mat_dvec4_t: v

Type: double

Definition: double lw6mat_dvec4_t::v[LW6MAT_VEC4_V_SIZE]

Accessor with array index.

Member of lw6mat_dvec4_t: v2

Type: lw6mat_dvec2_t

Definition: lw6mat_dvec2_t lw6mat_dvec4_t::v2

Accessor with smaller-sized vector, only 2 dimensions.

Member of lw6mat_dvec4_t: v3

Type: lw6mat_dvec3_t

Definition: lw6mat_dvec3_t lw6mat_dvec4_t::v3

Accessor with smaller-sized vector, only 3 dimensions.

Struct: lw6mat_fmat2_t

Float 2x2 matrix (AKA 2D rectangle).

Member of lw6mat_fmat2_t: m

Type: float

Definition: float lw6mat_fmat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_fmat2_t: v

Type: float

Definition: float lw6mat_fmat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*4+j.

Struct: lw6mat_fmat3_t

Float 3x3 matrix (AKA 3D triangle).

Member of lw6mat_fmat3_t: m

Type: float

Definition: float lw6mat_fmat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_fmat3_t: v

Type: float

Definition: float lw6mat_fmat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*3+j.

Struct: lw6mat_fmat4_t

Float 4x4 matrix (AKA 3D transformation/composition matrix).

Member of lw6mat_fmat4_t: m

Type: float

Definition: float lw6mat_fmat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_fmat4_t: v

Type: float

Definition: float lw6mat_fmat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*4+j.

Struct: lw6mat_fvec2_t

Float vector with 2 elements (AKA 2D point).

Member of lw6mat_fvec2_t: x

Type: float

Definition: float lw6mat_fvec2_t::x

Member of lw6mat_fvec2_t: y

Type: float

Definition: float lw6mat_fvec2_t::y

Member of lw6mat_fvec2_t: p

Type: struct lw6mat_fvec2_t::0

Definition: struct lw6mat_fvec2_t::0 lw6mat_fvec2_t::p

Accessor with named/point coords.

Member of lw6mat_fvec2_t: s

Type: float

Definition: float lw6mat_fvec2_t::s

Member of lw6mat_fvec2_t: t

Type: float

Definition: float lw6mat_fvec2_t::t

Member of lw6mat_fvec2_t: t

Type: struct lw6mat_fvec2_t::1

Definition: struct lw6mat_fvec2_t::1 lw6mat_fvec2_t::t

Accessor with texture-like name.

Member of lw6mat_fvec2_t: v

Type: float

Definition: float lw6mat_fvec2_t::v[LW6MAT_VEC2_V_SIZE]

Accessor with array index.

Struct: lw6mat_fvec3_t

Float vector with 3 elements (AKA 3D point).

Member of lw6mat_fvec3_t: x

Type: float

Definition: float lw6mat_fvec3_t::x

Member of lw6mat_fvec3_t: y

Type: float

Definition: float lw6mat_fvec3_t::y

Member of lw6mat_fvec3_t: z

Type: float

Definition: float lw6mat_fvec3_t::z

Member of lw6mat_fvec3_t: p

Type: struct lw6mat_fvec3_t::2

Definition: struct lw6mat_fvec3_t::2 lw6mat_fvec3_t::p

Accessor with named/point coords.

Member of lw6mat_fvec3_t: r

Type: float

Definition: float lw6mat_fvec3_t::r

Member of lw6mat_fvec3_t: g

Type: float

Definition: float lw6mat_fvec3_t::g

Member of lw6mat_fvec3_t: b

Type: float

Definition: float lw6mat_fvec3_t::b

Member of lw6mat_fvec3_t: c

Type: struct lw6mat_fvec3_t::3

Definition: struct lw6mat_fvec3_t::3 lw6mat_fvec3_t::c

Accessor with color-like name.

Member of lw6mat_fvec3_t: s

Type: float

Definition: float lw6mat_fvec3_t::s

Member of lw6mat_fvec3_t: t

Type: float

Definition: float lw6mat_fvec3_t::t

Member of lw6mat_fvec3_t: p

Type: float

Definition: float lw6mat_fvec3_t::p

Member of lw6mat_fvec3_t: t

Type: struct lw6mat_fvec3_t::4

Definition: struct lw6mat_fvec3_t::4 lw6mat_fvec3_t::t

Accessor with texture-like name.

Member of lw6mat_fvec3_t: v

Type: float

Definition: float lw6mat_fvec3_t::v[LW6MAT_VEC3_V_SIZE]

Accessor with array index.

Member of lw6mat_fvec3_t: v2

Type: lw6mat_fvec2_t

Definition: lw6mat_fvec2_t lw6mat_fvec3_t::v2

Accessor with smaller-sized vector, only 2 dimensions.

Struct: lw6mat_fvec4_t

Float vector with 4 elements (AKA quaternion).

Member of lw6mat_fvec4_t: x

Type: float

Definition: float lw6mat_fvec4_t::x

Member of lw6mat_fvec4_t: y

Type: float

Definition: float lw6mat_fvec4_t::y

Member of lw6mat_fvec4_t: z

Type: float

Definition: float lw6mat_fvec4_t::z

Member of lw6mat_fvec4_t: w

Type: float

Definition: float lw6mat_fvec4_t::w

Member of lw6mat_fvec4_t: p

Type: struct lw6mat_fvec4_t::5

Definition: struct lw6mat_fvec4_t::5 lw6mat_fvec4_t::p

Accessor with named/point coords.

Member of lw6mat_fvec4_t: r

Type: float

Definition: float lw6mat_fvec4_t::r

Member of lw6mat_fvec4_t: g

Type: float

Definition: float lw6mat_fvec4_t::g

Member of lw6mat_fvec4_t: b

Type: float

Definition: float lw6mat_fvec4_t::b

Member of lw6mat_fvec4_t: a

Type: float

Definition: float lw6mat_fvec4_t::a

Member of lw6mat_fvec4_t: c

Type: struct lw6mat_fvec4_t::6

Definition: struct lw6mat_fvec4_t::6 lw6mat_fvec4_t::c

Accessor with color-like name.

Member of lw6mat_fvec4_t: s

Type: float

Definition: float lw6mat_fvec4_t::s

Member of lw6mat_fvec4_t: t

Type: float

Definition: float lw6mat_fvec4_t::t

Member of lw6mat_fvec4_t: p

Type: float

Definition: float lw6mat_fvec4_t::p

Member of lw6mat_fvec4_t: q

Type: float

Definition: float lw6mat_fvec4_t::q

Member of lw6mat_fvec4_t: t

Type: struct lw6mat_fvec4_t::7

Definition: struct lw6mat_fvec4_t::7 lw6mat_fvec4_t::t

Accessor with texture-like name.

Member of lw6mat_fvec4_t: v

Type: float

Definition: float lw6mat_fvec4_t::v[LW6MAT_VEC4_V_SIZE]

Accessor with array index.

Member of lw6mat_fvec4_t: v2

Type: lw6mat_fvec2_t

Definition: lw6mat_fvec2_t lw6mat_fvec4_t::v2

Accessor with smaller-sized vector, only 2 dimensions.

Member of lw6mat_fvec4_t: v3

Type: lw6mat_fvec3_t

Definition: lw6mat_fvec3_t lw6mat_fvec4_t::v3

Accessor with smaller-sized vector, only 3 dimensions.

Struct: lw6mat_imat2_t

Integer 2x2 matrix (AKA 2D rectangle).

Member of lw6mat_imat2_t: m

Type: int32_t

Definition: int32_t lw6mat_imat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_imat2_t: v

Type: int32_t

Definition: int32_t lw6mat_imat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*2+j.

Struct: lw6mat_imat3_t

Integer 3x3 matrix (AKA 3D triangle).

Member of lw6mat_imat3_t: m

Type: int32_t

Definition: int32_t lw6mat_imat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_imat3_t: v

Type: int32_t

Definition: int32_t lw6mat_imat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*3+j.

Struct: lw6mat_imat4_t

Integer 4x4 matrix (AKA 3D transformation/composition matrix).

Member of lw6mat_imat4_t: m

Type: int32_t

Definition: int32_t lw6mat_imat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_imat4_t: v

Type: int32_t

Definition: int32_t lw6mat_imat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*4+j.

Struct: lw6mat_ivec2_t

Integer vector with 2 elements (AKA 2D point).

Member of lw6mat_ivec2_t: x

Type: int32_t

Definition: int32_t lw6mat_ivec2_t::x

Member of lw6mat_ivec2_t: y

Type: int32_t

Definition: int32_t lw6mat_ivec2_t::y

Member of lw6mat_ivec2_t: p

Type: struct lw6mat_ivec2_t::8

Definition: struct lw6mat_ivec2_t::8 lw6mat_ivec2_t::p

Accessor with named/point coords.

Member of lw6mat_ivec2_t: s

Type: int32_t

Definition: int32_t lw6mat_ivec2_t::s

Member of lw6mat_ivec2_t: t

Type: int32_t

Definition: int32_t lw6mat_ivec2_t::t

Member of lw6mat_ivec2_t: t

Type: struct lw6mat_ivec2_t::9

Definition: struct lw6mat_ivec2_t::9 lw6mat_ivec2_t::t

Accessor with texture-like name.

Member of lw6mat_ivec2_t: v

Type: int32_t

Definition: int32_t lw6mat_ivec2_t::v[LW6MAT_VEC2_V_SIZE]

Accessor with array index.

Struct: lw6mat_ivec3_t

Integer vector with 3 elements (AKA 3D point).

Member of lw6mat_ivec3_t: x

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::x

Member of lw6mat_ivec3_t: y

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::y

Member of lw6mat_ivec3_t: z

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::z

Member of lw6mat_ivec3_t: p

Type: struct lw6mat_ivec3_t::10

Definition: struct lw6mat_ivec3_t::10 lw6mat_ivec3_t::p

Accessor with named/point coords.

Member of lw6mat_ivec3_t: r

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::r

Member of lw6mat_ivec3_t: g

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::g

Member of lw6mat_ivec3_t: b

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::b

Member of lw6mat_ivec3_t: c

Type: struct lw6mat_ivec3_t::11

Definition: struct lw6mat_ivec3_t::11 lw6mat_ivec3_t::c

Accessor with color-like name.

Member of lw6mat_ivec3_t: s

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::s

Member of lw6mat_ivec3_t: t

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::t

Member of lw6mat_ivec3_t: p

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::p

Member of lw6mat_ivec3_t: t

Type: struct lw6mat_ivec3_t::12

Definition: struct lw6mat_ivec3_t::12 lw6mat_ivec3_t::t

Accessor with texture-like name.

Member of lw6mat_ivec3_t: v

Type: int32_t

Definition: int32_t lw6mat_ivec3_t::v[LW6MAT_VEC3_V_SIZE]

Accessor with array index.

Struct: lw6mat_ivec4_t

Integer vector with 4 elements (AKA quaternion).

Member of lw6mat_ivec4_t: x

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::x

Member of lw6mat_ivec4_t: y

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::y

Member of lw6mat_ivec4_t: z

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::z

Member of lw6mat_ivec4_t: w

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::w

Member of lw6mat_ivec4_t: p

Type: struct lw6mat_ivec4_t::13

Definition: struct lw6mat_ivec4_t::13 lw6mat_ivec4_t::p

Accessor with named/point coords.

Member of lw6mat_ivec4_t: r

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::r

Member of lw6mat_ivec4_t: g

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::g

Member of lw6mat_ivec4_t: b

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::b

Member of lw6mat_ivec4_t: a

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::a

Member of lw6mat_ivec4_t: c

Type: struct lw6mat_ivec4_t::14

Definition: struct lw6mat_ivec4_t::14 lw6mat_ivec4_t::c

Accessor with color-like name.

Member of lw6mat_ivec4_t: s

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::s

Member of lw6mat_ivec4_t: t

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::t

Member of lw6mat_ivec4_t: p

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::p

Member of lw6mat_ivec4_t: q

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::q

Member of lw6mat_ivec4_t: t

Type: struct lw6mat_ivec4_t::15

Definition: struct lw6mat_ivec4_t::15 lw6mat_ivec4_t::t

Accessor with texture-like name.

Member of lw6mat_ivec4_t: v

Type: int32_t

Definition: int32_t lw6mat_ivec4_t::v[LW6MAT_VEC4_V_SIZE]

Accessor with array index.

Struct: lw6mat_xmat2_t

Fixed Point 2x2 matrix (AKA 2D rectangle).

Member of lw6mat_xmat2_t: m

Type: int32_t

Definition: int32_t lw6mat_xmat2_t::m[LW6MAT_MAT2_M_SIZE][LW6MAT_MAT2_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_xmat2_t: v

Type: int32_t

Definition: int32_t lw6mat_xmat2_t::v[LW6MAT_MAT2_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*3+j.

Struct: lw6mat_xmat3_t

Fixed Point 3x3 matrix (AKA 3D triangle).

Member of lw6mat_xmat3_t: m

Type: int32_t

Definition: int32_t lw6mat_xmat3_t::m[LW6MAT_MAT3_M_SIZE][LW6MAT_MAT3_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_xmat3_t: v

Type: int32_t

Definition: int32_t lw6mat_xmat3_t::v[LW6MAT_MAT3_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*3+j.

Struct: lw6mat_xmat4_t

Fixed Point 4x4 matrix (AKA 3D transformation/composition matrix).

Member of lw6mat_xmat4_t: m

Type: int32_t

Definition: int32_t lw6mat_xmat4_t::m[LW6MAT_MAT4_M_SIZE][LW6MAT_MAT4_M_SIZE]

Accessor with 2 dimensions array index. The convention is column-major mode as done in OpenGL so that m[i][j] is element at column i and row j. Beware, this is not the most natural order for a C programmer.

Member of lw6mat_xmat4_t: v

Type: int32_t

Definition: int32_t lw6mat_xmat4_t::v[LW6MAT_MAT4_V_SIZE_X_SIZE]

Accessor with flat array index. To access element a column i and row j, use i*4+j.

Struct: lw6mat_xvec2_t

Fixed Point vector with 2 elements (AKA 2D point).

Member of lw6mat_xvec2_t: x

Type: int32_t

Definition: int32_t lw6mat_xvec2_t::x

Member of lw6mat_xvec2_t: y

Type: int32_t

Definition: int32_t lw6mat_xvec2_t::y

Member of lw6mat_xvec2_t: p

Type: struct lw6mat_xvec2_t::24

Definition: struct lw6mat_xvec2_t::24 lw6mat_xvec2_t::p

Accessor with named/point coords.

Member of lw6mat_xvec2_t: s

Type: int32_t

Definition: int32_t lw6mat_xvec2_t::s

Member of lw6mat_xvec2_t: t

Type: int32_t

Definition: int32_t lw6mat_xvec2_t::t

Member of lw6mat_xvec2_t: t

Type: struct lw6mat_xvec2_t::25

Definition: struct lw6mat_xvec2_t::25 lw6mat_xvec2_t::t

Accessor with texture-like name.

Member of lw6mat_xvec2_t: v

Type: int32_t

Definition: int32_t lw6mat_xvec2_t::v[LW6MAT_VEC2_V_SIZE]

Accessor with array index.

Struct: lw6mat_xvec3_t

Fixed Point vector with 3 elements (AKA 3D point).

Member of lw6mat_xvec3_t: x

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::x

Member of lw6mat_xvec3_t: y

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::y

Member of lw6mat_xvec3_t: z

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::z

Member of lw6mat_xvec3_t: p

Type: struct lw6mat_xvec3_t::26

Definition: struct lw6mat_xvec3_t::26 lw6mat_xvec3_t::p

Accessor with named/point coords.

Member of lw6mat_xvec3_t: r

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::r

Member of lw6mat_xvec3_t: g

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::g

Member of lw6mat_xvec3_t: b

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::b

Member of lw6mat_xvec3_t: c

Type: struct lw6mat_xvec3_t::27

Definition: struct lw6mat_xvec3_t::27 lw6mat_xvec3_t::c

Accessor with color-like name.

Member of lw6mat_xvec3_t: s

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::s

Member of lw6mat_xvec3_t: t

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::t

Member of lw6mat_xvec3_t: p

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::p

Member of lw6mat_xvec3_t: t

Type: struct lw6mat_xvec3_t::28

Definition: struct lw6mat_xvec3_t::28 lw6mat_xvec3_t::t

Accessor with texture-like name.

Member of lw6mat_xvec3_t: v

Type: int32_t

Definition: int32_t lw6mat_xvec3_t::v[LW6MAT_VEC3_V_SIZE]

Accessor with array index.

Struct: lw6mat_xvec4_t

Fixed Point vector with 4 elements (AKA quaternion).

Member of lw6mat_xvec4_t: x

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::x

Member of lw6mat_xvec4_t: y

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::y

Member of lw6mat_xvec4_t: z

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::z

Member of lw6mat_xvec4_t: w

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::w

Member of lw6mat_xvec4_t: p

Type: struct lw6mat_xvec4_t::29

Definition: struct lw6mat_xvec4_t::29 lw6mat_xvec4_t::p

Accessor with named/point coords.

Member of lw6mat_xvec4_t: r

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::r

Member of lw6mat_xvec4_t: g

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::g

Member of lw6mat_xvec4_t: b

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::b

Member of lw6mat_xvec4_t: a

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::a

Member of lw6mat_xvec4_t: c

Type: struct lw6mat_xvec4_t::30

Definition: struct lw6mat_xvec4_t::30 lw6mat_xvec4_t::c

Accessor with color-like name.

Member of lw6mat_xvec4_t: s

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::s

Member of lw6mat_xvec4_t: t

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::t

Member of lw6mat_xvec4_t: p

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::p

Member of lw6mat_xvec4_t: q

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::q

Member of lw6mat_xvec4_t: t

Type: struct lw6mat_xvec4_t::31

Definition: struct lw6mat_xvec4_t::31 lw6mat_xvec4_t::t

Accessor with texture-like name.

Member of lw6mat_xvec4_t: v

Type: int32_t

Definition: int32_t lw6mat_xvec4_t::v[LW6MAT_VEC4_V_SIZE]

Accessor with array index.


Next: , Previous: , Up: C API   [Contents][Index]