PixelLightAPI  .
Public Member Functions | Public Attributes
PLScene::SceneContext Class Reference

Scene context. More...

#include <SceneContext.h>

Inheritance diagram for PLScene::SceneContext:
Inheritance graph
[legend]

List of all members.

Public Member Functions

PLS_API SceneContext (PLRenderer::RendererContext &cRendererContext)
 Constructor.
PLS_API ~SceneContext ()
 Destructor.
PLS_API
PLRenderer::RendererContext
GetRendererContext () const
 Returns the used renderer context.
PLS_API PLMesh::MeshManagerGetMeshManager ()
 Returns the mesh manager.
PLS_API PLMath::GraphPathManagerGetGraphPathManager ()
 Returns the graph path manager.
PLS_API SceneContainerGetRoot ()
 Returns the root of the scene graph.
PLS_API void Cleanup ()
 Performs a cleanup-operation (garbage collection)
PLS_API void Update (bool bRespectPause=true)
 Method that is called once per update loop.
PLS_API SceneRendererManagerGetSceneRendererManager ()
 Returns the scene renderer manager.
PLS_API VisManagerGetVisManager ()
 Returns the visibility manager.
PLS_API bool StartProcess ()
 Starts a scene process.
PLS_API bool IsNodeTouched (SceneNode &cSceneNode) const
 Checks whether a scene node was touched.
PLS_API bool TouchNode (SceneNode &cSceneNode)
 Touches a scene node.
PLS_API bool EndProcess ()
 Ends a scene process.

Public Attributes

PLCore::Event EventUpdate

Detailed Description

Scene context.

Note:
  • There should be only one scene context instance per application

Constructor & Destructor Documentation

Constructor.

Parameters:
[in]cRendererContextRenderer context to use

Destructor.


Member Function Documentation

Returns the used renderer context.

Returns:
The used renderer context

Returns the mesh manager.

Returns:
The mesh manager

Returns the graph path manager.

Returns:
The graph path manager

Returns the root of the scene graph.

Returns:
The root of the scene graph, a null pointer on (terrible) error
See also:

Performs a cleanup-operation (garbage collection)

Remarks:
If SceneNode::Delete() is called, scene nodes are not destroyed immediately, instead they register them self into a 'to delete' list of the scene graph. As soon this function is called, the scene nodes are destroyed. Normally this function is called once per frame automatically.
PLS_API void PLScene::SceneContext::Update ( bool  bRespectPause = true)

Method that is called once per update loop.

Parameters:
[in]bRespectPauseRespect pause? ("PLCore::Timing::GetInstance()->IsPaused()")
Remarks:
You can use this method to do work you have to to within each frame. It's recommended to keep the work done within the implementation as compact as possible. Don't use this method to perform 'polling'-everything, use events or if required for example timers instead.

Returns the scene renderer manager.

Returns:
The scene renderer manager

Returns the visibility manager.

Returns:
The visibility manager

Starts a scene process.

Remarks:
During scene traversal using for instance the hierarchy of a scene container, a scene node can be processed multiple times. If this is NOT desired, a scene node must be 'marked' as already processed so it isn't touched multiple times. The scene graph class offers 3 functions for this purpose: StartProcess(), TouchNode() and EndProcess(). If a scene process starts, StartProcess() is called with internally increases a counter. If a node should be processes TouchNode() is called, if 'true' is returned the node was already processed. After the whole scene process is finished, call EndProcess(). This is NOT 'multi threading save' and only ONE scene process can be performed at the same time, but this technique is incredible fast because internally only counters are compared!
Returns:
'true' if all went fine, else 'false' (there's already a process running)
PLS_API bool PLScene::SceneContext::IsNodeTouched ( SceneNode cSceneNode) const

Checks whether a scene node was touched.

Parameters:
[in]cSceneNodeScene node to check
Returns:
'true' if the scene node was touched, else 'false'
See also:
PLS_API bool PLScene::SceneContext::TouchNode ( SceneNode cSceneNode)

Touches a scene node.

Parameters:
[in]cSceneNodeScene node to touch
Returns:
'true' if all went fine and the scene node was touched the first time during the current process, else 'false' if the scene node was already touched during the current process or there's currently no active process or the given scene node is invalid
See also:

Ends a scene process.

See also:
Returns:
'true' if all went fine, else 'false' (there's currently no process running)

Member Data Documentation

Scene context update event


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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:40
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported