#ifndef MATRIX4X4_H #define MATRIX4X4_H #include #include "vector.h" /* accesing data: row + column * width */ typedef struct { GLfloat data[16]; } Mat4; extern void mat4_identity(Mat4 *a); extern Mat4 mat4_inverse(const Mat4 *a); extern Mat4 mat4_mul(const Mat4 *a, const Mat4 *b); extern Mat4 mat4_translate(const Vec3 *a); extern Mat4 mat4_scale(GLfloat x, GLfloat y, GLfloat z); extern Mat4 mat4_rotate_x(GLfloat degrees); extern Mat4 mat4_rotate_y(GLfloat degrees); extern Mat4 mat4_rotate_z(GLfloat degrees); extern Mat4 mat4_rotate(GLfloat degrees, const Vec3 *a); extern Mat4 mat4_perspective(GLfloat fov, GLfloat aspect, GLfloat zNear, GLfloat zFar); extern Mat4 mat4_orthographic(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far); extern Mat4 mat4_lookAt(Vec3 *eye, Vec3 *center, Vec3 *up); extern Vec3 mat4_mul_vec3(const Mat4 *a, const Vec3 *b); extern Vec4 mat4_mul_vec4(const Mat4 *a, const Vec4 *b); #endif // MATRIX4X4_H