srp
software rendering pipeline
Loading...
Searching...
No Matches
mat.h
Go to the documentation of this file.
1// Software Rendering Pipeline (SRP) library
2// Licensed under GNU GPLv3
3
8#pragma once
9
10#include "srp/vec.h"
11
16typedef struct mat4 { float data[4][4]; } mat4;
17
22vec4 mat4MultiplyVec4(const mat4* restrict a, vec4 b);
27mat4 mat4MultiplyMat4(const mat4* restrict a, const mat4* restrict b);
28
32
36mat4 mat4ConstructScale(float x, float y, float z);
40mat4 mat4ConstructTranslate(float x, float y, float z);
45mat4 mat4ConstructRotate(float x, float y, float z);
46
52 float transX, float transY, float transZ,
53 float rotataionX, float rotataionY, float rotataionZ,
54 float scaleX, float scaleY, float scaleZ
55);
56
63 float cameraX, float cameraY, float cameraZ,
64 float rotationX, float rotationY, float rotationZ,
65 float scaleX, float scaleY, float scaleZ
66);
67
76 float x_min, float x_max,
77 float y_min, float y_max,
78 float z_min, float z_max
79);
80
90 float x_min_near, float x_max_near,
91 float y_min_near, float y_max_near,
92 float z_near, float z_far
93);
94
// ingroup Math
mat4 mat4ConstructIdentity()
Definition mat.c:77
mat4 mat4ConstructView(float cameraX, float cameraY, float cameraZ, float rotationX, float rotationY, float rotationZ, float scaleX, float scaleY, float scaleZ)
Definition mat.c:142
mat4 mat4MultiplyMat4(const mat4 *restrict a, const mat4 *restrict b)
Definition mat.c:47
mat4 mat4ConstructOrthogonalProjection(float x_min, float x_max, float y_min, float y_max, float z_min, float z_max)
Definition mat.c:157
mat4 mat4ConstructPerspectiveProjection(float x_min_near, float x_max_near, float y_min_near, float y_max_near, float z_near, float z_far)
Definition mat.c:184
mat4 mat4ConstructRotate(float x, float y, float z)
Definition mat.c:107
mat4 mat4ConstructTRS(float transX, float transY, float transZ, float rotataionX, float rotataionY, float rotataionZ, float scaleX, float scaleY, float scaleZ)
Definition mat.c:129
vec4 mat4MultiplyVec4(const mat4 *restrict a, vec4 b)
Definition mat.c:16
mat4 mat4ConstructScale(float x, float y, float z)
Definition mat.c:87
mat4 mat4ConstructTranslate(float x, float y, float z)
Definition mat.c:97
Definition mat.h:16
Definition vec.h:26