dtUtil::MatrixUtil Class Reference

MatrixUtil is a utility class for operating on an osg::Matrix. More...

#include <matrixutil.h>

List of all members.

Static Public Member Functions

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 float ClampUnity (float x)
 clamps a float from -1 to 1
static void Transpose (osg::Matrix &dest, const osg::Matrix &src)
 transposes a matrix
static osg::Vec3 GetRow3 (const osg::Matrix &matrix, int row)
static osg::Vec4 GetRow4 (const osg::Matrix &matrix, int row)
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 HprToMatrix (osg::Matrix &rotation, const osg::Vec3 &hpr)
 Translates Euler angles Heading, pitch, and roll to an osg::Matrix.
static void PositionAndHprToMatrix (osg::Matrix &rotation, const osg::Vec3 &xyz, const osg::Vec3 &hpr)
 Translates Euler angles Heading, pitch, and roll to an osg::Matrix in addition fills in the translation of the matrix.
static void MatrixToHpr (osg::Vec3 &hpr, const osg::Matrix &rotation)
 Translates the rotation part of an osg::Matrix to Euler Angles.
static void MatrixToHprAndPosition (osg::Vec3 &xyz, osg::Vec3 &hpr, const osg::Matrix &rotation)
 Translates the rotation part of an osg::Matrix to Euler Angles As well as the translation to a vector.
static void TransformVec3 (osg::Vec3 &xyz, const osg::Matrix &transformMat)
 This function transforms a point by a 4x4 matrix and stores the result back in the point.
static void TransformVec3 (osg::Vec3 &vec_in, const osg::Vec3 &xyz, const osg::Matrix &transformMat)
 This function transforms a point by a 4x4 matrix and stores the result into another vector.


Detailed Description

MatrixUtil is a utility class for operating on an osg::Matrix.

Member Function Documentation

void MatrixUtil::Print ( const osg::Matrix &  matrix  )  [static]

Prints a matrix.

void MatrixUtil::Print ( const osg::Vec3 &  vec  )  [static]

Prints a vector.

void MatrixUtil::Print ( const osg::Vec4 &  vec  )  [static]

Prints a vector.

float MatrixUtil::ClampUnity ( float  x  )  [static]

clamps a float from -1 to 1

void MatrixUtil::Transpose ( osg::Matrix &  dest,
const osg::Matrix &  src 
) [static]

transposes a matrix

osg::Vec3 MatrixUtil::GetRow3 ( const osg::Matrix &  matrix,
int  row 
) [static]

osg::Vec4 MatrixUtil::GetRow4 ( const osg::Matrix &  matrix,
int  row 
) [static]

void MatrixUtil::SetRow ( osg::Matrix &  matrix,
const osg::Vec3 &  vec,
int  row 
) [static]

void MatrixUtil::SetRow ( osg::Matrix &  matrix,
const osg::Vec4 &  vec,
int  row 
) [static]

void MatrixUtil::HprToMatrix ( osg::Matrix &  rotation,
const osg::Vec3 &  hpr 
) [static]

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

Parameters:
rotation,: the matrix whose rotation will be filled
hpr,: the current Heading, pitch, roll to translate to a matrix (values are in degrees)

void MatrixUtil::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:
rotation,: the matrix whose rotation will be filled
xyz,: the translation to be added to the matrix
hpr,: the current Heading, pitch, roll to translate to a matrix

void MatrixUtil::MatrixToHpr ( osg::Vec3 &  hpr,
const osg::Matrix &  rotation 
) [static]

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

Parameters:
hpr,: the vector to fill with the Euler Angles
rotation,: the current rotation matrix

void MatrixUtil::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:
xyz,: the vector to fill with the translation part of the matrix
hpr,: the vector to fill with the Euler Angles
rotation,: the current rotation matrix

void MatrixUtil::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:
xyz,: the vector which will be transformed and have the result stored back in to
transformMat,: the 4x4 matrix which will be used to rotate and translate the point

void MatrixUtil::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_in,: the vector to store the result of the transform
xyz,: the vector which will be transformed
transformMat,: the 4x4 matrix which will be used to rotate and translate the point


http://www.delta3d.org
2.0.0 generated 14 Feb 2008