forked from fogleman/Craft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatrix.h
28 lines (26 loc) · 1.1 KB
/
matrix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _matrix_h_
#define _matrix_h_
void normalize(float *x, float *y, float *z);
void mat_identity(float *matrix);
void mat_translate(float *matrix, float dx, float dy, float dz);
void mat_rotate(float *matrix, float x, float y, float z, float angle);
void mat_vec_multiply(float *vector, float *a, float *b);
void mat_multiply(float *matrix, float *a, float *b);
void mat_apply(float *data, float *matrix, int count, int offset, int stride);
void frustum_planes(float planes[6][4], int radius, float *matrix);
void mat_frustum(
float *matrix, float left, float right, float bottom,
float top, float znear, float zfar);
void mat_perspective(
float *matrix, float fov, float aspect,
float near, float far);
void mat_ortho(
float *matrix,
float left, float right, float bottom, float top, float near, float far);
void set_matrix_2d(float *matrix, int width, int height);
void set_matrix_3d(
float *matrix, int width, int height,
float x, float y, float z, float rx, float ry,
float fov, int ortho, int radius);
void set_matrix_item(float *matrix, int width, int height, int scale);
#endif