TrueReality  v0.1.1912
trBase::Matrixf Class Reference

A float Matrix class to be used for generic matrix operations. More...

#include <Matrixf.h>

Public Types

using value_type = float
 

Public Member Functions

 Matrixf ()
 ctor More...
 
 Matrixf (const osg::Matrixf &mat)
 ctor. More...
 
 Matrixf (const osg::Matrixd &mat)
 ctor. More...
 
 Matrixf (const Matrixf &mat)
 ctor. More...
 
 Matrixf (const Matrixd &mat)
 ctor. More...
 
 Matrixf (float const *const ptr)
 ctor that takes a 4x4 array of floats and uses them as matrix input. More...
 
 Matrixf (double const *const ptr)
 ctor that takes a 4x4 array of double and uses them as matrix input. More...
 
 Matrixf (const Quat &quat)
 ctor that takes a quaternion and uses it as matrix input. More...
 
 Matrixf (value_type a00, value_type a01, value_type a02, value_type a03, value_type a10, value_type a11, value_type a12, value_type a13, value_type a20, value_type a21, value_type a22, value_type a23, value_type a30, value_type a31, value_type a32, value_type a33)
 ctor. More...
 
 ~Matrixf ()
 dtor. More...
 
osg::Matrixf & GetOSGMatrix ()
 Returns a reference to the internal OSG Matrix. More...
 
const osg::Matrixf & GetOSGMatrix () const
 Returns a reference to the internal OSG Matrix. More...
 
int Compare (const Matrixf &m) const
 Compare the current Matrix to the passed in one. More...
 
bool Valid () const
 Returns true if the Matrix is not NaN. More...
 
bool IsNaN () const
 Returns true if the Matrix is NaN. More...
 
void Set (const Matrixf &rhs)
 Set the current Matrix from a passed in one. More...
 
void Set (const Matrixd &rhs)
 Set the current Matrix from a passed in one. More...
 
void Set (float const *const ptr)
 Set the current Matrix from a passed in values array. More...
 
void Set (double const *const ptr)
 Set the current Matrix from a passed in values array. More...
 
void Set (value_type a00, value_type a01, value_type a02, value_type a03, value_type a10, value_type a11, value_type a12, value_type a13, value_type a20, value_type a21, value_type a22, value_type a23, value_type a30, value_type a31, value_type a32, value_type a33)
 Set the current Matrix from a passed in values. More...
 
value_typePtr ()
 Pointer to the internal Matrix array. More...
 
const value_typePtr () const
 Pointer to the internal Matrix array. More...
 
void MakeIdentity ()
 Reset this matrix to be an Identity Matrix. More...
 
void MakeScale (const Vec3f &v)
 Reset this matrix to be a scale matrix of the passed in value. More...
 
void MakeScale (const Vec3d &v)
 Reset this matrix to be a scale matrix of the passed in value. More...
 
void MakeScale (value_type x, value_type y, value_type z)
 Reset this matrix to be a scale matrix of the passed in value. More...
 
void MakeTranslate (const Vec3f &v)
 Reset this matrix to be a translation matrix of the passed in value. More...
 
void MakeTranslate (const Vec3d &v)
 Reset this matrix to be a translation matrix of the passed in value. More...
 
void MakeTranslate (value_type x, value_type y, value_type z)
 Reset this matrix to be a translation matrix of the passed in value. More...
 
void MakeRotate (const Vec3f &from, const Vec3f &to)
 Reset this matrix to be a rotational matrix of the passed in value. More...
 
void MakeRotate (const Vec3d &from, const Vec3d &to)
 Reset this matrix to be a rotational matrix of the passed in value. More...
 
void MakeRotate (value_type angle, const Vec3f &axis)
 Reset this matrix to be a rotational matrix of the passed in value. More...
 
void MakeRotate (value_type angle, const Vec3d &axis)
 Reset this matrix to be a rotational matrix of the passed in value. More...
 
void MakeRotate (value_type angle, value_type x, value_type y, value_type z)
 Reset this matrix to be a rotational matrix of the passed in value. More...
 
void MakeRotate (const Quat &q)
 Reset this matrix to be a rotational matrix of the passed in value. More...
 
void MakeRotate (value_type angle1, const Vec3f &axis1, value_type angle2, const Vec3f &axis2, value_type angle3, const Vec3f &axis3)
 Reset this matrix to be a rotational matrix of the passed in value. More...
 
void MakeRotate (value_type angle1, const Vec3d &axis1, value_type angle2, const Vec3d &axis2, value_type angle3, const Vec3d &axis3)
 Reset this matrix to be a rotational matrix of the passed in value. More...
 
void Decompose (Vec3f &translation, Quat &rotation, Vec3f &scale, Quat &so) const
 Decomposes the matrix into translation, rotation, scale and scale orientation. More...
 
void Decompose (Vec3d &translation, Quat &rotation, Vec3d &scale, Quat &so) const
 Decompose the matrix into translation, rotation, scale and scale orientation. More...
 
void MakeOrtho (double left, double right, double bottom, double top, double zNear, double zFar)
 Set to an orthographic projection. More...
 
void MakeOrtho (float left, float right, float bottom, float top, float zNear, float zFar)
 Set to an orthographic projection. More...
 
bool GetOrtho (double &left, double &right, double &bottom, double &top, double &zNear, double &zFar) const
 Get the orthographic settings of the orthographic projection matrix. More...
 
bool GetOrtho (float &left, float &right, float &bottom, float &top, float &zNear, float &zFar) const
 float version of getOrtho(..) Get the orthographic settings of the orthographic projection matrix. More...
 
void MakeOrtho2D (double left, double right, double bottom, double top)
 Set to a 2D orthographic projection. More...
 
void MakeOrtho2D (float left, float right, float bottom, float top)
 Set to a 2D orthographic projection. More...
 
void MakeFrustum (double left, double right, double bottom, double top, double zNear, double zFar)
 Set to a perspective projection. More...
 
void MakeFrustum (float left, float right, float bottom, float top, float zNear, float zFar)
 Set to a perspective projection. More...
 
bool GetFrustum (double &left, double &right, double &bottom, double &top, double &zNear, double &zFar) const
 Get the frustum settings of a perspective projection matrix. More...
 
bool GetFrustum (float &left, float &right, float &bottom, float &top, float &zNear, float &zFar) const
 float version of getFrustum(..) Get the frustum settings of a perspective projection matrix. More...
 
void MakePerspective (double fovy, double aspectRatio, double zNear, double zFar)
 Set to a symmetrical perspective projection. More...
 
void MakePerspective (float fovy, float aspectRatio, float zNear, float zFar)
 Set to a symmetrical perspective projection. More...
 
bool GetPerspective (double &fovy, double &aspectRatio, double &zNear, double &zFar) const
 Get the frustum settings of a symmetric perspective projection matrix. More...
 
bool GetPerspective (float &fovy, float &aspectRatio, float &zNear, float &zFar) const
 float version of getPerspective(..) Get the frustum settings of a symmetric perspective projection matrix. More...
 
void MakeLookAt (const Vec3f &eye, const Vec3f &center, const Vec3f &up)
 Set the position and orientation to be a view matrix, using the same convention as gluLookAt. More...
 
void MakeLookAt (const Vec3d &eye, const Vec3d &center, const Vec3d &up)
 Set the position and orientation to be a view matrix, using the same convention as gluLookAt. More...
 
