OpenIG  2.0.4
cross-platform open-source OpenSceneGraph Image Generator
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
OpenIG::Base::Math Class Reference

The Math singleton class. More...

#include <Mathematics.h>

Public Member Functions

osg::Matrixd toMatrix (double x, double y, double z, double h, double p, double r)
 Creates osg::Matrixd from coordinates and euler in degrees. More...
 
osg::Matrixd toMuseMatrix (double x, double y, double z, double h, double p, double r)
 Creates osg::Matrixd from coordinates and euler in degrees to match Legacy Muse Math. More...
 
osg::Matrixd toViewMatrix (double x, double y, double z, double h, double p, double r)
 Creates View osg::Matrixd from coordinates and euler in degrees. More...
 
osg::Quat toQuat (double h, double p, double r)
 Creates osg::Quat from euler in degrees. More...
 
osg::Matrixd toGeocentricCameraMatrix (double lat, double lon, double alt, double h, double p, double r)
 Creates osg::Matrixd from coordinates and euler in degrees. More...
 
void fromMatrix (const osg::Matrixd &mx, double &x, double &y, double &z, double &h, double &p, double &r)
 Decompose a matrix to coordinates and euler. More...
 
osg::Vec3d fromQuat (const osg::Quat &q)
 Euler from osg::Quat ernion. More...
 
void fixVerticalAxis (osg::Vec3d &eye, osg::Quat &rotation, bool disallowFlipOver=true)
 Code snippet borrowed from osgGA::StandardManipulator. Please refer to the OSG documentation. More...
 

Static Public Member Functions

static Mathinstance ()
 The singleton. More...
 

Static Public Attributes

static const float M_PER_FT
 
static const float M_PER_NMI
 
static const float FT_PER_M
 
static const float FT_PER_NMI
 

Protected Member Functions

osg::Vec3d getUpVector (const osg::CoordinateFrame &cf)
 Code snippet borrowed from osgGA::StandardManipulator. Please refer to the OSG documentation. More...
 
void fixVerticalAxis (osg::Quat &rotation, const osg::Vec3d &localUp, bool disallowFlipOver=true)
 Code snippet borrowed from osgGA::StandardManipulator. Please refer to the OSG documentation. More...
 

Detailed Description

The Math singleton class.

The Math singleton class. Contais convinient handy methods

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Member Function Documentation

void OpenIG::Base::Math::fixVerticalAxis ( osg::Vec3d &  eye,
osg::Quat &  rotation,
bool  disallowFlipOver = true 
)

Code snippet borrowed from osgGA::StandardManipulator. Please refer to the OSG documentation.

Parameters
eye
rotation
disallowFlipOver
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
void OpenIG::Base::Math::fixVerticalAxis ( osg::Quat &  rotation,
const osg::Vec3d &  localUp,
bool  disallowFlipOver = true 
)
protected

Code snippet borrowed from osgGA::StandardManipulator. Please refer to the OSG documentation.

Parameters
rotation
localUp
disallowFlipOver
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
void OpenIG::Base::Math::fromMatrix ( const osg::Matrixd &  mx,
double &  x,
double &  y,
double &  z,
double &  h,
double &  p,
double &  r 
)

Decompose a matrix to coordinates and euler.

Parameters
mxthe matrix
xresulting x coordinate
yresulting y coordinate
zresulting z coordinate
hresulting heading in degrees
presulting pitch in degrees
rresulting roll in degrees
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
osg::Vec3d OpenIG::Base::Math::fromQuat ( const osg::Quat &  q)

Euler from osg::Quat ernion.

Parameters
theQuaternion
Returns
eulers in degrees, x() heading, y() pitch, z() roll
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
osg::Vec3d OpenIG::Base::Math::getUpVector ( const osg::CoordinateFrame &  cf)
protected

Code snippet borrowed from osgGA::StandardManipulator. Please refer to the OSG documentation.

Parameters
cf
Returns
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
static Math* OpenIG::Base::Math::instance ( )
static

The singleton.

Returns
The singleton
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
osg::Matrixd OpenIG::Base::Math::toGeocentricCameraMatrix ( double  lat,
double  lon,
double  alt,
double  h,
double  p,
double  r 
)

Creates osg::Matrixd from coordinates and euler in degrees.

Parameters
latlatitude coordinate in degrees
lonlongitude coordinate in degrees
altaltitude coordinate in meters
hheading in degrees
ppitch in degrees
rroll in degrees
Returns
matrix
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sat 14 May 2016
osg::Matrixd OpenIG::Base::Math::toMatrix ( double  x,
double  y,
double  z,
double  h,
double  p,
double  r 
)

Creates osg::Matrixd from coordinates and euler in degrees.

Parameters
xx coordinate
yy coordinate
zz coordinate
hheading in degrees
ppitch in degrees
rroll in degrees
Returns
matrix
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
osg::Matrixd OpenIG::Base::Math::toMuseMatrix ( double  x,
double  y,
double  z,
double  h,
double  p,
double  r 
)

Creates osg::Matrixd from coordinates and euler in degrees to match Legacy Muse Math.

Parameters
xx coordinate
yy coordinate
zz coordinate
hheading in degrees
ppitch in degrees
rroll in degrees
Returns
matrix
Author
Roni Zanolli openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2000
osg::Quat OpenIG::Base::Math::toQuat ( double  h,
double  p,
double  r 
)

Creates osg::Quat from euler in degrees.

Parameters
hheading in degrees
ppitch in degrees
rroll in degrees
Returns
quaternion
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun May 15 2016
osg::Matrixd OpenIG::Base::Math::toViewMatrix ( double  x,
double  y,
double  z,
double  h,
double  p,
double  r 
)

Creates View osg::Matrixd from coordinates and euler in degrees.

Parameters
xx coordinate
yy coordinate
zz coordinate
hheading in degrees
ppitch in degrees
rroll in degrees
Returns
matrix
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Thu Jun 23 2016

The documentation for this class was generated from the following file: