Transform Class Reference

#include <Transform.h>

Inheritance diagram for Transform:

ESGObject List of all members.

Public Member Functions

 Transform ()
 Transform (const Matrix4 &src)
virtual ~Transform ()
virtual Transformclone (void) const
void rotateX (float a)
void rotateY (float a)
void rotateZ (float a)
void rotate (float a, const Vector3 &axis)
void translate (float x, float y, float z)
void scale (float s)
void scale (float sx, float sy, float sz)
void scale (const Vector3 &s)
void transform (const Matrix4 &mat)
void setIdentity (void)
Matrix4get (void)
const Matrix4get (void) const
const Matrix3getRotation (void)
const Vector3getTranslation (void)
const Vector3getScale (void)

Protected Member Functions

virtual void _duplicate_attributes (const Transform &)

Protected Attributes

Matrix4 _mat
 homogenous transformation matrix
Matrix3 _rotMat
 abbrev. for rotation component of _mat
Vector3 _trVec
 abbrev. for translation component of _mat
Vector3 _scVec
 abbrev. for scale component of _mat
bool _haveAbbrev

Detailed Description

This scene graph attribute transforms its owner. More preciselly, it contains transformation matrix and interface for its management.

NOTE: This attribute should not be shared by more objects directly but rather used inside a Group object that transforms all its children.

Definition at line 21 of file Transform.h.


Constructor & Destructor Documentation

Transform  )  [inline]
 

Contructor

Definition at line 35 of file Transform.h.

Transform const Matrix4 src  )  [inline]
 

Contructor - copy from existing matrix

Definition at line 40 of file Transform.h.

virtual ~Transform  )  [inline, virtual]
 

Destructor

Definition at line 45 of file Transform.h.


Member Function Documentation

void _duplicate_attributes const Transform  )  [protected, virtual]
 

Definition at line 5 of file Transform.cc.

References Transform::_haveAbbrev, Transform::_mat, Transform::_rotMat, Transform::_scVec, and Transform::_trVec.

Referenced by Transform::clone().

Transform * clone void   )  const [virtual]
 

Makes a duplicate (clone)

Returns:
duplicate

Definition at line 16 of file Transform.cc.

References Transform::_duplicate_attributes().

const Matrix4& get void   )  const [inline]
 

Returns:
constant reference to actual transformation matrix

Definition at line 135 of file Transform.h.

Matrix4& get void   )  [inline]
 

Returns:
reference to actual transformation matrix

Definition at line 130 of file Transform.h.

Referenced by ShadowExplorer::_explore(), RayIntExplorer::_explore(), ObjsAheadExplorer::_explore(), and Explorer::_explore().

const Matrix3* getRotation void   )  [inline]
 

Returns:
constant pointer to actual rotation matrix

Definition at line 140 of file Transform.h.

Referenced by ShadowExplorer::_explore(), RayIntExplorer::_explore(), and ObjsAheadExplorer::_explore().

const Vector3* getScale void   )  [inline]
 

Returns:
constant pointer to to actual scale vector

Definition at line 162 of file Transform.h.

Referenced by ShadowExplorer::_explore(), RayIntExplorer::_explore(), and ObjsAheadExplorer::_explore().

const Vector3* getTranslation void   )  [inline]
 

Returns:
constant pointer to to actual translation vector

Definition at line 151 of file Transform.h.

Referenced by ShadowExplorer::_explore(), RayIntExplorer::_explore(), and ObjsAheadExplorer::_explore().

void rotate float  a,
const Vector3 axis
 

Adds rotation to existing transformation

Parameters:
a angle of rotation in radians
axis rotation axis

Definition at line 47 of file Transform.cc.

References Transform::_haveAbbrev, and Transform::_mat.

void rotateX float  a  ) 
 

Adds rotation around x axis to existing transformation

Parameters:
a angle of rotation in radians

Definition at line 23 of file Transform.cc.

References Transform::_haveAbbrev, and Transform::_mat.

void rotateY float  a  ) 
 

Adds rotation around y axis to existing transformation

Parameters:
a angle of rotation in radians

Definition at line 31 of file Transform.cc.

References Transform::_haveAbbrev, and Transform::_mat.

void rotateZ float  a  ) 
 

Adds rotation around z axis to existing transformation

Parameters:
a angle of rotation in radians

Definition at line 39 of file Transform.cc.

References Transform::_haveAbbrev, and Transform::_mat.

void scale const Vector3 s  ) 
 

Adds non-uniform scale transformation to existing transformation

Parameters:
s scale vector

Definition at line 82 of file Transform.cc.

References Transform::_haveAbbrev, and Transform::_mat.

void scale float  sx,
float  sy,
float  sz
 

Adds non-uniform scale transformation to existing transformation

Parameters:
sx scale factor in x axis
sy scale factor in y axis
sz scale factor in z axis

Definition at line 71 of file Transform.cc.

References Transform::_haveAbbrev, and Transform::_mat.

void scale float  s  ) 
 

Adds scale transformation to existing transformation

Parameters:
s scale factor

Definition at line 63 of file Transform.cc.

References Transform::_haveAbbrev, and Transform::_mat.

void setIdentity void   ) 
 

Clears transformation matrix

void transform const Matrix4 mat  ) 
 

Adds transformation to existing transformation

Parameters:
mat new transformation

Definition at line 93 of file Transform.cc.

References Transform::_haveAbbrev, and Transform::_mat.

void translate float  x,
float  y,
float  z
 

Adds translation to existing transformation

Parameters:
x translation in x axis
y translation in y axis
z translation in z axis

Definition at line 55 of file Transform.cc.

References Transform::_haveAbbrev, and Transform::_mat.


Member Data Documentation

bool _haveAbbrev [protected]
 

Definition at line 27 of file Transform.h.

Referenced by Transform::_duplicate_attributes(), Transform::rotate(), Transform::rotateX(), Transform::rotateY(), Transform::rotateZ(), Transform::scale(), Transform::transform(), and Transform::translate().

Matrix4 _mat [protected]
 

homogenous transformation matrix

Definition at line 23 of file Transform.h.

Referenced by Transform::_duplicate_attributes(), Transform::rotate(), Transform::rotateX(), Transform::rotateY(), Transform::rotateZ(), Transform::scale(), Transform::transform(), and Transform::translate().

Matrix3 _rotMat [protected]
 

abbrev. for rotation component of _mat

Definition at line 24 of file Transform.h.

Referenced by Transform::_duplicate_attributes().

Vector3 _scVec [protected]
 

abbrev. for scale component of _mat

Definition at line 26 of file Transform.h.

Referenced by Transform::_duplicate_attributes().

Vector3 _trVec [protected]
 

abbrev. for translation component of _mat

Definition at line 25 of file Transform.h.

Referenced by Transform::_duplicate_attributes().


The documentation for this class was generated from the following files:
Generated on Wed Jun 28 12:24:36 2006 for esg by  doxygen 1.4.6