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

◆ Type

enum SceneGraphNode::Type
strong

Graph node type.

Constructor & Destructor Documentation

◆ SceneGraphNode()

SceneGraphNode::SceneGraphNode ( )

Constructor

◆ ~SceneGraphNode()

SceneGraphNode::~SceneGraphNode ( )
virtual

Destructor

Member Function Documentation

◆ AddChild()

bool SceneGraphNode::AddChild ( SceneGraphNode child)
virtual
Parameters
childChild.
Returns
True if succeeded, false if failed.

◆ Children()

virtual std::list< SceneGraphNode* >& SceneGraphNode::Children ( )
inlinevirtual
Returns
children

◆ CleanDirties()

void SceneGraphNode::CleanDirties ( )

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

◆ ContainsChild()

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.

◆ FindFirstChildWithName()

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.

◆ GetLayerMask()

virtual unsigned SceneGraphNode::GetLayerMask ( ) const
inlinevirtual
Returns
layer mask.

◆ GetName()

virtual std::string SceneGraphNode::GetName ( ) const
inlinevirtual
Returns
name

◆ GetPosition()

virtual Vec3 SceneGraphNode::GetPosition ( ) const
inlinevirtual
Returns
Local position.

◆ GetRotation()

virtual Quaternion SceneGraphNode::GetRotation ( ) const
inlinevirtual
Returns
Local rotation.

◆ GetScale()

virtual float SceneGraphNode::GetScale ( ) const
inlinevirtual
Returns
Local scale.

◆ GetType()

virtual Type SceneGraphNode::GetType ( ) const
inlinevirtual
Returns
type

◆ IsDirty()

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 )

◆ Parent()

virtual SceneGraphNode* SceneGraphNode::Parent ( )
inlinevirtual
Returns
parent

◆ RegisterScene()

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.

◆ Root()

SceneGraphNode * SceneGraphNode::Root ( )
virtual
Returns
root

◆ SetLayerMask()

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.

◆ SetName()

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

newName Name.

◆ SetPosition()

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

Reimplemented in Light.

◆ SetRotation()

virtual void SceneGraphNode::SetRotation ( const Quaternion aRotation)
inlinevirtual
Parameters
aRotationAbsolute rotation.

◆ SetScale()

virtual void SceneGraphNode::SetScale ( float  aScale)
inlinevirtual
Parameters
aScaleAbsolute scale

◆ SolveMatrices()

void SceneGraphNode::SolveMatrices ( )
virtual

Traverses the graph and creates transformation matrices.

◆ UnregisterScene()

void SceneGraphNode::UnregisterScene ( )
static

Unregisters a Scene from node addition listening.

Member Data Documentation

◆ children

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

Children

◆ dirtyTransform

bool SceneGraphNode::dirtyTransform = true
protected

Needed to update children's transform.

◆ layerMask

unsigned SceneGraphNode::layerMask = 0xFFFFFFFF
protected

Layer mask. Affects Camera-Model interaction.

◆ modelMatrix

Matrix44 SceneGraphNode::modelMatrix

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

◆ name

std::string SceneGraphNode::name
protected

Needed currently only in Editor.

◆ parent

SceneGraphNode* SceneGraphNode::parent
protected

Parent

◆ position

Vec3 SceneGraphNode::position
protected

Position

◆ rotation

Quaternion SceneGraphNode::rotation
protected

Rotation

◆ scale

float SceneGraphNode::scale
protected

Scale

◆ type

Type SceneGraphNode::type
protected

Type


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