osgEarth 2.1.1
|
Functions | |
void | getHPRFromQuat (const osg::Quat &q, double &h, double &p, double &r) |
void anonymous_namespace{ObjectLocator.cpp}::getHPRFromQuat | ( | const osg::Quat & | q, |
double & | h, | ||
double & | p, | ||
double & | r | ||
) |
Definition at line 12 of file ObjectLocator.cpp.
{ osg::Matrixd rot(q); p = asin(rot(1,2)); if( osg::equivalent(osg::absolute(p), osg::PI_2) ) { r = 0.0; h = atan2( rot(0,1), rot(0,0) ); } else { r = atan2( rot(0,2), rot(2,2) ); h = atan2( rot(1,0), rot(1,1) ); } h = osg::RadiansToDegrees(h); p = osg::RadiansToDegrees(p); r = osg::RadiansToDegrees(r); }