phoenix::PhSceneManager Class Reference

Scene Manger Class. More...

#include <PhSceneManager.h>

List of all members.

Public Member Functions

 PhSceneManager (PhRenderSystem *s)
 Constructor.
 ~PhSceneManager ()
 Destructor.
PhRenderSystemgetRenderSystem ()
 Get render system call.
void addNode (PhSceneNode *ptr)
 Adds a scene node to the list.
void removeNode (PhSceneNode *ptr)
 Removes a node from the list.
void registerForRendering (PhSceneNode *ptr)
 Register a node to be rendered.
void drawAll ()
 Does one step for all the nodes.
PhPolygonCollisionHandlergetCollisionHandler ()
 Gets the collision handler.
void setCollisionHandler (PhPolygonCollisionHandler *a)
 Sets a collision handler.
PhViewgetView ()
 Gets the current view.
void setView (PhView *a)
 Sets the current view.
void setView (int x, int y)
 Sets the current view.

Protected Attributes

PhRenderSystemsystem
 Pointer to phoenix::PhRenderSystem.
std::vector< PhSceneNode * > nodes
 Vector containing all the nodes.
std::vector< PhSceneNode * > rendernodes
 List of nodes to be rendered.
PhPolygonCollisionHandlercolhandle
 Pointer to the collision handler.
int nodecount
 Number of nodes.
int rnodecount
 Number of nodes to be rendered.
PhViewdefview
 The default view.


Detailed Description

Scene Manger Class.

This is the phoenix scene manager. This allows for a representation of all objects in the game through the use of nodes. All objects are nodes and all nodes are dervied from phoenix::PhSceneNode. This class organizes and manages all scene nodes.


Constructor & Destructor Documentation

phoenix::PhSceneManager::PhSceneManager ( PhRenderSystem s  ) 

Constructor.

Simply makes a new scenemanager that uses the defined rendersystem

Parameters:
s A pointer to the rendersystem that every object will use.
See also:
phoenix::PhRenderSystem

phoenix::PhSceneManager::~PhSceneManager (  ) 

Destructor.

Deletes all nodes in the list.


Member Function Documentation

PhRenderSystem* phoenix::PhSceneManager::getRenderSystem (  ) 

Get render system call.

Returns a pointer to the render system used by this scenemanger.

See also:
phoenix::PhRenderSystem()
Returns:
A pointer to phoenix::PhRenderSystem().

void phoenix::PhSceneManager::addNode ( PhSceneNode ptr  ) 

Adds a scene node to the list.

Pushes a scene node onto the list.

Parameters:
ptr A pointer to phoenix::PhSceneNode.

void phoenix::PhSceneManager::removeNode ( PhSceneNode ptr  ) 

Removes a node from the list.

Finds and removes the node given from the list. Does not actually delete the node.

Parameters:
ptr A pointer to phoenix::PhSceneNode.

void phoenix::PhSceneManager::registerForRendering ( PhSceneNode ptr  ) 

Register a node to be rendered.

Registers a scene node to the lists of nodes to be rendered. This list is depth sorted after the pre render pass and then only the nodes in this list have their phoenix::PhSceneNode::onRender() function called.

Parameters:
ptr A pointer to phoenix::PhSceneNode.
See also:
phoenix::PhSceneNode::onRender(), drawAll()

void phoenix::PhSceneManager::drawAll (  ) 

Does one step for all the nodes.

This function's name is a bit misleading (change in future versions?). This call is the main point of the scene manager. It does the following: 1) Calls onPreRender() for all the nodes 2) If applicable, check for collisions 3) Sorts all the nodes to be "drawn" 4) Calls onRender() for the sorted nodes in order 5) Calls onPostRender() for all nodes.

See also:
registerForRendering(), setCollisionHandler(), phoenix::PhSceneNode

PhPolygonCollisionHandler* phoenix::PhSceneManager::getCollisionHandler (  ) 

Gets the collision handler.

This gets the currently collision handler that the scene manager is using to test collisions with.

Returns:
A pointer to phoenix::PhPolygonCollisionHandler
See also:
setCollisionHandler(), phoenix::PhPolygonCollisionHandler.

void phoenix::PhSceneManager::setCollisionHandler ( PhPolygonCollisionHandler a  ) 

Sets a collision handler.

This sets the collision manager that the scene manager will use to check for collisions. If this is set, then phoenix::PhPolygonCollisionHandler::testCollisions() is called after every prerender pass. If it is null then of course nothing happens.

Parameters:
a A pointer to phoenix::PhPolygonCollisionHandler.
See also:
getCollisionHandler(), phoenix::PhPolygonCollisionHandler, drawAll(), colhandle

PhView* phoenix::PhSceneManager::getView (  ) 

Gets the current view.

Simply returns a pointer to the current view used by the scene manager.

Returns:
a pointer to phoenix::PhView
See also:
setView(), phoenix::PhView

void phoenix::PhSceneManager::setView ( PhView a  ) 

Sets the current view.

Sets the current view to the given view.

Parameters:
a a pointer to the new view
See also:
getView(), phoenix::PhView

void phoenix::PhSceneManager::setView ( int  x,
int  y 
)

Sets the current view.

Lazy version that simply changes the x and y of the current view.

Parameters:
x The new X coordinate of the view.
y The new Y coordinate of the view.
See also:
getView(), phoenix::PhView


Member Data Documentation

PhRenderSystem* phoenix::PhSceneManager::system [protected]

Pointer to phoenix::PhRenderSystem.

Stores a pointer the render system used to draw all the nodes.

See also:
getRenderSystem()

std::vector<PhSceneNode*> phoenix::PhSceneManager::nodes [protected]

Vector containing all the nodes.

This is a vector that contains pointers to every node in the scene graph.

See also:
addNode(), removeNode()

std::vector<PhSceneNode*> phoenix::PhSceneManager::rendernodes [protected]

List of nodes to be rendered.

This is a list of all nodes that call registerForRendering(), it is sorted and used to call phoenix::PhSceneNode::onRender() in order.

See also:
drawAll(), registerForRendering()

PhPolygonCollisionHandler* phoenix::PhSceneManager::colhandle [protected]

Pointer to the collision handler.

This holds a pointer to phoenix::PhPolygonCollisionHanlder. When this is not null, the scene manager takes care of checking for collisions and does it after the pre-render sweep and before the render sweep.

See also:
phoenix::PhCollisionHandler, drawAll(), setCollisionHandler(), getCollisionHandler()

int phoenix::PhSceneManager::nodecount [protected]

Number of nodes.

A simple count of all the nodes, probably not needed. (Could use std::vector::size())

int phoenix::PhSceneManager::rnodecount [protected]

Number of nodes to be rendered.

A simple count of all the nodes to be rendered, probably not needed. (Could use std::vector::size())

PhView* phoenix::PhSceneManager::defview [protected]

The default view.

A simple count of all the nodes, probably not needed. (Could use std::vector::size())

See also:
getView(), setView()


The documentation for this class was generated from the following file:
Generated on Tue Nov 20 21:59:24 2007 for Phoenix by  doxygen 1.5.4