wMatrix class More...

Public Member Functions

 wMatrix ()
 Construct an unintialized matrix. More...
 
 wMatrix (const wVector &X, const wVector &Y, const wVector &Z, const wVector &P)
 Construct the matrix. More...
 
 wMatrix (const wQuaternion &rotation, const wVector &position)
 Constructor. More...
 
 wMatrix (const real *position, const real *rotation)
 Constructor. More...
 
 wMatrix (const wMatrix &other)
 Copy constructor. More...
 
wVector getEuleroAngles () const
 return the Eulero angle of rotation More...
 
wMatrix inverse () const
 calculate the inverse of transformation matrix More...
 
 operator QString () const
 Returns a string representation of the matrix. More...
 
wMatrix operator* (const wMatrix &B) const
 matrix multiplication More...
 
wMatrixoperator= (const wMatrix &other)
 Copy operator. More...
 
wVectorT< true > & operator[] (int i)
 indexing operator More...
 
const wVectorT< true > & operator[] (int i) const
 indexing operator (const version) More...
 
wMatrix rotateAround (const wVector &axis, const wVector &centre, real angle) const
 Rotate this matrix around the axis, and position passed of radians specified. More...
 
wMatrix rotateMatrix (const wMatrix &tm) const
 rotate the matrix passed by rotation specified by this and return a copy More...
 
wVector rotateVector (const wVector &v) const
 rotate the vector v, it doesn't apply position transformation More...
 
void sanitifize ()
 change the matrix in order to get a valid one that represent the same rotation/translation More...
 
bool sanityCheck ()
 return true if the transformation matrix is valid More...
 
wVector transformPlane (const wVector &localPlane) const
 ... More...
 
void transformTriplex (real *dst, int dstStrideInBytes, real *src, int srcStrideInBytes, int count) const
 apply transformation to a chunck of vectors More...
 
wVector transformVector (const wVector &v) const
 apply both rotation and translation to the vector v More...
 
wMatrix transpose () const
 transpose the rotation sub-matrix More...
 
wMatrix transpose4X4 () const
 full transposition of the transformation matrix More...
 
wVector unrotateVector (const wVector &v) const
 inverte the rotation of this matrix on the vector v More...
 
wVector untransformPlane (const wVector &globalPlane) const
 ... More...
 
wVector untransformVector (const wVector &v) const
 invert the rotation and translation on the vector v More...
 

Static Public Member Functions

static wMatrix grammSchmidt (const wVector &dir)
 calculate an orthonormal matrix with the Z vector pointing on the dir direction, and the Y and Z are determined by using the Gramm-Schmidth procedure More...
 
static wMatrix identity ()
 create an identity matrix More...
 
static wMatrix pitch (real ang)
 create a rotation around X axis of ang radians More...
 
static wMatrix roll (real ang)
 create a rotation around Z axis of ang radians More...
 
static wMatrix yaw (real ang)
 create a rotation around Y axis of ang radians More...
 
static wMatrix zero ()
 create a zero matrix More...
 

Public Attributes

wVectorT< true > w_pos
 
wVectorT< true > x_ax
 
wVectorT< true > y_ax
 
wVectorT< true > z_ax
 

Detailed Description

wMatrix class

\

Motivation
4x4 Matrix of real numbers; useful for transformation matrix
Description
Description
Warnings

Definition at line 48 of file wmatrix.h.

Constructor & Destructor Documentation

wMatrix ( const wVector X,
const wVector Y,
const wVector Z,
const wVector P 
)
inline

Construct the matrix.

Parameters
Xx axis representation
Yy axis representation
Zz axis representation
Pworld position

Definition at line 166 of file wmatrix.h.

wMatrix ( const wQuaternion rotation,
const wVector position 
)
inline

Constructor.

Parameters
rotationquaternion representation of rotation part
positionworld position

Definition at line 177 of file wmatrix.h.

wMatrix ( const real position,
const real rotation 
)
inline

Constructor.

Parameters
positiona vector containg three position value
rotationa vector containing 12 values representing a 3x4 rotation matrix useful for converting data from ODE to wMatrix

Definition at line 216 of file wmatrix.h.

wMatrix ( const wMatrix other)
inline

Copy constructor.

Definition at line 231 of file wmatrix.h.

Member Function Documentation

wVector getEuleroAngles ( ) const
inline

return the Eulero angle of rotation

Definition at line 279 of file wmatrix.h.

References farsa::max(), farsa::min(), wMatrix::pitch(), wMatrix::roll(), and wMatrix::yaw().

wMatrix grammSchmidt ( const wVector dir)
inlinestatic

calculate an orthonormal matrix with the Z vector pointing on the dir direction, and the Y and Z are determined by using the Gramm-Schmidth procedure

Definition at line 474 of file wmatrix.h.

