PanoramaViewer
 All Classes Namespaces Files Functions Variables Macros Pages
LayerSceneGraph::SceneNode Class Reference

#include <SceneNode.h>

Inheritance diagram for LayerSceneGraph::SceneNode:
LayerSceneGraph::Impostor LayerSceneGraph::Layer

Public Member Functions

 SceneNode ()
 
virtual ~SceneNode ()
 
virtual void draw ()
 
virtual void onTouch ()
 
void addChild (SceneNode *s)
 
SceneNoderemoveChild ()
 
Matrix4 getTransform ()
 
void setTransform (Matrix4 m)
 
Matrix4 getWorldTransform ()
 
void setWorldTransform (Matrix4 m)
 
SceneNodegetParent ()
 
Vector3 getPosition ()
 
vector< SceneNode * >
::const_iterator 
getChildteratorStart ()
 
vector< SceneNode * >
::const_iterator 
getChildteratorEnd ()
 

Protected Attributes

Matrix4transform
 
Matrix4worldTransform
 
SceneNodeparent
 
vector< SceneNode * > children
 
Vector3 position
 

Constructor & Destructor Documentation

LayerSceneGraph::SceneNode::SceneNode ( )

Dafault constructor. Instances a transform and a world transform matrix and set its parent as NULL.

LayerSceneGraph::SceneNode::~SceneNode ( )
virtual

Destructor. Releases and deletes all children of this node.

Member Function Documentation

void LayerSceneGraph::SceneNode::addChild ( SceneNode s)

Adds another node as a child of this node.

void LayerSceneGraph::SceneNode::draw ( )
virtual

*This method updates this node world matrix based on its parent world matrix. It is necessary for correct drawing.

Todo:
think about a better update strategy

Reimplemented in LayerSceneGraph::Layer, and LayerSceneGraph::Impostor.

vector< SceneNode * >::const_iterator LayerSceneGraph::SceneNode::getChildteratorEnd ( )
vector< SceneNode * >::const_iterator LayerSceneGraph::SceneNode::getChildteratorStart ( )
SceneNode * LayerSceneGraph::SceneNode::getParent ( )

Return this node's parent.

Vector3 LayerSceneGraph::SceneNode::getPosition ( )

Returns this node position in its local coordinate system.

Matrix4 LayerSceneGraph::SceneNode::getTransform ( )

Returns the local transformation matrix of this node

Matrix4 LayerSceneGraph::SceneNode::getWorldTransform ( )

Returns the world transform matrix of this node. This matrix represents the transformation of this node relative to the complete scene.

void LayerSceneGraph::SceneNode::onTouch ( )
virtual

This methods determines how this node reacts when it is intercepted by a ray due to touch interaction

SceneNode * LayerSceneGraph::SceneNode::removeChild ( )

Removes the last child added from this node children vector.

void LayerSceneGraph::SceneNode::setTransform ( Matrix4  m)

Sets a new transform matrix for this node.

void LayerSceneGraph::SceneNode::setWorldTransform ( Matrix4  m)

Sets a new world transform for this node.

Member Data Documentation

vector<SceneNode*> LayerSceneGraph::SceneNode::children
protected
SceneNode* LayerSceneGraph::SceneNode::parent
protected
Vector3 LayerSceneGraph::SceneNode::position
protected
Matrix4* LayerSceneGraph::SceneNode::transform
protected
Matrix4* LayerSceneGraph::SceneNode::worldTransform
protected

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