MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / BuildModelAngleMatrix

Function BuildModelAngleMatrix

physics/newstyle_fi.cpp:72–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 uint32_t f_render_sub);
71
72static void BuildModelAngleMatrix(matrix *mat, angle ang, vector *axis) {
73 float x, y, z;
74 float s, c, t;
75
76 x = axis->x;
77 y = axis->y;
78 z = axis->z;
79
80 s = (float)FixSin(ang);
81 c = (float)FixCos(ang);
82 t = 1.0f - c;
83
84 mat->rvec.x = t * x * x + c;
85 mat->rvec.y = t * x * y + s * z;
86 mat->rvec.z = t * x * z - s * y;
87
88 mat->uvec.x = t * x * y - s * z;
89 mat->uvec.y = t * y * y + c;
90 mat->uvec.z = t * y * z + s * x;
91
92 mat->fvec.x = t * x * z + s * y;
93 mat->fvec.y = t * y * z - s * x;
94 mat->fvec.z = t * z * z + c;
95}
96
97float fvi_hit_param;
98bool fvi_check_param;

Callers

nothing calls this directly

Calls 2

FixSinFunction · 0.50
FixCosFunction · 0.50

Tested by

no test coverage detected