25void mat4_tostr(
const mat4 *m,
char *buf,
size_t len );
26void mat4_print(
const mat4 *m );
33void mat4_scale_xy(
mat4 *m,
double x,
double y );
35void mat4_translate_x(
mat4 *m,
double x );
36void mat4_translate_xy(
mat4 *m,
double x,
double y );
37void mat4_translate_scale_xy(
mat4 *m,
double x,
double y,
double w,
double h );
46__attribute__( ( const ) )
mat4 mat4_ortho(
double left,
double right,
47 double bottom,
double top,
48 double nearVal,
double farVal );
53void quat_normalize(
quat *q );
54void quat_slerp( GLfloat qm[4], const GLfloat qa[4], const GLfloat qb[4],
void mat4_translate(mat4 *m, double x, double y, double z)
Translates a homogenous transformation matrix.
void mat4_apply(mat4 *lhs, const mat4 *rhs)
Applies a transformation to another, storing the result in the left hand side.
mat4 mat4_lookat(const vec3 *eye, const vec3 *center, const vec3 *up)
Creates a matrix with a transformation to look at a center point from an eye with an up vector.
mat4 mat4_identity(void)
Creates an identity matrix.
mat4 mat4_perspective(double fov, double aspect, double near, double far)
Creates a matrix with a perspective transformation.
void mat4_rotate(mat4 *m, double angle, double x, double y, double z)
Multiplies the given matrix by a rotation. (Follows the right-hand rule.)
void mat4_mul_vec(vec3 *out, const mat4 *m, const vec3 *v)
Multiplies a matrix with a vector (out = m * v);.
void mat4_scale(mat4 *m, double x, double y, double z)
Scales a homogeneous transformation matrix.
void mat4_mul(mat4 *out, const mat4 *m1, const mat4 *m2)
Multiplies two matrices (out = m1 * m2).
void mat4_rotate_quaternion(mat4 *m, const quat *q)
Applies a quaternion transformation.
void mat4_trs(mat4 *m, const vec3 *t, const quat *r, const vec3 *s)
Creates a homogeneous transform matrix from a translation, rotation, and scaling. Uses T*R*S order.
mat4 mat4_ortho(double left, double right, double bottom, double top, double nearVal, double farVal)
Creates an orthographic projection matrix.
void mat4_rotate2d(mat4 *m, double angle)
Rotates an angle, in radians, around the z axis.
void mat4_rotate2dv(mat4 *m, double c, double s)
Rotates the +x axis to the given vector.