osgEarth 2.1.1
|
Functions | |
double | smoothStepInterp (double t) |
double | powFast (double x, double y) |
double | accelerationInterp (double t, double a) |
void | s_getHPRFromQuat (const osg::Quat &q, double &h, double &p, double &r) |
double anonymous_namespace{EarthManipulator.cpp}::accelerationInterp | ( | double | t, |
double | a | ||
) |
Definition at line 54 of file EarthManipulator.cpp.
double anonymous_namespace{EarthManipulator.cpp}::powFast | ( | double | x, |
double | y | ||
) |
Definition at line 48 of file EarthManipulator.cpp.
{
return x/(x+y-y*x);
}
void anonymous_namespace{EarthManipulator.cpp}::s_getHPRFromQuat | ( | const osg::Quat & | q, |
double & | h, | ||
double & | p, | ||
double & | r | ||
) |
Definition at line 59 of file EarthManipulator.cpp.
{ #if 0 // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm p = atan2(2*(q.y()*q.z() + q.w()*q.x()), (q.w()*q.w() - q.x()*q.x() - q.y()*q.y() + q.z() * q.z())); h = asin (2*q.x()*q.y() + 2*q.z()*q.w()); r = atan2(2*q.x()*q.w()-2*q.y()*q.z() , 1 - 2*q.x()*q.x() - 2*q.z()*q.z()); if( osg::equivalent( q.x()*q.y() + q.z() *q.w(), 0.5 ) ) { p = (float)(2 * atan2( q.x(),q.w())); r = 0; } else if( osg::equivalent( q.x()*q.y() + q.z()*q.w(), -0.5 ) ) { p = (float)(-2 * atan2(q.x(), q.w())); r = 0; } #else 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) ); } #endif }
double anonymous_namespace{EarthManipulator.cpp}::smoothStepInterp | ( | double | t | ) |
Definition at line 42 of file EarthManipulator.cpp.
{
return (t*t)*(3.0-2.0*t);
}