opal::Matrix44r Class Reference

Generic 4 by 4 matrix. More...

#include <Matrix44r.h>

List of all members.

Public Member Functions

 Matrix44r ()
 Matrix44r (const Matrix44r &src)
 Matrix44r (real _00, real _10, real _20, real _30, real _01, real _11, real _21, real _31, real _02, real _12, real _22, real _32, real _03, real _13, real _23, real _33)
 Matrix44r (const real *data)
void setPosition (real x, real y, real z)
Point3r getPosition () const
Vec3r getTranslation () const
void set (real _00, real _10, real _20, real _30, real _01, real _11, real _21, real _31, real _02, real _12, real _22, real _32, real _03, real _13, real _23, real _33)
void set (const real *data)
void makeZero ()
void makeIdentity ()
void makeScale (real s)
void makeScale (real x, real y, real z)
void makeRotation (real degrees, real x, real y, real z)
void setQuaternion (real w, real x, real y, real z)
void setQuaternion (const Quaternion &q)
void setRotation (real degrees, real x, real y, real z)
void makeTranslation (real x, real y, real z)
void scale (real s)
void scale (real x, real y, real z)
Quaternion getQuaternion () const
Vec3r getEulerXYZ () const
void preScale (real s)
void preScale (real x, real y, real z)
void rotate (real degrees, real x, real y, real z)
void preRotate (real degrees, real x, real y, real z)
void translate (real x, real y, real z)
void preTranslate (real x, real y, real z)
realgetData ()
const realgetData () const
realoperator[] (unsigned int i)
const realoperator[] (unsigned int i) const
realoperator() (unsigned int row, unsigned int col)
const realoperator() (unsigned int row, unsigned int col) const
void operator *= (const Matrix44r &m)
bool operator== (const Matrix44r &m) const
bool operator!= (const Matrix44r &m) const
void swap (real &a, real &b)
void transpose ()
real determinant () const
bool invert ()
void fastInvert ()
Vec3r getForward () const
Vec3r getUp () const
Vec3r getRight () const

Private Attributes

real mData [16]

Friends

Matrix44r operator * (real scalar, Matrix44r m)


Detailed Description

Generic 4 by 4 matrix.

Such matrix describes translation, rotation and scaling.

Definition at line 67 of file Matrix44r.h.


Constructor & Destructor Documentation

opal::Matrix44r::Matrix44r  )  [inline]
 

Identity by default.

Definition at line 76 of file Matrix44r.h.

References makeIdentity().

opal::Matrix44r::Matrix44r const Matrix44r src  )  [inline]
 

Copy-constructor.

Definition at line 82 of file Matrix44r.h.

References mData.

opal::Matrix44r::Matrix44r real  _00,
real  _10,
real  _20,
real  _30,
real  _01,
real  _11,
real  _21,
real  _31,
real  _02,
real  _12,
real  _22,
real  _32,
real  _03,
real  _13,
real  _23,
real  _33
[inline]
 

set is row-column order

Definition at line 88 of file Matrix44r.h.

References mData.

opal::Matrix44r::Matrix44r const real data  )  [inline]
 

WARNING! this takes in a column-row order matrix.

Definition at line 115 of file Matrix44r.h.

References mData.


Member Function Documentation

real opal::Matrix44r::determinant  )  const [inline]
 

Definition at line 546 of file Matrix44r.h.

Referenced by opal::inverse().

void opal::Matrix44r::fastInvert  )  [inline]
 

Definition at line 574 of file Matrix44r.h.

References opal::fastInverse().

Referenced by opal::SpringMotor::setGlobalAttachPoint().

const real* opal::Matrix44r::getData  )  const [inline]
 

Definition at line 478 of file Matrix44r.h.

References mData.

real* opal::Matrix44r::getData  )  [inline]
 

Definition at line 473 of file Matrix44r.h.

References mData.

Vec3r opal::Matrix44r::getEulerXYZ  )  const [inline]
 

Returns rotations around x-, y-, and z- axis.

euler angles are in degrees

Definition at line 375 of file Matrix44r.h.

References opal::normalizeDegrees(), opal::globals::OPAL_HALF_PI, and opal::radToDeg().

Referenced by opal::Solid::getEulerXYZ().