void GetLookAt (Vec3f &eye, Vec3f &center, Vec3f &up, value_type lookDistance=1.0f) const
 Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt. More...
 
void GetLookAt (Vec3d &eye, Vec3d &center, Vec3d &up, value_type lookDistance=1.0f) const
 Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt. More...
 
bool Invert (const Matrixf &rhs)
 Invert the matrix rhs, automatically select invert_4x3 or invert_4x4. More...
 
bool Invert_4x3 (const Matrixf &rhs)
 4x3 matrix invert, not right hand column is assumed to be 0,0,0,1. More...
 
bool Invert_4x4 (const Matrixf &rhs)
 Full 4x4 matrix invert. More...
 
void OrthoNormalize (const Matrixf &rhs)
 Ortho-normalize the 3x3 rotation & scale matrix. More...
 
void SetRotate (const Quat &q)
 Applies the rotation to the matrix. More...
 
Quat GetRotate () const
 Get the matrix rotation as a Quat. More...
 
void SetTrans (value_type tx, value_type ty, value_type tz)
 Sets the translation area of the matrix. More...
 
void SetTrans (const Vec3f &v)
 Sets the translation area of the matrix. More...
 
void SetTrans (const Vec3d &v)
 Sets the translation area of the matrix. More...
 
Vec3d GetTrans () const
 Returns the translation area of the matrix. More...
 
Vec3d GetScale () const
 Returns the matrix scale. More...
 
void SetScale (value_type x, value_type y, value_type z)
 Sets the scale values of the matrix. More...
 
void SetScale (const Vec3f &v)
 Sets the scale values of the matrix. More...
 
void SetScale (const Vec3d &v)
 Sets the scale values of the matrix. More...
 
Vec3f PreMult (const Vec3f &v) const
 PreMultiply the matrix by the passed in vector. More...
 
Vec3d PreMult (const Vec3d &v) const
 PreMultiply the matrix by the passed in vector. More...
 
Vec3f PostMult (const Vec3f &v) const
 PostMultiply the matrix by the passed in vector. More...
 
Vec3d PostMult (const Vec3d &v) const
 PostMultiply the matrix by the passed in vector. More...
 
Vec4f PreMult (const Vec4f &v) const
 PreMultiply the matrix by the passed in vector. More...
 
Vec4d PreMult (const Vec4d &v) const
 PreMultiply the matrix by the passed in vector. More...
 
Vec4f PostMult (const Vec4f &v) const
 PostMultiply the matrix by the passed in vector. More...
 
Vec4d PostMult (const Vec4d &v) const
 PostMultiply the matrix by the passed in vector. More...
 
void Mult (const Matrixf &m1, const Matrixf &m2)
 Basic Matrixf multiplication, our workhorse methods. More...
 
void PreMult (const Matrixf &m)
 Basic Matrixf multiplication, our workhorse methods. More...
 
void PostMult (const Matrixf &m)
 Basic Matrixf multiplication, our workhorse methods. More...
 
void PreMultTranslate (const Vec3d &v)
 Optimized version of preMult(translate(v));. More...
 
void PreMultTranslate (const Vec3f &v)
 Optimized version of preMult(translate(v));. More...
 
void PostMultTranslate (const Vec3d &v)
 Optimized version of postMult(translate(v));. More...
 
void PostMultTranslate (const Vec3f &v)
 Optimized version of postMult(translate(v));. More...
 
void PreMultScale (const Vec3d &v)
 Optimized version of preMult(scale(v));. More...
 
void PreMultScale (const Vec3f &v)
 Optimized version of preMult(scale(v));. More...
 
void PostMultScale (const Vec3d &v)
 Optimized version of postMult(scale(v));. More...
 
void PostMultScale (const Vec3f &v)
 Optimized version of postMult(scale(v));. More...
 
void PreMultRotate (const Quat &q)
 Optimized version of preMult(rotate(q));. More...
 
void PostMultRotate (const Quat &q)
 Optimized version of postMult(rotate(q));. More...
 
std::string ToString (int precision=-1)
 Convert this object into a string representation. More...
 
Matrixfoperator= (const Matrixf &rhs)
 Set operator. More...
 
Matrixfoperator= (const Matrixd &rhs)
 Set operator. More...
 
bool operator> (const Matrixf &m) const
 Greater than by operator. More...
 
bool operator< (const Matrixf &m) const
 Less than by operator. More...
 
bool operator== (const Matrixf &m) const
 Equality operator. More...
 
bool operator!= (const Matrixf &m) const
 Inequality operator. More...
 
Vec3f operator* (const Vec3f &v) const
 Multiply by vector. More...
 
Vec3d operator* (const Vec3d &v) const
 Multiply by vector. More...
 
Vec4f operator* (const Vec4f &v) const
 Multiply by vector. More...
 
Vec4d operator* (const Vec4d &v) const
 Multiply by vector. More...
 
void operator*= (const Matrixf &other)
 Unary Multiply by a matrix. More...
 
Matrixf operator* (const Matrixf &m) const
 Multiply by a matrix. More...
 
Matrixf operator* (value_type rhs) const
 Multiply by scalar. More...
 
Matrixfoperator*= (value_type rhs)
 Unary multiply by scalar. More...
 
Matrixf operator/ (value_type rhs) const
 Divide by scalar. More...
 
Matrixfoperator/= (value_type rhs)
 Unary divide by scalar. More...
 
Matrixf operator+ (const Matrixf &rhs) const
 Binary vector add. More...
 
Matrixfoperator+= (const Matrixf &rhs)
 Unary vector add. More...
 
Matrixf operator- (const Matrixf &rhs) const
 Binary vector subtract. More...
 
Matrixfoperator-= (const Matrixf &rhs)
 Unary vector subtract. More...
 
value_typeoperator() (int row, int col)
 Returns a specific row and column value of the matrix. More...
 
value_type operator() (int row, int col) const
 Returns a specific row and column value of the matrix. More...
 
 operator osg::Matrixf () const
 Implicit conversion operator to OSG Matrix. More...
 
 operator osg::Matrixf & ()
 Implicit conversion operator to OSG Matrix. More...
 
 operator const osg::Matrixf & () const
 Implicit conversion operator to OSG Matrix. More...
 
 operator osg::Matrixf * ()
 Implicit conversion operator to OSG Matrix. More...
 

Static Public Member Functions

static Matrixf Identity (void)
 Static method to create an Identity matrix. More...
 
static Matrixf Scale (const Vec3f &sv)
 Static method to create a Scale matrix. More...
 
static Matrixf Scale (const Vec3d &sv)
 Static method to create a Scale matrix. More...
 
static Matrixf Scale (value_type sx, value_type sy, value_type sz)
 Static method to create a Scale matrix. More...
 
static Matrixf Translate (const Vec3f &dv)
 Static method to create a Translate matrix. More...
 
static Matrixf Translate (const Vec3d &dv)
 Static method to create a Translate matrix. More...
 
static Matrixf Translate (value_type x, value_type y, value_type z)
 Static method to create a Translate matrix. More...
 
static Matrixf Rotate (const Vec3f &from, const Vec3f &to)
 Static method to create a Rotational matrix. More...
 
static Matrixf Rotate (const Vec3d &from, const Vec3d &to)
 Static method to create a Rotational matrix. More...
 
static Matrixf Rotate (value_type angle, value_type x, value_type y, value_type z)
 Static method to create a Rotational matrix. More...
 
static Matrixf Rotate (value_type angle, const Vec3f &axis)
 Static method to create a Rotational matrix. More...
 
static Matrixf Rotate (value_type angle, const Vec3d &axis)
 Static method to create a Rotational matrix. More...
 
static Matrixf Rotate (value_type angle1, const Vec3f &axis1, value_type angle2, const Vec3f &axis2, value_type angle3, const Vec3f &axis3)
 Static method to create a Rotational matrix. More...
 
static Matrixf Rotate (value_type angle1, const Vec3d &axis1, value_type angle2, const Vec3d &axis2, value_type angle3, const Vec3d &axis3)
 Static method to create a Rotational matrix. More...
 
static Matrixf Rotate (const Quat &quat)
 Static method to create a Rotational matrix. More...
 
static Matrixf Inverse (const Matrixf &matrix)
 Static method to create an inverted matrix. More...
 
static Matrixf OrthoNormal (const Matrixf &matrix)
 Static method to create an Ortho Normalized matrix. More...
 
static Matrixf Ortho (double left, double right, double bottom, double top, double zNear, double zFar)
 Create an orthographic projection matrix. More...
 
static Matrixf Ortho (float left, float right, float bottom, float top, float zNear, float zFar)
 Create an orthographic projection matrix. More...
 
static Matrixf Ortho2D (double left, double right, double bottom, double top)
 Create a 2D orthographic projection matrix. More...
 
static Matrixf Ortho2D (float left, float right, float bottom, float top)
 Create a 2D orthographic projection matrix. More...
 
static Matrixf Frustum (double left, double right, double bottom, double top, double zNear, double zFar)
 Create a perspective projection matrix. More...
 
static Matrixf Frustum (float left, float right, float bottom, float top, float zNear, float zFar)
 Create a perspective projection matrix. More...
 
static Matrixf Perspective (float fovy, float aspectRatio, float zNear, float zFar)
 Create a symmetrical perspective projection matrix. More...
 
static Matrixf Perspective (double fovy, double aspectRatio, double zNear, double zFar)
 Create a symmetrical perspective projection matrix. More...
 
static Matrixf LookAt (const Vec3f &eye, const Vec3f &center, const Vec3f &up)
 Create the position and orientation matrix as per a camera, using the same convention as gluLookAt. More...
 
static Matrixf LookAt (const Vec3d &eye, const Vec3d &center, const Vec3d &up)
 Create the position and orientation matrix as per a camera, using the same convention as gluLookAt. More...
 
static Vec3f Transform3x3 (const Vec3f &v, const Matrixf &m)
 Apply a 3x3 transform of v*M[0..2,0..2]. More...
 
static Vec3d Transform3x3 (const Vec3d &v, const Matrixf &m)
 Apply a 3x3 transform of v*M[0..2,0..2]. More...
 
static Vec3f Transform3x3 (const Matrixf &m, const Vec3f &v)
 Apply a 3x3 transform of M[0..2,0..2]*v. More...
 
static Vec3d Transform3x3 (const Matrixf &m, const Vec3d &v)
 Apply a 3x3 transform of M[0..2,0..2]*v. More...
 

Protected Attributes

osg::Matrixf mMatrix
 

Detailed Description

A float Matrix class to be used for generic matrix operations.

Definition at line 41 of file Matrixf.h.

Member Typedef Documentation

◆ value_type

Definition at line 45 of file Matrixf.h.

Constructor & Destructor Documentation

◆ Matrixf() [1/9]

trBase::Matrixf::Matrixf ( )

ctor

◆ Matrixf() [2/9]

trBase::Matrixf::Matrixf ( const osg::Matrixf &  mat)

ctor.

Parameters
matThe matrix.

Definition at line 39 of file Matrixf.cpp.

◆ Matrixf() [3/9]

trBase::Matrixf::Matrixf ( const osg::Matrixd &  mat)

ctor.

Parameters
matThe matrix.

Definition at line 33 of file Matrixf.cpp.

◆ Matrixf() [4/9]

trBase::Matrixf::Matrixf ( const Matrixf mat)

ctor.

Parameters
matThe matrix.

◆ Matrixf() [5/9]

trBase::Matrixf::Matrixf ( const Matrixd mat)

ctor.

Parameters
matThe matrix.

Definition at line 45 of file Matrixf.cpp.

◆ Matrixf() [6/9]

trBase::Matrixf::Matrixf ( float const *const  ptr)
explicit

ctor that takes a 4x4 array of floats and uses them as matrix input.

Parameters
ptrThe pointer.

◆ Matrixf() [7/9]

trBase::Matrixf::Matrixf ( double const *const  ptr)
explicit

ctor that takes a 4x4 array of double and uses them as matrix input.

Parameters
ptrThe pointer.

◆ Matrixf() [8/9]

trBase::Matrixf::Matrixf ( const Quat quat)
explicit

ctor that takes a quaternion and uses it as matrix input.

Parameters
quatThe quaternion.

◆ Matrixf() [9/9]

trBase::Matrixf::Matrixf ( value_type  a00,
value_type  a01,
value_type  a02,
value_type  a03,
value_type  a10,
value_type  a11,
value_type  a12,
value_type  a13,
value_type  a20,
value_type  a21,
value_type  a22,
value_type  a23,
value_type  a30,
value_type  a31,
value_type  a32,
value_type  a33 
)

ctor.

Parameters
a00The [0][0] value of the matrix.
a01The [0][1] value of the matrix.
a02The [0][2] value of the matrix.
a03The [0][3] value of the matrix.
a10The [1][0] value of the matrix.
a11The [1][1] value of the matrix.
a12The [1][2] value of the matrix.
a13The [1][3] value of the matrix.
a20The [2][0] value of the matrix.
a21The [2][1] value of the matrix.
a22The [2][2] value of the matrix.
a23The [2][3] value of the matrix.
a30The [3][0] value of the matrix.
a31The [3][1] value of the matrix.
a32The [3][2] value of the matrix.
a33The [3][3] value of the matrix.

◆ ~Matrixf()

trBase::Matrixf::~Matrixf ( )

dtor.

Definition at line 64 of file Matrixf.cpp.

Member Function Documentation

◆ Compare()

int trBase::Matrixf::Compare ( const Matrixf m) const

Compare the current Matrix to the passed in one.

Returns -1, 0, or 1.

Parameters
mThe constant matrixf& to compare to this object.
Returns
Negative if 'm' is less than '', 0 if they are equal, or positive if it is greater.

◆ Decompose() [1/2]

void trBase::Matrixf::Decompose ( Vec3f translation,
Quat rotation,
Vec3f scale,
Quat so 
) const

Decomposes the matrix into translation, rotation, scale and scale orientation.

Parameters
[in,out]translationThe translation.
[in,out]rotationThe rotation.
[in,out]scaleThe scale.
[in,out]soThe so.

◆ Decompose() [2/2]

void trBase::Matrixf::Decompose ( Vec3d translation,
Quat rotation,
Vec3d scale,
Quat so 
) const

Decompose the matrix into translation, rotation, scale and scale orientation.

Parameters
[in,out]translationThe translation.
[in,out]rotationThe rotation.
[in,out]scaleThe scale.
[in,out]soThe so.

◆ Frustum() [1/2]

Matrixf trBase::Matrixf::Frustum ( double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)
static

Create a perspective projection matrix.

See glFrustum for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.
zNearThe near.
zFarThe far.
Returns
A Matrixf.

