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
7#pragma once
8
9#include "vec.h"
10
15typedef struct mat4 { float data[4][4]; } mat4;
17typedef struct mat4d { double data[4][4]; } mat4d;
18
23vec4d mat4dGetColumn(const mat4d* a, uint8_t index);
28void mat4dSetColumn(mat4d* a, vec4d column, uint8_t index);
29
39mat4d mat4dMultiplyMat4d(const mat4d* a, const mat4d* b);
40
44
48mat4d mat4dConstructScale(double x, double y, double z);
52mat4d mat4dConstructTranslate(double x, double y, double z);
57mat4d mat4dConstructRotate(double x, double y, double z);
58
64 double transX, double transY, double transZ,
65 double rotataionX, double rotataionY, double rotataionZ,
66 double scaleX, double scaleY, double scaleZ
67);
74 double cameraX, double cameraY, double cameraZ,
75 double rotataionX, double rotataionY, double rotataionZ,
76 double scaleX, double scaleY, double scaleZ
77);
78
87 double x_min, double x_max,
88 double y_min, double y_max,
89 double z_min, double z_max
90);
100 double x_min_near, double x_max_near,
101 double y_min_near, double y_max_near,
102 double z_near, double z_far
103);
104
// defgroup Matrix
106
mat4d mat4dConstructScale(double x, double y, double z)
Definition mat.c:79
mat4d mat4dConstructPerspectiveProjection(double x_min_near, double x_max_near, double y_min_near, double y_max_near, double z_near, double z_far)
Definition mat.c:176
void mat4dSetColumn(mat4d *a, vec4d column, uint8_t index)
Definition mat.c:28
mat4d mat4dConstructView(double cameraX, double cameraY, double cameraZ, double rotataionX, double rotataionY, double rotataionZ, double scaleX, double scaleY, double scaleZ)
Definition mat.c:134
vec4d mat4dMultiplyVec4d(const mat4d *a, vec4d b)
Definition mat.c:45
mat4d mat4dConstructOrthogonalProjection(double x_min, double x_max, double y_min, double y_max, double z_min, double z_max)
Definition mat.c:149
mat4d mat4dConstructIdentity()
Definition mat.c:69
mat4d mat4dConstructTRS(double transX, double transY, double transZ, double rotataionX, double rotataionY, double rotataionZ, double scaleX, double scaleY, double scaleZ)
Definition mat.c:121
vec4d mat4dGetColumn(const mat4d *a, uint8_t index)
Definition mat.c:9
mat4d mat4dConstructRotate(double x, double y, double z)
Definition mat.c:99
mat4d mat4dMultiplyMat4d(const mat4d *a, const mat4d *b)
Definition mat.c:58
mat4d mat4dConstructTranslate(double x, double y, double z)
Definition mat.c:89
Definition mat.h:15
Definition mat.h:17
Definition vec.h:33