Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
Menge::SceneGraph::Transform Class Reference

Scene graph node which applies transforms to nodes. More...

#include <Transform.h>

Inheritance diagram for Menge::SceneGraph::Transform:
Menge::SceneGraph::GLDagNode Menge::SceneGraph::GLNode

Public Member Functions

 Transform (GLDagNode *parent=0x0)
 Constructor. More...
 
void setTranslation (const Vector3 &vec)
 Set the translation of this node. More...
 
void addTranslation (const Vector3 &vec)
 Offset the translation of this node. More...
 
void setScale (const Vector3 &vec)
 Set the scale of this node. More...
 
void setRotationDeg (const Vector3 &vec)
 Set the orientation of this node. More...
 
void setRotationRad (const Vector3 &vec)
 Set the orientation of this node. More...
 
void addRotationDeg (const Vector3 &vec)
 Offsets the orientation of this node. More...
 
void addRotationRad (const Vector3 &vec)
 Offsets the orientation of this node. More...
 
void setRotAxisDeg (const Vector3 &vec)
 Set the orientation of this node's rotation axis. More...
 
void setRotAxisRad (const Vector3 &vec)
 Set the orientation of this node's rotation axis. More...
 
const Vector3translation () const
 Reports the transform's translation value. More...
 
const Vector3rotation () const
 Reports the transform's orientation value. More...
 
const Vector3scale () const
 Reports the transform's scale value. More...
 
void setDirty ()
 Sets the transformation to be dirty. More...
 
void getMatrix (Matrix4x4 &mat)
 Returns the transform matrix created by this transform node. More...
 
void getInverseMatrix (Matrix4x4 &mat)
 Writes the transform's inverse matrix created by this transform node. More...
 
void getWorldMatrix (Matrix4x4 &mat)
 Returns the world matrix of this node; the matrix that transforms points from this node's object space to world space. More...
 
void getWorldInverseMatrix (Matrix4x4 &mat)
 Returns the world inverse matrix of this node; the matrix that transforms points from world space to this node's object space. More...
 
void getParentMatrix (Matrix4x4 &mat)
 Returns this node's parent's world matrix. More...
 
void getParentInverseMatrix (Matrix4x4 &mat)
 Returns this node's parent's world inverse matrix. More...
 
virtual void drawGL (bool select=false)
 Causes this node's child nodes to draw themselves to the scene, transformed by this node's transformation matrix. More...
 
- Public Member Functions inherited from Menge::SceneGraph::GLDagNode
 GLDagNode (GLDagNode *parent=0x0)
 Constructor. More...
 
virtual ~GLDagNode ()
 Virtual destructor.
 
void addChild (GLNode *child)
 Adds a child node to this node. More...
 
virtual void newContext ()
 Performs any work to recreate OpenGL constructs for this node and its children nodes.
 
- Public Member Functions inherited from Menge::SceneGraph::GLNode
 GLNode (GLDagNode *parent=0x0)
 Constructor. More...
 
virtual ~GLNode ()
 Virtual destructor.
 
void setVisible (bool state)
 Sets the visible state of the node. More...
 
GLDagNodegetParent ()
 Returns a pointer to the node's parent (possibly NULL). More...
 

Protected Attributes

XformMatrix _xform
 The underlyilng transformation matrix associated with this transform node.
 
- Protected Attributes inherited from Menge::SceneGraph::GLDagNode
GLNode ** _children
 An array of child GLNodes.
 
size_t _childCount
 The number of child nodes this node contains.
 
- Protected Attributes inherited from Menge::SceneGraph::GLNode
GLDagNode_parent
 The GLDagNode that serves as this node's parent.
 
bool _visible
 The visibility state of this node. If visible (true) the node and its children will be drawn into the scene, if invisible (false) it will not be drawn.
 

Additional Inherited Members

- Protected Member Functions inherited from Menge::SceneGraph::GLNode
void setParent (GLDagNode *p)
 Assigns this node to a parent GLDagNode. More...
 

Detailed Description

Scene graph node which applies transforms to nodes.

The Transform uses the XformMatrix to compute the transformation math. See XformMatrix for the details of the math.

Constructor & Destructor Documentation

Menge::SceneGraph::Transform::Transform ( GLDagNode parent = 0x0)

Constructor.

Parameters
parentA pointer to the optional parent node in the graph.

Member Function Documentation

void Menge::SceneGraph::Transform::addRotationDeg ( const Vector3 vec)
inline

Offsets the orientation of this node.

Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation. In this case, each axis is summed independently. Generally, because these are Euler angles, this will will not lead to linear interpolation of orientation.

