Aether3D Game Engine
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
SceneGraphNode Class Reference

Scene Graph Node. Models, Lights and Cameras are derived from this class. More...

#include <SceneGraphNode.hpp>

Inheritance diagram for SceneGraphNode:
Camera Light Model

Public Types

enum  Type { None, Model, Camera, Light }
 

Public Member Functions

 SceneGraphNode ()
 
virtual ~SceneGraphNode ()
 
virtual bool AddChild (SceneGraphNode *child)
 
virtual bool ContainsChild (const SceneGraphNode *node) const
 
virtual void FindFirstChildWithName (const char *name, SceneGraphNode **outNode)
 
virtual void SetLayerMask (unsigned mask)
 
virtual void SetName (const std::string &newName)
 
virtual void SetPosition (const Vec3 &aPosition)
 
virtual void SetRotation (const Quaternion &aRotation)
 
virtual Quaternion GetRotation () const
 
virtual void SetScale (float aScale)
 
virtual float GetScale () const
 
virtual void SolveMatrices ()
 
virtual SceneGraphNodeParent ()
 
virtual std::string GetName () const
 
virtual Type GetType () const
 
virtual unsigned GetLayerMask () const
 
virtual std::list< SceneGraphNode * > & Children ()
 
virtual Vec3 GetPosition () const
 
virtual SceneGraphNodeRoot ()
 
void CleanDirties ()
 
bool IsDirty () const
 

Static Public Member Functions

static void RegisterScene (Scene *scene)
 
static void UnregisterScene ()
 

Public Attributes

std::list< SceneGraphNode * > children
 
Matrix44 modelMatrix
 

Protected Attributes

Type type
 
float scale
 
Vec3 position
 
SceneGraphNodeparent
 
Quaternion rotation
 
std::string name
 
bool dirtyTransform = true
 
unsigned layerMask = 0xFFFFFFFF
 

Detailed Description

Scene Graph Node. Models, Lights and Cameras are derived from this class.

Member Enumeration Documentation

enum SceneGraphNode::Type
strong

Graph node type.

Constructor & Destructor Documentation

SceneGraphNode::SceneGraphNode ( )

Constructor

SceneGraphNode::~SceneGraphNode ( )
virtual

Destructor

Member Function Documentation

bool SceneGraphNode::AddChild ( SceneGraphNode child)
virtual
Parameters
childChild.
Returns
True if succeeded, false if failed.
virtual std::list< SceneGraphNode* >& SceneGraphNode::Children ( )
inlinevirtual
Returns
children
void SceneGraphNode::CleanDirties ( )

Cleans all dirty flags. Used internally after transform matrices are solved.

bool SceneGraphNode::ContainsChild ( const SceneGraphNode node) const
virtual
Parameters
nodeNode that's searched in this node and its children.
Returns
true if this node or one of its children is node.
void SceneGraphNode::FindFirstChildWithName ( const char *  name,
SceneGraphNode **  outNode 
)
virtual
Parameters
nameNode's name that's searched in this node and its children.
outNodeFirst found node that matches name (case-sensitive) or unset if not found.
virtual unsigned SceneGraphNode::GetLayerMask ( ) const
inlinevirtual
Returns
layer mask.
virtual std::string SceneGraphNode::GetName ( ) const
inlinevirtual
Returns
name
virtual Vec3 SceneGraphNode::GetPosition ( ) const
inlinevirtual
Returns
Local position.
virtual Quaternion SceneGraphNode::GetRotation ( ) const
inlinevirtual
Returns
Local rotation.
virtual float SceneGraphNode::GetScale ( ) const
inlinevirtual
Returns
Local scale.
virtual Type SceneGraphNode::GetType ( ) const
inlinevirtual
Returns
type
bool SceneGraphNode::IsDirty ( ) const
inline

Used internally during rendering to determine if the transform has changed since the beginning of Renderer::Draw( scene ). Used to recalculate childrens's AABBs.

Returns
True, if the transform or some of its parent has changed since the beginning of Renderer::Draw( scene )
virtual SceneGraphNode* SceneGraphNode::Parent ( )
inlinevirtual
Returns
parent
void SceneGraphNode::RegisterScene ( Scene scene)
static

Registers a Scene for listening node additions. Called automatically when creating scene from a DLL, but on iOS you must call this because it doesn't use a DLL.

Parameters
sceneScene.

FIXME: This is a serious violation of good OO design: base classes should not know about their derived classes.

SceneGraphNode * SceneGraphNode::Root ( )
virtual
Returns
root
virtual void SceneGraphNode::SetLayerMask ( unsigned  mask)
inlinevirtual

Sets layer mask. Used to select which cameras should render which models. Does not affect lights.

Parameters
masklayerMask.
virtual void SceneGraphNode::SetName ( const std::string &  newName)
inlinevirtual

newName Name.

virtual void SceneGraphNode::SetPosition ( const Vec3 aPosition)
inlinevirtual
Parameters
aPositionAbsolute position.

Reimplemented in Light.

virtual void SceneGraphNode::SetRotation ( const Quaternion aRotation)
inlinevirtual
Parameters
aRotationAbsolute rotation.
virtual void SceneGraphNode::SetScale ( float  aScale)
inlinevirtual
Parameters
aScaleAbsolute scale
void SceneGraphNode::SolveMatrices ( )
virtual

Traverses the graph and creates transformation matrices.

void SceneGraphNode::UnregisterScene ( )
static

Unregisters a Scene from node addition listening.

Member Data Documentation

std::list< SceneGraphNode* > SceneGraphNode::children

Children

bool SceneGraphNode::dirtyTransform = true
protected

Needed to update children's transform.

unsigned SceneGraphNode::layerMask = 0xFFFFFFFF
protected

Layer mask. Affects Camera-Model interaction.

Matrix44 SceneGraphNode::modelMatrix

Created from position, rotation and parent hierarchy starting from Scene's root node.

std::string SceneGraphNode::name
protected

Needed currently only in Editor.

SceneGraphNode* SceneGraphNode::parent
protected

Parent

Vec3 SceneGraphNode::position
protected

Position

Quaternion SceneGraphNode::rotation
protected

Rotation

float SceneGraphNode::scale
protected

Scale

Type SceneGraphNode::type
protected

Type


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