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

Function BuildModelAngleMatrix

model/polymodel.cpp:978–1001  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

976}
977
978void BuildModelAngleMatrix(matrix *mat, angle ang, vector *axis) {
979 float x, y, z;
980 float s, c, t;
981
982 x = axis->x;
983 y = axis->y;
984 z = axis->z;
985
986 s = (float)FixSin(ang);
987 c = (float)FixCos(ang);
988 t = 1.0f - c;
989
990 mat->rvec.x = t * x * x + c;
991 mat->rvec.y = t * x * y + s * z;
992 mat->rvec.z = t * x * z - s * y;
993
994 mat->uvec.x = t * x * y - s * z;
995 mat->uvec.y = t * y * y + c;
996 mat->uvec.z = t * y * z + s * x;
997
998 mat->fvec.x = t * x * z + s * y;
999 mat->fvec.y = t * y * z - s * x;
1000 mat->fvec.z = t * z * z + c;
1001}
1002
1003void SetPolymodelProperties(bsp_info *subobj, char *props) {
1004 // first, extract the command

Callers 3

ReadNewModelFileFunction · 0.70
SetModelAnglesFunction · 0.70

Calls 2

FixSinFunction · 0.50
FixCosFunction · 0.50

Tested by

no test coverage detected