Definition at line 126 of file Matrixf.cpp.

References MakeFrustum().

Here is the call graph for this function:

◆ Frustum() [2/2]

static Matrixf trBase::Matrixf::Frustum ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)
static

Create a perspective projection matrix.

See glFrustum for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.
zNearThe near.
zFarThe far.
Returns
A Matrixf.

◆ GetFrustum() [1/2]

bool trBase::Matrixf::GetFrustum ( double &  left,
double &  right,
double &  bottom,
double &  top,
double &  zNear,
double &  zFar 
) const

Get the frustum settings of a perspective projection matrix.

Note, if matrix is not a perspective matrix then invalid values will be returned.

Parameters
[in,out]leftThe left.
[in,out]rightThe right.
[in,out]bottomThe bottom.
[in,out]topThe top.
[in,out]zNearThe near.
[in,out]zFarThe far.
Returns
True if it succeeds, false if it fails.

Definition at line 92 of file Matrixf.cpp.

References mMatrix.

◆ GetFrustum() [2/2]

bool trBase::Matrixf::GetFrustum ( float &  left,
float &  right,
float &  bottom,
float &  top,
float &  zNear,
float &  zFar 
) const

float version of getFrustum(..) Get the frustum settings of a perspective projection matrix.

Note, if matrix is not a perspective matrix then invalid values will be returned.

Parameters
[in,out]leftThe left.
[in,out]rightThe right.
[in,out]bottomThe bottom.
[in,out]topThe top.
[in,out]zNearThe near.
[in,out]zFarThe far.
Returns
True if it succeeds, false if it fails.

◆ GetLookAt() [1/2]

void trBase::Matrixf::GetLookAt ( Vec3f eye,
Vec3f center,
Vec3f up,
value_type  lookDistance = 1.0f 
) const

Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt.

Parameters
[in,out]eyeThe eye.
[in,out]centerThe center.
[in,out]upThe up.
lookDistance(Optional) The look distance.

◆ GetLookAt() [2/2]

void trBase::Matrixf::GetLookAt ( Vec3d eye,
Vec3d center,
Vec3d up,
value_type  lookDistance = 1.0f 
) const

Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt.

Parameters
[in,out]eyeThe eye.
[in,out]centerThe center.
[in,out]upThe up.
lookDistance(Optional) The look distance.

◆ GetOrtho() [1/2]

bool trBase::Matrixf::GetOrtho ( double &  left,
double &  right,
double &  bottom,
double &  top,
double &  zNear,
double &  zFar 
) const

Get the orthographic settings of the orthographic projection matrix.

Note, if matrix is not an orthographic matrix then invalid values will be returned.

Parameters
[in,out]leftThe left.
[in,out]rightThe right.
[in,out]bottomThe bottom.
[in,out]topThe top.
[in,out]zNearThe near.
[in,out]zFarThe far.
Returns
True if it succeeds, false if it fails.

Definition at line 74 of file Matrixf.cpp.

References mMatrix.

◆ GetOrtho() [2/2]

bool trBase::Matrixf::GetOrtho ( float &  left,
float &  right,
float &  bottom,
float &  top,
float &  zNear,
float &  zFar 
) const

float version of getOrtho(..) Get the orthographic settings of the orthographic projection matrix.

Note, if matrix is not an orthographic matrix then invalid values will be returned.

Parameters
[in,out]leftThe left.
[in,out]rightThe right.
[in,out]bottomThe bottom.
[in,out]topThe top.
[in,out]zNearThe near.
[in,out]zFarThe far.
Returns
True if it succeeds, false if it fails.

◆ GetOSGMatrix() [1/2]

osg::Matrixf & trBase::Matrixf::GetOSGMatrix ( )

Returns a reference to the internal OSG Matrix.

Returns
The osg matrix.

◆ GetOSGMatrix() [2/2]

const osg::Matrixf & trBase::Matrixf::GetOSGMatrix ( ) const

Returns a reference to the internal OSG Matrix.

Returns
The osg matrix.

◆ GetPerspective() [1/2]

bool trBase::Matrixf::GetPerspective ( double &  fovy,
double &  aspectRatio,
double &  zNear,
double &  zFar 
) const

Get the frustum settings of a symmetric perspective projection matrix.

Return false if matrix is not a perspective matrix, where parameter values are undefined. Note, if matrix is not a symmetric perspective matrix then the shear will be lost.

Parameters
[in,out]fovyThe fovy.
[in,out]aspectRatioThe aspect ratio.
[in,out]zNearThe near.
[in,out]zFarThe far.
Returns
True if it succeeds, false if it fails.

Definition at line 104 of file Matrixf.cpp.

References mMatrix.

◆ GetPerspective() [2/2]

bool trBase::Matrixf::GetPerspective ( float &  fovy,
float &  aspectRatio,
float &  zNear,
float &  zFar 
) const

float version of getPerspective(..) Get the frustum settings of a symmetric perspective projection matrix.

Return false if matrix is not a perspective matrix, where parameter values are undefined. Note, if matrix is not a symmetric perspective matrix then the shear will be lost.

Parameters
[in,out]fovyThe fovy.
[in,out]aspectRatioThe aspect ratio.
[in,out]zNearThe near.
[in,out]zFarThe far.
Returns
True if it succeeds, false if it fails.

◆ GetRotate()

Quat trBase::Matrixf::GetRotate ( ) const

Get the matrix rotation as a Quat.

Note that this function assumes a non-scaled matrix and will return incorrect results for scaled matrixces. Consider decompose() instead.

Returns
The rotate.

◆ GetScale()

Vec3d trBase::Matrixf::GetScale ( ) const

Returns the matrix scale.

Returns
The scale.

◆ GetTrans()

Vec3d trBase::Matrixf::GetTrans ( ) const

Returns the translation area of the matrix.

Returns
The transaction.

◆ Identity()

static Matrixf trBase::Matrixf::Identity ( void  )
static

Static method to create an Identity matrix.

Returns
A Matrixf.

◆ Inverse()

static Matrixf trBase::Matrixf::Inverse ( const Matrixf matrix)
static

Static method to create an inverted matrix.

Parameters
matrixThe matrix.
Returns
A Matrixf.

◆ Invert()

bool trBase::Matrixf::Invert ( const Matrixf rhs)

Invert the matrix rhs, automatically select invert_4x3 or invert_4x4.

Parameters
rhsThe right hand side.
Returns
True if it succeeds, false if it fails.

◆ Invert_4x3()

bool trBase::Matrixf::Invert_4x3 ( const Matrixf rhs)

4x3 matrix invert, not right hand column is assumed to be 0,0,0,1.

Parameters
rhsThe right hand side.
Returns
True if it succeeds, false if it fails.

◆ Invert_4x4()

bool trBase::Matrixf::Invert_4x4 ( const Matrixf rhs)

Full 4x4 matrix invert.

Parameters
rhsThe right hand side.
Returns
True if it succeeds, false if it fails.

◆ IsNaN()

bool trBase::Matrixf::IsNaN ( ) const

Returns true if the Matrix is NaN.

Returns
True if nan, false if not.

◆ LookAt() [1/2]

static Matrixf trBase::Matrixf::LookAt ( const Vec3f eye,
const Vec3f center,
const Vec3f up 
)
static

Create the position and orientation matrix as per a camera, using the same convention as gluLookAt.

Parameters
eyeThe eye.
centerThe center.
upThe up.
Returns
A Matrixf.