Vec3r opal::Matrix44r::getForward  )  const [inline]
 

forward direction in local coordinate system of the body

Definition at line 580 of file Matrix44r.h.

Referenced by opal::SpringMotor::internal_update(), and opal::SpringMotor::setDesiredTransform().

Point3r opal::Matrix44r::getPosition  )  const [inline]
 

Returns current position.

Definition at line 129 of file Matrix44r.h.

References mData.

Referenced by opal::Solid::getPosition(), opal::SpringMotor::setDesiredTransform(), and setRotation().

Quaternion opal::Matrix44r::getQuaternion  )  const [inline]
 

Definition at line 324 of file Matrix44r.h.

References opal::areEqual().

Referenced by opal::Solid::getQuaternion().

Vec3r opal::Matrix44r::getRight  )  const [inline]
 

right direction in local coordinate system of the body

Definition at line 592 of file Matrix44r.h.

Referenced by opal::SpringMotor::internal_update().

Vec3r opal::Matrix44r::getTranslation  )  const [inline]
 

Returns current position.

Definition at line 135 of file Matrix44r.h.

References mData.

Vec3r opal::Matrix44r::getUp  )  const [inline]
 

up direction in local coordinate system of the body

Definition at line 586 of file Matrix44r.h.

Referenced by opal::SpringMotor::internal_update().

bool opal::Matrix44r::invert  )  [inline]
 

Definition at line 569 of file Matrix44r.h.

References opal::inverse().

void opal::Matrix44r::makeIdentity  )  [inline]
 

Resets to indentity matrix.

Definition at line 180 of file Matrix44r.h.

References mData.

Referenced by opal::Mass::Mass(), and Matrix44r().

void opal::Matrix44r::makeRotation real  degrees,
real  x,
real  y,
real  z
[inline]
 

sets rotation of the matrix

Parameters:
degrees angle of rotation
x x-size of the axis vector
y y-size of the axis vector
z z-size of the axis vector

Definition at line 222 of file Matrix44r.h.

References opal::defaults::sensor::incline::axis, opal::degToRad(), and opal::Vec3r::normalize().

Referenced by preRotate(), rotate(), and setRotation().

void opal::Matrix44r::makeScale real  x,
real  y,
real  z
[inline]
 

scales each axis by a given value

Definition at line 210 of file Matrix44r.h.

References set().

void opal::Matrix44r::makeScale real  s  )  [inline]
 

scales all axis by a given amount

Definition at line 204 of file Matrix44r.h.

References set().

void opal::Matrix44r::makeTranslation real  x,
real  y,
real  z
[inline]
 

Definition at line 303 of file Matrix44r.h.

References set().

void opal::Matrix44r::makeZero  )  [inline]
 

Entire matrix will be zero'ed.

Definition at line 174 of file Matrix44r.h.

References mData.

Referenced by opal::operator *().

void opal::Matrix44r::operator *= const Matrix44r m  )  [inline]
 

Definition at line 503 of file Matrix44r.h.

bool opal::Matrix44r::operator!= const Matrix44r m  )  const [inline]
 

Definition at line 518 of file Matrix44r.h.

const real& opal::Matrix44r::operator() unsigned int  row,
unsigned int  col
const [inline]
 

Definition at line 498 of file Matrix44r.h.

References mData.

real& opal::Matrix44r::operator() unsigned int  row,
unsigned int  col
[inline]
 

Definition at line 493 of file Matrix44r.h.

References mData.

bool opal::Matrix44r::operator== const Matrix44r m  )  const [inline]
 

Definition at line 508 of file Matrix44r.h.

References mData.

const real& opal::Matrix44r::operator[] unsigned int  i  )  const [inline]
 

Definition at line 488 of file Matrix44r.h.

References mData.

real& opal::Matrix44r::operator[] unsigned int  i  )  [inline]
 

Definition at line 483 of file Matrix44r.h.

References mData.

void opal::Matrix44r::preRotate real  degrees,
real  x,
real  y,
real  z
[inline]
 

applies this rotation first, then applies old rotations again

Parameters:
degrees angle of rotation
x x-size of the axis vector
y y-size of the axis vector
z z-size of the axis vector
Note:
this operation affects the order of the rotations

Definition at line 454 of file Matrix44r.h.

References makeRotation().

void opal::Matrix44r::preScale real  x,
real  y,
real  z
[inline]
 

Definition at line 423 of file Matrix44r.h.

void opal::Matrix44r::preScale real  s  )  [inline]
 

post multiply transformations, openGL style, for convenience

Definition at line 417 of file Matrix44r.h.

void opal::Matrix44r::preTranslate real  x,
real  y,
real  z
[inline]
 

Definition at line 467 of file Matrix44r.h.

void opal::Matrix44r::rotate real  degrees,
real  x,
real  y,
real  z
[inline]
 

rotates the matrix further

Parameters:
degrees angle of rotation
x x-size of the axis vector
y y-size of the axis vector
z z-size of the axis vector
Note:
this operation does not overwrite previous rotations

Definition at line 438 of file Matrix44r.h.

References makeRotation().

void opal::Matrix44r::scale real  x,
real  y,
real  z
[inline]
 

Definition at line 315 of file Matrix44r.h.

void opal::Matrix44r::scale real  s  )  [inline]
 

post multiply transformations, openGL style, for convenience

Definition at line 309 of file Matrix44r.h.

void opal::Matrix44r::set const real data  )  [inline]
 

WARNING! this takes in a column-row order matrix.

Definition at line 168 of file Matrix44r.h.

References mData.

void opal::Matrix44r::set real  _00,
real  _10,
real  _20,
real  _30,
real  _01,
real  _11,
real  _21,
real  _31,
real  _02,
real  _12,
real  _22,
real  _32,
real  _03,
real  _13,
real  _23,
real  _33
[inline]
 

set is row-column order

Definition at line 141 of file Matrix44r.h.

References mData.

Referenced by opal::ODESolid::getInertiaTensor(), opal::ODESolid::internal_updateOPALTransform(), makeScale(), and makeTranslation().

void opal::Matrix44r::setPosition real  x,
real  y,
real  z
[inline]
 

Resets position.

Definition at line 121 of file Matrix44r.h.

References mData.

Referenced by opal::Solid::setPosition().

void opal::Matrix44r::setQuaternion const Quaternion q  )  [inline]
 

quaternion can have a zero axis

Definition at line 278 of file Matrix44r.h.

References opal::defaults::sensor::incline::axis, opal::Quaternion::getAngleAxis(), setRotation(), opal::Vec3r::x, opal::Vec3r::y, and opal::Vec3r::z.

void opal::Matrix44r::setQuaternion real  w,
real  x,
real  y,
real  z
[inline]
 

x, y, z - axis can be zero

Definition at line 267 of file Matrix44r.h.

References opal::defaults::sensor::incline::axis, opal::Quaternion::getAngleAxis(), setRotation(), opal::Vec3r::x, opal::Vec3r::y, and opal::Vec3r::z.

Referenced by opal::Solid::setQuaternion().

void opal::Matrix44r::setRotation real  degrees,
real  x,
real  y,
real  z
[inline]
 

overwrites previous rotations of the matrix

Parameters:
degrees angle of rotation
x x-size of the axis vector
y y-size of the axis vector
z z-size of the axis vector

Definition at line 294 of file Matrix44r.h.

References getPosition(), and makeRotation().

Referenced by setQuaternion().

void opal::Matrix44r::swap real a,
real b
[inline]
 

Definition at line 528 of file Matrix44r.h.

void opal::Matrix44r::translate real  x,
real  y,
real  z
[inline]
 

Definition at line 461 of file Matrix44r.h.

void opal::Matrix44r::transpose  )  [inline]
 

Definition at line 535 of file Matrix44r.h.


Friends And Related Function Documentation

Matrix44r operator * real  scalar,
Matrix44r  m
[friend]
 

Definition at line 684 of file Matrix44r.h.


Member Data Documentation

real opal::Matrix44r::mData[16] [private]
 

Definition at line 70 of file Matrix44r.h.

Referenced by getData(), getPosition(), getTranslation(), makeIdentity(), makeZero(), Matrix44r(), opal::operator *(), operator()(), operator==(), operator[](), set(), and setPosition().


The documentation for this class was generated from the following file:
Generated on Tue May 16 17:49:56 2006 for OPAL by  doxygen 1.4.6-NO