Parameters
vecThe rotations around the x-, y-, and z-axes, respectively in degrees.
void Menge::SceneGraph::Transform::addRotationRad ( const Vector3 vec)
inline

Offsets the orientation of this node.

Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation. In this case, each axis is summed independently. Generally, because these are Euler angles, this will will not lead to linear interpolation of orientation.

Parameters
vecThe rotations around the x-, y-, and z-axes, respectively in radians.
void Menge::SceneGraph::Transform::addTranslation ( const Vector3 vec)
inline

Offset the translation of this node.

Parameters
vecThe change to position of this node.
void Menge::SceneGraph::Transform::drawGL ( bool  select = false)
virtual

Causes this node's child nodes to draw themselves to the scene, transformed by this node's transformation matrix.

Parameters
selectDetermines if the draw call is being performed for the purpose of selection (true) or for visualization (false).

Reimplemented from Menge::SceneGraph::GLDagNode.

void Menge::SceneGraph::Transform::getInverseMatrix ( Matrix4x4 mat)
inlinevirtual

Writes the transform's inverse matrix created by this transform node.

Parameters
matThis matrix contains the inverse matrix when done.

Reimplemented from Menge::SceneGraph::GLDagNode.

void Menge::SceneGraph::Transform::getMatrix ( Matrix4x4 mat)
inlinevirtual

Returns the transform matrix created by this transform node.

Parameters
matThis matrix contains the matrix when done.

Reimplemented from Menge::SceneGraph::GLDagNode.

void Menge::SceneGraph::Transform::getParentInverseMatrix ( Matrix4x4 mat)
virtual

Returns this node's parent's world inverse matrix.

Parameters
matThis matrix contains the parent's inverse matrix when done.

Reimplemented from Menge::SceneGraph::GLDagNode.

void Menge::SceneGraph::Transform::getParentMatrix ( Matrix4x4 mat)
virtual

Returns this node's parent's world matrix.

Parameters
matThis matrix contains the parent matrix when done.

Reimplemented from Menge::SceneGraph::GLDagNode.

void Menge::SceneGraph::Transform::getWorldInverseMatrix ( Matrix4x4 mat)
virtual

Returns the world inverse matrix of this node; the matrix that transforms points from world space to this node's object space.

Parameters
matThis matrix contains the world inverse matrix when done.

Reimplemented from Menge::SceneGraph::GLDagNode.

void Menge::SceneGraph::Transform::getWorldMatrix ( Matrix4x4 mat)
virtual

Returns the world matrix of this node; the matrix that transforms points from this node's object space to world space.

Parameters
matThis matrix contains the world matrix when done.

Reimplemented from Menge::SceneGraph::GLDagNode.

const Vector3& Menge::SceneGraph::Transform::rotation ( ) const
inline

Reports the transform's orientation value.

Returns
The orientation of this matrix.
const Vector3& Menge::SceneGraph::Transform::scale ( ) const
inline

Reports the transform's scale value.

Returns
The orientation of this matrix.
void Menge::SceneGraph::Transform::setDirty ( )
inline

Sets the transformation to be dirty.

The transform node tries to perform lazy math. Only re-computing matrices due to changes and required computation. Setting it to dirty will force matrix computation next time the matrix is needed.

void Menge::SceneGraph::Transform::setRotationDeg ( const Vector3 vec)
inline

Set the orientation of this node.

Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation.

Parameters
vecThe rotations around the x-, y-, and z-axes, respectively in degrees.
void Menge::SceneGraph::Transform::setRotationRad ( const Vector3 vec)
inline

Set the orientation of this node.

Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation.

Parameters
vecThe rotations around the x-, y-, and z-axes, respectively in radians.
void Menge::SceneGraph::Transform::setRotAxisDeg ( const Vector3 vec)
inline

Set the orientation of this node's rotation axis.

Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation.

Parameters
vecThe orientation of the rotation axis around the x-, y-, and z-axes, respectively in degrees.
void Menge::SceneGraph::Transform::setRotAxisRad ( const Vector3 vec)
inline

Set the orientation of this node's rotation axis.

Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation.

Parameters
vecThe orientation of the rotation axis around the x-, y-, and z-axes, respectively in radians.
void Menge::SceneGraph::Transform::setScale ( const Vector3 vec)
inline

Set the scale of this node.

Parameters
vecThe desired scale of this node.
void Menge::SceneGraph::Transform::setTranslation ( const Vector3 vec)
inline

Set the translation of this node.

Parameters
vecThe 3D position of the transform.
const Vector3& Menge::SceneGraph::Transform::translation ( ) const
inline

Reports the transform's translation value.

Returns
The translation of this matrix.

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