◆ LookAt() [2/2]

static Matrixf trBase::Matrixf::LookAt ( const Vec3d eye,
const Vec3d center,
const Vec3d up 
)
static

Create the position and orientation matrix as per a camera, using the same convention as gluLookAt.

Parameters
eyeThe eye.
centerThe center.
upThe up.
Returns
A Matrixf.

◆ MakeFrustum() [1/2]

void trBase::Matrixf::MakeFrustum ( double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)

Set to a perspective projection.

See glFrustum for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.
zNearThe near.
zFarThe far.

Definition at line 86 of file Matrixf.cpp.

References mMatrix.

Referenced by Frustum().

Here is the caller graph for this function:

◆ MakeFrustum() [2/2]

void trBase::Matrixf::MakeFrustum ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)

Set to a perspective projection.

See glFrustum for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.
zNearThe near.
zFarThe far.

◆ MakeIdentity()

void trBase::Matrixf::MakeIdentity ( )

Reset this matrix to be an Identity Matrix.

◆ MakeLookAt() [1/2]

void trBase::Matrixf::MakeLookAt ( const Vec3f eye,
const Vec3f center,
const Vec3f up 
)

Set the position and orientation to be a view matrix, using the same convention as gluLookAt.

Parameters
eyeThe eye.
centerThe center.
upThe up.

◆ MakeLookAt() [2/2]

void trBase::Matrixf::MakeLookAt ( const Vec3d eye,
const Vec3d center,
const Vec3d up 
)

Set the position and orientation to be a view matrix, using the same convention as gluLookAt.

Parameters
eyeThe eye.
centerThe center.
upThe up.

◆ MakeOrtho() [1/2]

void trBase::Matrixf::MakeOrtho ( double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)

Set to an orthographic projection.

See glOrtho for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.
zNearThe near.
zFarThe far.

Definition at line 68 of file Matrixf.cpp.

References mMatrix.

Referenced by Ortho().

Here is the caller graph for this function:

◆ MakeOrtho() [2/2]

void trBase::Matrixf::MakeOrtho ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)

Set to an orthographic projection.

See glOrtho for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.
zNearThe near.
zFarThe far.

◆ MakeOrtho2D() [1/2]

void trBase::Matrixf::MakeOrtho2D ( double  left,
double  right,
double  bottom,
double  top 
)

Set to a 2D orthographic projection.

See glOrtho2D for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.

Definition at line 80 of file Matrixf.cpp.

References mMatrix.

Referenced by Ortho2D().

Here is the caller graph for this function:

◆ MakeOrtho2D() [2/2]

void trBase::Matrixf::MakeOrtho2D ( float  left,
float  right,
float  bottom,
float  top 
)

Set to a 2D orthographic projection.

See glOrtho2D for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.

◆ MakePerspective() [1/2]

void trBase::Matrixf::MakePerspective ( double  fovy,
double  aspectRatio,
double  zNear,
double  zFar 
)

Set to a symmetrical perspective projection.

See gluPerspective for further details. Aspect ratio is defined as width/height.

Parameters
fovyThe fovy.
aspectRatioThe aspect ratio.
zNearThe near.
zFarThe far.

Definition at line 98 of file Matrixf.cpp.

References mMatrix.

Referenced by Perspective().

Here is the caller graph for this function:

◆ MakePerspective() [2/2]

void trBase::Matrixf::MakePerspective ( float  fovy,
float  aspectRatio,
float  zNear,
float  zFar 
)

Set to a symmetrical perspective projection.

See gluPerspective for further details. Aspect ratio is defined as width/height.

Parameters
fovyThe fovy.
aspectRatioThe aspect ratio.
zNearThe near.
zFarThe far.

◆ MakeRotate() [1/8]

void trBase::Matrixf::MakeRotate ( const Vec3f from,
const Vec3f to 
)

Reset this matrix to be a rotational matrix of the passed in value.

Parameters
fromSource for the.
toto.

◆ MakeRotate() [2/8]

void trBase::Matrixf::MakeRotate ( const Vec3d from,
const Vec3d to 
)

Reset this matrix to be a rotational matrix of the passed in value.

Parameters
fromSource for the.
toto.

◆ MakeRotate() [3/8]

void trBase::Matrixf::MakeRotate ( value_type  angle,
const Vec3f axis 
)

Reset this matrix to be a rotational matrix of the passed in value.

Parameters
angleThe angle.
axisThe axis.

◆ MakeRotate() [4/8]

void trBase::Matrixf::MakeRotate ( value_type  angle,
const Vec3d axis 
)

Reset this matrix to be a rotational matrix of the passed in value.

Parameters
angleThe angle.
axisThe axis.

◆ MakeRotate() [5/8]

void trBase::Matrixf::MakeRotate ( value_type  angle,
value_type  x,
value_type  y,
value_type  z 
)

Reset this matrix to be a rotational matrix of the passed in value.

Parameters
angleThe angle.
xThe value_type to process.
yThe value_type to process.
zThe value_type to process.

◆ MakeRotate() [6/8]

void trBase::Matrixf::MakeRotate ( const Quat q)

Reset this matrix to be a rotational matrix of the passed in value.

Parameters
qThe Quat to process.

◆ MakeRotate() [7/8]

void trBase::Matrixf::MakeRotate ( value_type  angle1,
const Vec3f axis1,
value_type  angle2,
const Vec3f axis2,
value_type  angle3,
const Vec3f axis3 
)

Reset this matrix to be a rotational matrix of the passed in value.

Parameters
angle1The first angle.
axis1The first axis.
angle2The second angle.
axis2The second axis.
angle3The third angle.
axis3The third axis.

◆ MakeRotate() [8/8]

void trBase::Matrixf::MakeRotate ( value_type  angle1,
const Vec3d axis1,
value_type  angle2,
const Vec3d axis2,
value_type  angle3,
const Vec3d axis3 
)

Reset this matrix to be a rotational matrix of the passed in value.

Parameters
angle1The first angle.
axis1The first axis.
angle2The second angle.
axis2The second axis.
angle3The third angle.
axis3The third axis.

◆ MakeScale() [1/3]

void trBase::Matrixf::MakeScale ( const Vec3f v)

Reset this matrix to be a scale matrix of the passed in value.

Parameters
vThe Vec3f to process.

◆ MakeScale() [2/3]

void trBase::Matrixf::MakeScale ( const Vec3d v)

Reset this matrix to be a scale matrix of the passed in value.

Parameters
vThe Vec3d to process.

◆ MakeScale() [3/3]

void trBase::Matrixf::MakeScale ( value_type  x,
value_type  y,
value_type  z 
)

Reset this matrix to be a scale matrix of the passed in value.

Parameters
xThe value_type to process.
yThe value_type to process.
zThe value_type to process.

◆ MakeTranslate() [1/3]

void trBase::Matrixf::MakeTranslate ( const Vec3f v)

Reset this matrix to be a translation matrix of the passed in value.

Parameters
vThe Vec3f to process.

◆ MakeTranslate() [2/3]

void trBase::Matrixf::MakeTranslate ( const Vec3d v)

Reset this matrix to be a translation matrix of the passed in value.

Parameters
vThe Vec3d to process.

◆ MakeTranslate() [3/3]

void trBase::Matrixf::MakeTranslate ( value_type  x,
value_type  y,
value_type  z 
)

Reset this matrix to be a translation matrix of the passed in value.

Parameters
xThe value_type to process.
yThe value_type to process.
zThe value_type to process.

◆ Mult()

void trBase::Matrixf::Mult ( const Matrixf m1,
const Matrixf m2 
)

Basic Matrixf multiplication, our workhorse methods.

Parameters
m1The first Matrixf.
m2The second Matrixf.

◆ operator const osg::Matrixf &()

trBase::Matrixf::operator const osg::Matrixf & ( ) const

Implicit conversion operator to OSG Matrix.

Returns
A const.

◆ operator osg::Matrixf()

trBase::Matrixf::operator osg::Matrixf ( ) const

Implicit conversion operator to OSG Matrix.

Returns
The result of the operation.

◆ operator osg::Matrixf &()

trBase::Matrixf::operator osg::Matrixf & ( )

Implicit conversion operator to OSG Matrix.

Returns
The result of the operation.

◆ operator osg::Matrixf *()

trBase::Matrixf::operator osg::Matrixf * ( )

Implicit conversion operator to OSG Matrix.

Returns
The result of the operation.

◆ operator!=()

bool trBase::Matrixf::operator!= ( const Matrixf m) const

Inequality operator.

Parameters
mThe Matrixf to process.
Returns
True if the parameters are not considered equivalent.

◆ operator()() [1/2]

value_type & trBase::Matrixf::operator() ( int  row,
int  col 
)

Returns a specific row and column value of the matrix.

Parameters
rowThe row.
colThe col.
Returns
The result of the operation.

◆ operator()() [2/2]

value_type trBase::Matrixf::operator() ( int  row,
int  col 
) const

Returns a specific row and column value of the matrix.

Parameters
rowThe row.
colThe col.
Returns
The result of the operation.

◆ operator*() [1/6]

Vec3f trBase::Matrixf::operator* ( const Vec3f v) const

Multiply by vector.

Parameters
vThe Vec3f to process.
Returns
The result of the operation.

◆ operator*() [2/6]

Vec3d trBase::Matrixf::operator* ( const Vec3d v) const

Multiply by vector.

Parameters
vThe Vec3d to process.
Returns
The result of the operation.

◆ operator*() [3/6]

Vec4f trBase::Matrixf::operator* ( const Vec4f v) const

Multiply by vector.

Parameters
vThe Vec4f to process.
Returns
The result of the operation.

◆ operator*() [4/6]

Vec4d trBase::Matrixf::operator* ( const Vec4d v) const

Multiply by vector.

Parameters
vThe Vec4d to process.
Returns
The result of the operation.

◆ operator*() [5/6]

Matrixf trBase::Matrixf::operator* ( const Matrixf m) const

Multiply by a matrix.

Parameters
mThe Matrixf to process.
Returns
The result of the operation.

◆ operator*() [6/6]

Matrixf trBase::Matrixf::operator* ( value_type  rhs) const

Multiply by scalar.

Parameters
rhsThe right hand side.
Returns
The result of the operation.

◆ operator*=() [1/2]

void trBase::Matrixf::operator*= ( const Matrixf other)

Unary Multiply by a matrix.

Parameters
otherThe other.

◆ operator*=() [2/2]

Matrixf & trBase::Matrixf::operator*= ( value_type  rhs)

Unary multiply by scalar.

More efficient than *.

Parameters
rhsThe right hand side.
Returns
The result of the operation.

◆ operator+()

Matrixf trBase::Matrixf::operator+ ( const Matrixf rhs) const

Binary vector add.

Parameters
rhsThe right hand side.
Returns
The result of the operation.

◆ operator+=()

Matrixf & trBase::Matrixf::operator+= ( const Matrixf rhs)

Unary vector add.

More efficient than +.

Parameters
rhsThe right hand side.
Returns
The result of the operation.

◆ operator-()

Matrixf trBase::Matrixf::operator- ( const Matrixf rhs) const

Binary vector subtract.

Parameters
rhsThe right hand side.
Returns
The result of the operation.

◆ operator-=()

Matrixf & trBase::Matrixf::operator-= ( const Matrixf rhs)

Unary vector subtract.

More efficient than -.

Parameters
rhsThe right hand side.
Returns
The result of the operation.

◆ operator/()

Matrixf trBase::Matrixf::operator/ ( value_type  rhs) const

Divide by scalar.

Parameters
rhsThe right hand side.
Returns
The result of the operation.

◆ operator/=()

Matrixf & trBase::Matrixf::operator/= ( value_type  rhs)

Unary divide by scalar.

More efficient than /.

Parameters
rhsThe right hand side.
Returns
The result of the operation.

◆ operator<()

bool trBase::Matrixf::operator< ( const Matrixf m) const

Less than by operator.

Parameters
mThe Matrixf to process.
Returns
True if the first parameter is less than the second.

◆ operator=() [1/2]

Matrixf & trBase::Matrixf::operator= ( const Matrixf rhs)

Set operator.

Parameters
rhsThe right hand side.
Returns
A shallow copy of this object.

◆ operator=() [2/2]

Matrixf & trBase::Matrixf::operator= ( const Matrixd rhs)

Set operator.

Parameters
rhsThe right hand side.
Returns
A shallow copy of this object.

Definition at line 51 of file Matrixf.cpp.

References trBase::Matrixd::Ptr(), and Set().

Here is the call graph for this function:

◆ operator==()

bool trBase::Matrixf::operator== ( const Matrixf m) const

Equality operator.

Parameters
mThe Matrixf to process.
Returns
True if the parameters are considered equivalent.

◆ operator>()

bool trBase::Matrixf::operator> ( const Matrixf m) const

Greater than by operator.

Parameters
mThe Matrixf to process.
Returns
True if the first parameter is greater than to the second.

◆ Ortho() [1/2]

Matrixf trBase::Matrixf::Ortho ( double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)
static

Create an orthographic projection matrix.

See glOrtho for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.
zNearThe near.
zFarThe far.
Returns
A Matrixf.

Definition at line 110 of file Matrixf.cpp.

References MakeOrtho().

Here is the call graph for this function:

◆ Ortho() [2/2]

static Matrixf trBase::Matrixf::Ortho ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)
static

Create an orthographic projection matrix.

See glOrtho for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.
zNearThe near.
zFarThe far.
Returns
A Matrixf.

◆ Ortho2D() [1/2]

Matrixf trBase::Matrixf::Ortho2D ( double  left,
double  right,
double  bottom,
double  top 
)
static

Create a 2D orthographic projection matrix.

See glOrtho for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.
Returns
A Matrixf.

Definition at line 118 of file Matrixf.cpp.

References MakeOrtho2D().

Here is the call graph for this function:

◆ Ortho2D() [2/2]

static Matrixf trBase::Matrixf::Ortho2D ( float  left,
float  right,
float  bottom,
float  top 
)
static

Create a 2D orthographic projection matrix.

See glOrtho for further details.

Parameters
leftThe left.
rightThe right.
bottomThe bottom.
topThe top.
Returns
A Matrixf.

◆ OrthoNormal()

static Matrixf trBase::Matrixf::OrthoNormal ( const Matrixf matrix)
static

Static method to create an Ortho Normalized matrix.

Parameters
matrixThe matrix.
Returns
A Matrixf.

◆ OrthoNormalize()

void trBase::Matrixf::OrthoNormalize ( const Matrixf rhs)

Ortho-normalize the 3x3 rotation & scale matrix.

