21 #define MATH_VERSION "0.1.0" 112 Vec3Init(float x, float y, float z);
115 Vec3DotProduct(
struct vec3 left,
struct vec3 right);
118 Vec3CrossProduct(struct vec3 left, struct vec3 right);
121 Vec3Normalize(struct vec3 vec3);
124 Vec3Add(struct vec3 left, struct vec3 right);
127 Vec3Subtract(struct vec3 minuend, struct vec3 subtrahend);
130 Vec3Multiply(struct vec3 vec3, float f);
133 Vec3Divide(struct vec3 vec3, float f);
143 Vec3IntersectPlane(struct vec3 plane, struct vec3 normal, struct vec3 lineStart, struct vec3 lineEnd, float *t);
147 float x1, float y1, float z1,
149 float x2, float y2, float z2,
151 float x3, float y3, float z3,
206 Mat4x4MultiplyVec3(struct mat4x4 mat, struct vec3 vec);
212 Mat4x4RotateX(float rad);
215 Mat4x4RotateY(float rad);
218 Mat4x4RotateZ(float rad);
221 Mat4x4Translate(float x, float y, float z);
224 Mat4x4Project(float fovDegrees, float aspect, float near, float far);
227 Mat4x4Multiply(struct mat4x4 left, struct mat4x4 right);
231 Mat4x4InvertFast(struct mat4x4 matrix);
234 Mat4x4PointAt(struct vec3 pos, struct vec3 target, struct vec3 up);
240 #endif // MATH_VERSION void Vec3Debug(struct vec3 vec3, char *name)
Prints debug information about the homogenous 3D vector.
Triangular mesh face.
Definition: math.h:61
struct mesh * MeshInitFromObj(char *objFile)
Initialize a new mesh object from an obj file.
Definition: math.c:326
Homogenous 3D coordinates.
Definition: math.h:42
RGBA color quad.
Definition: color.h:30
void Mat4x4Debug(struct mat4x4 mat, char *name)
Prints debug information about the 4x4 matrix.
Definition: math.c:578
void TriangleDebug(struct triangle triangle, char *name)
Prints debug information about the triangle face.
Homogenous 2D coordinates.
Definition: math.h:27
A collection of triangles representing some kind of 3D model.
Definition: math.h:97
A 3D matrix using homogenous coordinates.
Definition: math.h:103
struct mesh * MeshInit(int numTris)
Initialize a new mesh object.
Definition: math.c:314
int TriangleClipAgainstPlane(struct vec3 plane, struct vec3 normal, struct triangle in, struct triangle *out1, struct triangle *out2)
Clip a triangle against a plane.
Definition: math.c:191
void MeshDeinit(struct mesh *mesh)
De-initializes the mesh object.
Definition: math.c:440