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

Function vm_SinCosToMatrix

vecmat/vector.cpp:494–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494void vm_SinCosToMatrix(matrix *m, float sinp, float cosp, float sinb, float cosb, float sinh, float cosh) {
495 float sbsh, cbch, cbsh, sbch;
496
497 sbsh = (sinb * sinh);
498 cbch = (cosb * cosh);
499 cbsh = (cosb * sinh);
500 sbch = (sinb * cosh);
501
502 m->rvec.x = cbch + (sinp * sbsh); // m1
503 m->uvec.z = sbsh + (sinp * cbch); // m8
504
505 m->uvec.x = (sinp * cbsh) - sbch; // m2
506 m->rvec.z = (sinp * sbch) - cbsh; // m7
507
508 m->fvec.x = (sinh * cosp); // m3
509 m->rvec.y = (sinb * cosp); // m4
510 m->uvec.y = (cosb * cosp); // m5
511 m->fvec.z = (cosh * cosp); // m9
512
513 m->fvec.y = -sinp; // m6
514}
515
516void vm_AnglesToMatrix(matrix *m, angle p, angle h, angle b) {
517 float sinp, cosp, sinb, cosb, sinh, cosh;

Callers 2

vm_AnglesToMatrixFunction · 0.70
vm_VectorAngleToMatrixFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected