osgEarth 2.1.1
Functions

anonymous_namespace{EarthManipulator.cpp} Namespace Reference

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)

Function Documentation

double anonymous_namespace{EarthManipulator.cpp}::accelerationInterp ( double  t,
double  a 
)

Definition at line 54 of file EarthManipulator.cpp.

                                             {
        return a == 0.0? t : a > 0.0? powFast( t, a ) : 1.0 - powFast(1.0-t, -a);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

double anonymous_namespace{EarthManipulator.cpp}::powFast ( double  x,
double  y 
)

Definition at line 48 of file EarthManipulator.cpp.

                                  {
        return x/(x+y-y*x);
    }

Here is the caller graph for this function:

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
    }

Here is the call graph for this function:

Here is the caller graph for this function:

double anonymous_namespace{EarthManipulator.cpp}::smoothStepInterp ( double  t)

Definition at line 42 of file EarthManipulator.cpp.

                                 {
        return (t*t)*(3.0-2.0*t);
    }

Here is the caller graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines