3D matrix.
typedef struct M4f
X scalar.
S4f x;
y scalar.
S4f y;
z scalar.
S4f z;
w scalar.
S4f w;
End block 'M4f'
} M4f;
Construct 3D float scalar from a transformed 4D float scalar.
API S4f M4fTfmS4f(M4f matrix, S4f s);
matrix: Matrix.
s: Scalar.
returns: Transformed scalar.
Construct matrix with a transformed by b.
API M4f M4fTfm(M4f a, M4f b);
a: First matrix.
b: Second matrix.
returns: Transformed matrix.
Construct matrix with translation removed from input matrix. Translation is stored in scalar.
API M4f M4fTransOut(M4f matrix, S3f *trans);
matrix: Matrix.
trans: Pointer to variable to store translation.
returns: M4f with no translation.
Construct matrix with translation of input matrix set to the translation scalar.
API M4f M4fTransIn(M4f matrix, S3f trans);
matrix: Matrix.
trans: Previously stored translation.
returns: M4f with translation applied.
Construct matrix that is the inverse of the input matrix.
API M4f M4fInvert(M4f matrix);
matrix: Matrix.
returns: Inverse matrix.
Normalize matrix.
API void M4fNormalize(M4f *matrix);
matrix: Pointer to matrix.
Get scalar from specified row of the matrix.
API S4f M4fGetRow(M4f matrix, uint row);
matrix: Pointer to matrix.
row: Row index. 0 = x row. 1 = y row. 2 = z row. 3 = w row.
returns: Row scalar.
Set row to scalar value.
API void M4fSetRow(M4f *matrix, uint row, S4f s);
matrix: Pointer to matrix.
row: Row index. 0 = x row. 1 = y row. 2 = z row. 3 = w row.
s: Scalar.
Construct identity matrix.
API M4f M4fMakeIdent();
returns: Identity matrix.
Construct translation matrix from scalar.
API M4f M4fMakeTransS3f(S3f s);
s: Scalar.
returns: Translation matrix.
Construct translation matrix.
API M4f M4fMakeTrans(float x, float y, float z);
x: X position.
y: Y position.
z: Z position.
returns: Translation matrix.
Construct scale matrix from scalar.
API M4f M4fMakeScaleS3f(S3f scale);
scale: Scale.
returns: Scale matrix.
Construct scale matrix.
API M4f M4fMakeScale(float x, float y, float z);
scale: X scaled.
scale: Y scale.
scale: Z scale.
returns: Scale matrix.
Construct rotation matrix on x-axis.
API M4f M4fMakeRotX(float angle);
angle: X angle.
returns: Rotation matrix.
Construct rotation matrix on y-axis.
API M4f M4fMakeRotY(float angle);
angle: Y angle.
returns: Rotation matrix.
Construct rotation matrix on z-axis.
API M4f M4fMakeRotZ(float angle);
angle: Z angle.
returns: New rotation matrix.
Construct rotation matrix on arbitrary axis.
API M4f M4fMakeRot(S3f s, float angle);
v: Axis vector.
angle: Angle.
returns: Rotation matrix.
Construct matrix that transforms from vector 'a' to vector 'b'.
API M4f M4fMakeAlign(S3f a, S3f b);
a: From axis.
b: To axis
returns: Rotation matrix.
Construct matrix that points from the 'eye' position to 'at' position,while keeping the up direction aligned to the 'up' vector.
API M4f M4fMakeLookAt(S3f eye, S3f at, S3f up);
eye: Eye position.
at: Target position.
up: Up vector.
returns: Rotation matrix.