References wVectorT< Shared >::normalize(), and wMatrix::wMatrix().

Referenced by RenderWObjectContainer::drawArrow(), RenderWorld::drawArrow(), RenderWObjectContainer::drawTorus(), and PhySlider::PhySlider().

operator QString ( ) const
inline

Returns a string representation of the matrix.

Definition at line 227 of file wmatrix.h.

wMatrix operator* ( const wMatrix B) const
inline

matrix multiplication

Definition at line 392 of file wmatrix.h.

References wMatrix::wMatrix().

wMatrix & operator= ( const wMatrix other)
inline

Copy operator.

Definition at line 239 of file wmatrix.h.

wVectorT< true > & operator[] ( int  i)
inline

indexing operator

Definition at line 250 of file wmatrix.h.

const wVectorT< true > & operator[] ( int  i) const
inline

indexing operator (const version)

Definition at line 254 of file wmatrix.h.

wMatrix pitch ( real  ang)
inlinestatic

create a rotation around X axis of ang radians

Definition at line 494 of file wmatrix.h.

References wMatrix::wMatrix().

Referenced by wMatrix::getEuleroAngles(), PhyEpuck::PhyEpuck(), and PhyMarXbot::PhyMarXbot().

wMatrix roll ( real  ang)
inlinestatic
wMatrix rotateAround ( const wVector axis,
const wVector centre,
real  angle 
) const
inline

Rotate this matrix around the axis, and position passed of radians specified.

Parameters
axisof rotation in world coordinate
centreof rotation in world coordinate
angleof rotation in radians

Definition at line 301 of file wmatrix.h.

References wVectorT< Shared >::rotateAround().

wMatrix rotateMatrix ( const wMatrix tm) const
inline

rotate the matrix passed by rotation specified by this and return a copy

Definition at line 334 of file wmatrix.h.

References wMatrix::wMatrix().

wVector rotateVector ( const wVector v) const
inline

rotate the vector v, it doesn't apply position transformation

Definition at line 354 of file wmatrix.h.

Referenced by wMatrix::transformPlane(), and wMatrix::transformVector().

void sanitifize ( )
inline

change the matrix in order to get a valid one that represent the same rotation/translation

Definition at line 450 of file wmatrix.h.

Referenced by PhyBallAndSocket::PhyBallAndSocket(), PhyFixed::PhyFixed(), PhyHinge::PhyHinge(), PhySuspension::PhySuspension(), PhyUniversal::PhyUniversal(), and PhyUniversal::updateJointInfo().

wVector transformPlane ( const wVector localPlane) const
inline

...

doc missing ...

Definition at line 419 of file wmatrix.h.

References wMatrix::rotateVector(), and wMatrix::unrotateVector().

void transformTriplex ( real dst,
int  dstStrideInBytes,
real src,
int  srcStrideInBytes,
int  count 
) const
inline

apply transformation to a chunck of vectors

Parameters
dstwhere to store transformed vectors
srcwhere to get vectors to transform
counthow many vector you want to transform

Definition at line 372 of file wmatrix.h.

wVector transformVector ( const wVector v) const
inline

apply both rotation and translation to the vector v

Definition at line 364 of file wmatrix.h.

References wMatrix::rotateVector().

Referenced by World::collisionRayCast(), and SingleIR::update().

wMatrix transpose ( ) const
inline

transpose the rotation sub-matrix

Definition at line 265 of file wmatrix.h.

References wMatrix::wMatrix().

wMatrix transpose4X4 ( ) const
inline

full transposition of the transformation matrix

Definition at line 272 of file wmatrix.h.

References wMatrix::wMatrix().

wVector unrotateVector ( const wVector v) const
inline

inverte the rotation of this matrix on the vector v

Definition at line 360 of file wmatrix.h.

Referenced by wMatrix::transformPlane(), wMatrix::untransformPlane(), and wMatrix::untransformVector().

wVector untransformPlane ( const wVector globalPlane) const
inline

...

doc missing ...

Definition at line 425 of file wmatrix.h.

References wMatrix::unrotateVector().

wVector untransformVector ( const wVector v) const
inline

invert the rotation and translation on the vector v

Definition at line 368 of file wmatrix.h.

References wMatrix::unrotateVector().

Referenced by PhyKhepera::PhyKhepera().

wMatrix yaw ( real  ang)
inlinestatic

create a rotation around Y axis of ang radians

Definition at line 503 of file wmatrix.h.

References wMatrix::wMatrix().

Referenced by wMatrix::getEuleroAngles(), PhyEpuck::PhyEpuck(), PhyKhepera::PhyKhepera(), and PhyMarXbot::PhyMarXbot().

wMatrix zero ( )
inlinestatic

create a zero matrix

Definition at line 467 of file wmatrix.h.

References wMatrix::wMatrix().


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