Couch
Public Member Functions | Static Public Member Functions | Friends | List of all members
Node Class Reference

#include <Node.h>

Inheritance diagram for Node:
Inheritance graph
[legend]

Public Member Functions

 Node (bool isPrefab)
 
virtual Name GetType () const
 
bool IsPrefab ()
 
NodeList GetChildren ()
 
void AddChild (Node *child)
 
NodeGetParent ()
 
void QueueFree ()
 
void DoFree ()
 
virtual NodeCreate ()
 
virtual NodeDuplicate ()
 
virtual NodeInstance ()
 

Static Public Member Functions

static NodeGetRoot ()
 

Friends

class NodeList
 

Detailed Description

The parent class for any object that will go into the scene tree

Member Function Documentation

◆ AddChild()

void Node::AddChild ( Node child)

Adds a node to this nodes list of children

Parameters
childThe node to add

◆ Create()

Node * Node::Create ( )
virtual

Allocates a new "default" version of this node.

Returns
A reference to the node.

Reimplemented in Spatial, Skybox, Rigidbody, Mesh, PointLight, DirectionalLight, and Light.

◆ DoFree()

void Node::DoFree ( )

Actually frees the memory Should only be called from root

◆ Duplicate()

Node * Node::Duplicate ( )
virtual

Copies the properties of this node to a newly allocated node, created via Create. Subclasses should override this to copy additional class attributes

Returns
A reference to the duplicate

Reimplemented in Spatial, Skybox, Rigidbody, Mesh, PointLight, DirectionalLight, and Light.

◆ GetChildren()

NodeList Node::GetChildren ( )

Returns the children of this node

Returns
The list of children

◆ GetParent()

Node * Node::GetParent ( )
Returns
This node's parent;

◆ GetRoot()

Node * Node::GetRoot ( )
static

Gets the root of the game scene tree

Returns
The root node

◆ Instance()

Node * Node::Instance ( )
virtual

Creates an instanced version of this node, by calling Duplicate. Subclasses should override this to perform neccesary tasks for instantiation, i.e. adding a physic object to the physics world. Any children of this node will also be instanced.

Returns
an instanced version of this node.

Reimplemented in Spatial, Skybox, Rigidbody, Mesh, PointLight, DirectionalLight, and Light.

◆ IsPrefab()

bool Node::IsPrefab ( )

Whether or not this object is a prefab, that is, if it is an object being set up to be instanced one or more times. The alternative to being a prefab is being instanced, in which case it will be drawn, added to the physics system, etc.

Returns
true if the object is a prefab, false if it is instanced.

◆ QueueFree()

void Node::QueueFree ( )

Remove this node and it's children from the tree and queue their memory for freeing


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