#include <PhSceneManager.h>
Public Member Functions | |
PhSceneNode () | |
Constructor. | |
virtual | ~PhSceneNode () |
Virtual destructor. | |
virtual void | onPreRender () |
Pre-render call. | |
virtual void | onRender () |
Render call. | |
virtual void | onPostRender () |
Post-render call. | |
void | setDepth (float d) |
Set depth function. | |
float | getDepth () |
Get depth function. | |
Protected Attributes | |
float | depth |
Depth value. |
This is the prototype for a scenenode, all scenenodes should be derived from this class.
phoenix::PhSceneNode::PhSceneNode | ( | ) | [inline] |
Constructor.
Does nothing as this is a base class meant to be derived from.
virtual phoenix::PhSceneNode::~PhSceneNode | ( | ) | [inline, virtual] |
Virtual destructor.
Does nothing.
virtual void phoenix::PhSceneNode::onPreRender | ( | ) | [inline, virtual] |
Pre-render call.
All nodes in the list will have this function called by the scenemanger once per frame. Overloading this is required. If the scene node wants to be drawn it must call phoenix::PhSceneManger::registerForRendering().
Reimplemented in phoenix::PhBackground, phoenix::PhDrawSceneNode, phoenix::PhExtendedBackground, phoenix::PhSolidBackground, phoenix::PhSpriteAnimation, and phoenix::PhTileMap.
virtual void phoenix::PhSceneNode::onRender | ( | ) | [inline, virtual] |
Render call.
Any nodes that called phoenix::PhSceneManger::registerForRendering() will first be sorted according to their depth, then this function is called for each node in order. It is highly suggested that you put any drawing code in this function. Of course, it's possible to draw during any of the three node passes, but this pass is the only one that is exclusive (Nodes must register) and is the only one that is depth sorted.
Reimplemented in phoenix::PhBackground, phoenix::PhDrawSceneNode, phoenix::PhExtendedBackground, phoenix::PhSolidBackground, phoenix::PhSpriteAnimation, and phoenix::PhTileMap.
virtual void phoenix::PhSceneNode::onPostRender | ( | ) | [inline, virtual] |
Post-render call.
The third render pass takes place at the end of every frame, the scene manager calls this function for every node in the list, and any code that should happen after everything is drawn should go here.
Reimplemented in phoenix::PhBackground, phoenix::PhDrawSceneNode, phoenix::PhExtendedBackground, phoenix::PhSolidBackground, phoenix::PhSpriteAnimation, and phoenix::PhTileMap.
void phoenix::PhSceneNode::setDepth | ( | float | d | ) | [inline] |
float phoenix::PhSceneNode::getDepth | ( | ) | [inline] |
float phoenix::PhSceneNode::depth [protected] |
Depth value.
This value is used by the scenemanger to depth sort all drawn nodes. if your object does not execute the onRender() call, then it does not matter to you.