Parameters
rhsThe right hand side.

◆ Perspective() [1/2]

static Matrixf trBase::Matrixf::Perspective ( float  fovy,
float  aspectRatio,
float  zNear,
float  zFar 
)
static

Create a symmetrical perspective projection matrix.

See gluPerspective for further details. Aspect ratio is defined as width/height.

Parameters
fovyThe fovy.
aspectRatioThe aspect ratio.
zNearThe near.
zFarThe far.
Returns
A Matrixf.

◆ Perspective() [2/2]

Matrixf trBase::Matrixf::Perspective ( double  fovy,
double  aspectRatio,
double  zNear,
double  zFar 
)
static

Create a symmetrical perspective projection matrix.

See gluPerspective for further details. Aspect ratio is defined as width/height.

Parameters
fovyThe fovy.
aspectRatioThe aspect ratio.
zNearThe near.
zFarThe far.
Returns
A Matrixf.

Definition at line 134 of file Matrixf.cpp.

References MakePerspective().

Here is the call graph for this function:

◆ PostMult() [1/5]

Vec3f trBase::Matrixf::PostMult ( const Vec3f v) const

PostMultiply the matrix by the passed in vector.

Parameters
vThe Vec3f to process.
Returns
A Vec3f.

◆ PostMult() [2/5]

Vec3d trBase::Matrixf::PostMult ( const Vec3d v) const

PostMultiply the matrix by the passed in vector.

Parameters
vThe Vec3d to process.
Returns
A Vec3d.

◆ PostMult() [3/5]

Vec4f trBase::Matrixf::PostMult ( const Vec4f v) const

PostMultiply the matrix by the passed in vector.

Parameters
vThe Vec4f to process.
Returns
A Vec4f.

◆ PostMult() [4/5]

Vec4d trBase::Matrixf::PostMult ( const Vec4d v) const

PostMultiply the matrix by the passed in vector.

Parameters
vThe Vec4d to process.
Returns
A Vec4d.

◆ PostMult() [5/5]

void trBase::Matrixf::PostMult ( const Matrixf m)

Basic Matrixf multiplication, our workhorse methods.

Parameters
mThe Matrixf to process.

◆ PostMultRotate()

void trBase::Matrixf::PostMultRotate ( const Quat q)

Optimized version of postMult(rotate(q));.

Parameters
qThe Quat to process.

◆ PostMultScale() [1/2]

void trBase::Matrixf::PostMultScale ( const Vec3d v)

Optimized version of postMult(scale(v));.

Parameters
vThe Vec3d to process.

◆ PostMultScale() [2/2]

void trBase::Matrixf::PostMultScale ( const Vec3f v)

Optimized version of postMult(scale(v));.

Parameters
vThe Vec3f to process.

◆ PostMultTranslate() [1/2]

void trBase::Matrixf::PostMultTranslate ( const Vec3d v)

Optimized version of postMult(translate(v));.

Parameters
vThe Vec3d to process.

◆ PostMultTranslate() [2/2]

void trBase::Matrixf::PostMultTranslate ( const Vec3f v)

Optimized version of postMult(translate(v));.

Parameters
vThe Vec3f to process.

◆ PreMult() [1/5]

Vec3f trBase::Matrixf::PreMult ( const Vec3f v) const

PreMultiply the matrix by the passed in vector.

Parameters
vThe Vec3f to process.
Returns
A Vec3f.

◆ PreMult() [2/5]

Vec3d trBase::Matrixf::PreMult ( const Vec3d v) const

PreMultiply the matrix by the passed in vector.

Parameters
vThe Vec3d to process.
Returns
A Vec3d.

◆ PreMult() [3/5]

Vec4f trBase::Matrixf::PreMult ( const Vec4f v) const

PreMultiply the matrix by the passed in vector.

Parameters
vThe Vec4f to process.
Returns
A Vec4f.

◆ PreMult() [4/5]

Vec4d trBase::Matrixf::PreMult ( const Vec4d v) const

PreMultiply the matrix by the passed in vector.

Parameters
vThe Vec4d to process.
Returns
A Vec4d.

◆ PreMult() [5/5]

void trBase::Matrixf::PreMult ( const Matrixf m)

Basic Matrixf multiplication, our workhorse methods.

Parameters
mThe Matrixf to process.

◆ PreMultRotate()

void trBase::Matrixf::PreMultRotate ( const Quat q)

Optimized version of preMult(rotate(q));.

Parameters
qThe Quat to process.

◆ PreMultScale() [1/2]

void trBase::Matrixf::PreMultScale ( const Vec3d v)

Optimized version of preMult(scale(v));.

Parameters
vThe Vec3d to process.

◆ PreMultScale() [2/2]

void trBase::Matrixf::PreMultScale ( const Vec3f v)

Optimized version of preMult(scale(v));.

Parameters
vThe Vec3f to process.

◆ PreMultTranslate() [1/2]

void trBase::Matrixf::PreMultTranslate ( const Vec3d v)

Optimized version of preMult(translate(v));.

Parameters
vThe Vec3d to process.

◆ PreMultTranslate() [2/2]

void trBase::Matrixf::PreMultTranslate ( const Vec3f v)

Optimized version of preMult(translate(v));.

Parameters
vThe Vec3f to process.

◆ Ptr() [1/2]

value_type * trBase::Matrixf::Ptr ( )

Pointer to the internal Matrix array.

Returns
Null if it fails, else a pointer to a value_type.

Referenced by trBase::Matrixd::operator=(), and trBase::Matrixd::Set().

Here is the caller graph for this function:

◆ Ptr() [2/2]

const value_type * trBase::Matrixf::Ptr ( ) const

Pointer to the internal Matrix array.

Returns
Null if it fails, else a pointer to a const value_type.

◆ Rotate() [1/8]

static Matrixf trBase::Matrixf::Rotate ( const Vec3f from,
const Vec3f to 
)
static

Static method to create a Rotational matrix.

Parameters
fromSource for the.
toto.
Returns
A Matrixf.

◆ Rotate() [2/8]

static Matrixf trBase::Matrixf::Rotate ( const Vec3d from,
const Vec3d to 
)
static

Static method to create a Rotational matrix.

Parameters
fromSource for the.
toto.
Returns
A Matrixf.

◆ Rotate() [3/8]

static Matrixf trBase::Matrixf::Rotate ( value_type  angle,
value_type  x,
value_type  y,
value_type  z 
)
static

Static method to create a Rotational matrix.

Parameters
angleThe angle.
xThe value_type to process.
yThe value_type to process.
zThe value_type to process.
Returns
A Matrixf.

◆ Rotate() [4/8]

static Matrixf trBase::Matrixf::Rotate ( value_type  angle,
const Vec3f axis 
)
static

Static method to create a Rotational matrix.

Parameters
angleThe angle.
axisThe axis.
Returns
A Matrixf.

◆ Rotate() [5/8]

static Matrixf trBase::Matrixf::Rotate ( value_type  angle,
const Vec3d axis 
)
static

Static method to create a Rotational matrix.

Parameters
angleThe angle.
axisThe axis.
Returns
A Matrixf.

◆ Rotate() [6/8]

static Matrixf trBase::Matrixf::Rotate ( value_type  angle1,
const Vec3f axis1,
value_type  angle2,
const Vec3f axis2,
value_type  angle3,
const Vec3f axis3 
)
static

Static method to create a Rotational matrix.

