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

Function CollideAnglesToMatrix

physics/collide.cpp:1469–1490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1467}
1468
1469void CollideAnglesToMatrix(matrix *m, float p, float h, float b) {
1470 float sinp, cosp, sinb, cosb, sinh, cosh;
1471
1472 sinp = sin(p);
1473 cosp = cos(p);
1474 sinb = sin(b);
1475 cosb = cos(b);
1476 sinh = sin(h);
1477 cosh = cos(h);
1478
1479 m->rvec.x = cosb * cosh;
1480 m->rvec.y = cosb * sinp * sinh - cosp * sinb;
1481 m->rvec.z = cosb * cosp * sinh + sinb * sinp;
1482
1483 m->uvec.x = cosh * sinb;
1484 m->uvec.y = sinb * sinp * sinh + cosp * cosb;
1485 m->uvec.z = sinb * cosp * sinh - cosb * sinp;
1486
1487 m->fvec.x = -sinh;
1488 m->fvec.y = sinp * cosh;
1489 m->fvec.z = cosp * cosh;
1490}
1491
1492vector *CollideExtractAnglesFromMatrix(vector *a, matrix *m) {
1493 float sinh, cosh, sinp, sinb;

Callers 1

ConvertEulerToAxisAmountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected