MCPcopy Create free account
hub / github.com/cuberite/cuberite / VectorToEuler

Function VectorToEuler

src/Defines.h:494–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492
493
494inline void VectorToEuler(double a_X, double a_Y, double a_Z, double & a_Pan, double & a_Pitch)
495{
496 if (fabs(a_X) < std::numeric_limits<double>::epsilon())
497 {
498 a_Pan = atan2(a_Z, a_X) * 180 / PI - 90;
499 }
500 else
501 {
502 a_Pan = 0;
503 }
504 a_Pitch = atan2(a_Y, sqrt((a_X * a_X) + (a_Z * a_Z))) * 180 / PI;
505}
506
507
508

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected