AnimatLab  2
Test
OsgAnimatSim::OsgMatrixUtil Class Reference

#include <OsgMatrixUtil.h>

+ Collaboration diagram for OsgAnimatSim::OsgMatrixUtil:

Public Member Functions

virtual CStdFPoint EulerRotationFromMatrix (osg::Matrix osgMT)
 
virtual osg::Matrix SetupMatrix (CStdFPoint &localPos, CStdFPoint &localRot)
 

Static Public Member Functions

static float ClampUnity (float x)
 clamps a float from -1 to 1
 
static CStdFPoint EulerRotationFromMatrix_Static (osg::Matrix osgMT)
 
static osg::Vec3 GetRow3 (const osg::Matrix &matrix, int row)
 
static osg::Vec4 GetRow4 (const osg::Matrix &matrix, int row)
 
static void HprToMatrix (osg::Matrix &rotation, const osg::Vec3 &hpr)
 
static void MatrixToHpr (osg::Vec3 &hpr, const osg::Matrix &rotation)
 
static void MatrixToHprAndPosition (osg::Vec3 &xyz, osg::Vec3 &hpr, const osg::Matrix &rotation)
 
static void MatrixToHprRad (osg::Vec3 &hpr, const osg::Matrix &rotation)
 
static void PositionAndHprRadToMatrix (osg::Matrix &rotation, const osg::Vec3 &xyz, const osg::Vec3 &hpr)
 
static void PositionAndHprToMatrix (osg::Matrix &rotation, const osg::Vec3 &xyz, const osg::Vec3 &hpr)
 
static void Print (const osg::Matrix &matrix)
 Prints a matrix.
 
static void Print (const osg::Vec3 &vec)
 Prints a vector.
 
static void Print (const osg::Vec4 &vec)
 Prints a vector.
 
static void SetRow (osg::Matrix &matrix, const osg::Vec3 &vec, int row)
 
static void SetRow (osg::Matrix &matrix, const osg::Vec4 &vec, int row)
 
static void TransformVec3 (osg::Vec3 &xyz, const osg::Matrix &transformMat)
 
static void TransformVec3 (osg::Vec3 &vec_in, const osg::Vec3 &xyz, const osg::Matrix &transformMat)
 
static void Transpose (osg::Matrix &dest, const osg::Matrix &src)
 transposes a matrix
 

Detailed Description

OsgMatrixUtil is a utility class for operating on an osg::Matrix

Definition at line 34 of file OsgMatrixUtil.h.

Member Function Documentation

void OsgAnimatSim::OsgMatrixUtil::HprToMatrix ( osg::Matrix &  rotation,
const osg::Vec3 &  hpr 
)
static

Translates Euler angles Heading, pitch, and roll to an osg::Matrix

Parameters
rotationthe matrix whose rotation will be filled
hprthe current Heading, pitch, roll to translate to a matrix (values are in degrees)
Todo:
find a preprocessor way to assign this constant different for the different precision types.

Definition at line 84 of file OsgMatrixUtil.cpp.

Referenced by PositionAndHprToMatrix().

+ Here is the caller graph for this function:

void OsgAnimatSim::OsgMatrixUtil::MatrixToHpr ( osg::Vec3 &  hpr,
const osg::Matrix &  rotation 
)
static

Translates the rotation part of an osg::Matrix to Euler Angles

Parameters
hprthe vector to fill with the Euler Angles
rotationthe current rotation matrix

Definition at line 186 of file OsgMatrixUtil.cpp.

References ClampUnity().

Referenced by MatrixToHprAndPosition(), and MatrixToHprRad().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void OsgAnimatSim::OsgMatrixUtil::MatrixToHprAndPosition ( osg::Vec3 &  xyz,
osg::Vec3 &  hpr,
const osg::Matrix &  rotation 
)
static

Translates the rotation part of an osg::Matrix to Euler Angles As well as the translation to a vector

Parameters
xyzthe vector to fill with the translation part of the matrix
hprthe vector to fill with the Euler Angles
rotationthe current rotation matrix

Definition at line 272 of file OsgMatrixUtil.cpp.

References MatrixToHpr().

+ Here is the call graph for this function:

void OsgAnimatSim::OsgMatrixUtil::MatrixToHprRad ( osg::Vec3 &  hpr,
const osg::Matrix &  rotation 
)
static

Translates the rotation part of an osg::Matrix to Euler Angles

Parameters
hprthe vector to fill with the Euler Angles
rotationthe current rotation matrix in radians

Definition at line 178 of file OsgMatrixUtil.cpp.

References MatrixToHpr().

+ Here is the call graph for this function:

void OsgAnimatSim::OsgMatrixUtil::PositionAndHprToMatrix ( osg::Matrix &  rotation,
const osg::Vec3 &  xyz,
const osg::Vec3 &  hpr 
)
static

Translates Euler angles Heading, pitch, and roll to an osg::Matrix in addition fills in the translation of the matrix

Parameters
rotationthe matrix whose rotation will be filled
xyzthe translation to be added to the matrix
hprthe current Heading, pitch, roll to translate to a matrix

Definition at line 169 of file OsgMatrixUtil.cpp.

References HprToMatrix().

+ Here is the call graph for this function:

void OsgAnimatSim::OsgMatrixUtil::TransformVec3 ( osg::Vec3 &  xyz,
const osg::Matrix &  transformMat 
)
static

This function transforms a point by a 4x4 matrix and stores the result back in the point

Parameters
xyzthe vector which will be transformed and have the result stored back in to
transformMatthe 4x4 matrix which will be used to rotate and translate the point

Definition at line 281 of file OsgMatrixUtil.cpp.

void OsgAnimatSim::OsgMatrixUtil::TransformVec3 ( osg::Vec3 &  vec_in,
const osg::Vec3 &  xyz,
const osg::Matrix &  transformMat 
)
static

This function transforms a point by a 4x4 matrix and stores the result into another vector

Parameters
vec_inthe vector to store the result of the transform
xyzthe vector which will be transformed
transformMatthe 4x4 matrix which will be used to rotate and translate the point

Definition at line 287 of file OsgMatrixUtil.cpp.


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