Parameters
angle1The first angle.
axis1The first axis.
angle2The second angle.
axis2The second axis.
angle3The third angle.
axis3The third axis.
Returns
A Matrixf.

◆ Rotate() [7/8]

static Matrixf trBase::Matrixf::Rotate ( value_type  angle1,
const Vec3d axis1,
value_type  angle2,
const Vec3d axis2,
value_type  angle3,
const Vec3d axis3 
)
static

Static method to create a Rotational matrix.

Parameters
angle1The first angle.
axis1The first axis.
angle2The second angle.
axis2The second axis.
angle3The third angle.
axis3The third axis.
Returns
A Matrixf.

◆ Rotate() [8/8]

static Matrixf trBase::Matrixf::Rotate ( const Quat quat)
static

Static method to create a Rotational matrix.

Parameters
quatThe quaternion.
Returns
A Matrixf.

◆ Scale() [1/3]

static Matrixf trBase::Matrixf::Scale ( const Vec3f sv)
static

Static method to create a Scale matrix.

Parameters
svThe sv.
Returns
A Matrixf.

◆ Scale() [2/3]

static Matrixf trBase::Matrixf::Scale ( const Vec3d sv)
static

Static method to create a Scale matrix.

Parameters
svThe sv.
Returns
A Matrixf.

◆ Scale() [3/3]

static Matrixf trBase::Matrixf::Scale ( value_type  sx,
value_type  sy,
value_type  sz 
)
static

Static method to create a Scale matrix.

Parameters
sxThe sx.
syThe sy.
szThe size.
Returns
A Matrixf.

◆ Set() [1/5]

void trBase::Matrixf::Set ( const Matrixf rhs)

Set the current Matrix from a passed in one.

Parameters
rhsThe Right hand side to set.

Referenced by operator=(), and Set().

Here is the caller graph for this function:

◆ Set() [2/5]

void trBase::Matrixf::Set ( const Matrixd rhs)

Set the current Matrix from a passed in one.

Parameters
rhsThe Right hand side to set.

Definition at line 58 of file Matrixf.cpp.

References trBase::Matrixd::Ptr(), and Set().

Here is the call graph for this function:

◆ Set() [3/5]

void trBase::Matrixf::Set ( float const *const  ptr)

Set the current Matrix from a passed in values array.

Parameters
ptrThe pointer.

◆ Set() [4/5]

void trBase::Matrixf::Set ( double const *const  ptr)

Set the current Matrix from a passed in values array.

Parameters
ptrThe pointer.

◆ Set() [5/5]

void trBase::Matrixf::Set ( value_type  a00,
value_type  a01,
value_type  a02,
value_type  a03,
value_type  a10,
value_type  a11,
value_type  a12,
value_type  a13,
value_type  a20,
value_type  a21,
value_type  a22,
value_type  a23,
value_type  a30,
value_type  a31,
value_type  a32,
value_type  a33 
)

Set the current Matrix from a passed in values.

Parameters
a00The [0][0] value of the matrix.
a01The [0][1] value of the matrix.
a02The [0][2] value of the matrix.
a03The [0][3] value of the matrix.
a10The [1][0] value of the matrix.
a11The [1][1] value of the matrix.
a12The [1][2] value of the matrix.
a13The [1][3] value of the matrix.
a20The [2][0] value of the matrix.
a21The [2][1] value of the matrix.
a22The [2][2] value of the matrix.
a23The [2][3] value of the matrix.
a30The [3][0] value of the matrix.
a31The [3][1] value of the matrix.
a32The [3][2] value of the matrix.
a33The [3][3] value of the matrix.

◆ SetRotate()

void trBase::Matrixf::SetRotate ( const Quat q)

Applies the rotation to the matrix.

Parameters
qThe Quat to process.

◆ SetScale() [1/3]

void trBase::Matrixf::SetScale ( value_type  x,
value_type  y,
value_type  z 
)

Sets the scale values of the matrix.

Parameters
xThe value_type to process.
yThe value_type to process.
zThe value_type to process.

◆ SetScale() [2/3]

void trBase::Matrixf::SetScale ( const Vec3f v)

Sets the scale values of the matrix.

Parameters
vThe Vec3f to process.

◆ SetScale() [3/3]

void trBase::Matrixf::SetScale ( const Vec3d v)

Sets the scale values of the matrix.

Parameters
vThe Vec3d to process.

◆ SetTrans() [1/3]

void trBase::Matrixf::SetTrans ( value_type  tx,
value_type  ty,
value_type  tz 
)

Sets the translation area of the matrix.

Parameters
txThe transmit.
tyThe ty.
tzThe tz.

◆ SetTrans() [2/3]

void trBase::Matrixf::SetTrans ( const Vec3f v)

Sets the translation area of the matrix.

Parameters
vThe Vec3f to process.

◆ SetTrans() [3/3]

void trBase::Matrixf::SetTrans ( const Vec3d v)

Sets the translation area of the matrix.

Parameters
vThe Vec3d to process.

◆ ToString()

std::string trBase::Matrixf::ToString ( int  precision = -1)

Convert this object into a string representation.

Parameters
precision(Optional) The precision.
Returns
A std::string that represents this object.

◆ Transform3x3() [1/4]

static Vec3f trBase::Matrixf::Transform3x3 ( const Vec3f v,
const Matrixf m 
)
static

Apply a 3x3 transform of v*M[0..2,0..2].

Parameters
vThe Vec3f to process.
mThe Matrixf to process.
Returns
A Vec3f.

◆ Transform3x3() [2/4]

static Vec3d trBase::Matrixf::Transform3x3 ( const Vec3d v,
const Matrixf m 
)
static

Apply a 3x3 transform of v*M[0..2,0..2].

Parameters
vThe Vec3d to process.
mThe Matrixf to process.
Returns
A Vec3d.

◆ Transform3x3() [3/4]

static Vec3f trBase::Matrixf::Transform3x3 ( const Matrixf m,
const Vec3f v 
)
static

Apply a 3x3 transform of M[0..2,0..2]*v.

Parameters
mThe Matrixf to process.
vThe Vec3f to process.
Returns
A Vec3f.

◆ Transform3x3() [4/4]

static Vec3d trBase::Matrixf::Transform3x3 ( const Matrixf m,
const Vec3d v 
)
static

Apply a 3x3 transform of M[0..2,0..2]*v.

Parameters
mThe Matrixf to process.
vThe Vec3d to process.
Returns
A Vec3d.

◆ Translate() [1/3]

static Matrixf trBase::Matrixf::Translate ( const Vec3f dv)
static

Static method to create a Translate matrix.

Parameters
dvThe dv.
Returns
A Matrixf.

◆ Translate() [2/3]

static Matrixf trBase::Matrixf::Translate ( const Vec3d dv)
static

Static method to create a Translate matrix.

Parameters
dvThe dv.
Returns
A Matrixf.

◆ Translate() [3/3]

static Matrixf trBase::Matrixf::Translate ( value_type  x,
value_type  y,
value_type  z 
)
static

Static method to create a Translate matrix.

Parameters
xThe value_type to process.
yThe value_type to process.
zThe value_type to process.
Returns
A Matrixf.

◆ Valid()

bool trBase::Matrixf::Valid ( ) const

Returns true if the Matrix is not NaN.

Returns
True if it succeeds, false if it fails.

Member Data Documentation

◆ mMatrix

osg::Matrixf trBase::Matrixf::mMatrix
protected

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