OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::SceneManager::Listener Class Reference

Class that allows listening in on the various stages of SceneManager processing, so that custom behaviour can be implemented from outside. More...

#include <OgreSceneManager.h>

+ Inheritance diagram for Ogre::SceneManager::Listener:

Public Member Functions

 Listener ()
 
virtual ~Listener ()
 
virtual void postFindVisibleObjects (SceneManager *source, IlluminationRenderStage irs, Viewport *v)
 Called after searching for visible objects in this SceneManager. More...
 
virtual void preFindVisibleObjects (SceneManager *source, IlluminationRenderStage irs, Viewport *v)
 Called prior to searching for visible objects in this SceneManager. More...
 
virtual void sceneManagerDestroyed (SceneManager *source)
 Event notifying the listener of the SceneManager's destruction. More...
 
virtual void shadowTextureCasterPreViewProj (const Light *light, Camera *camera, size_t iteration)
 This event occurs just before the view & projection matrices are set for rendering into a shadow texture. More...
 
virtual void shadowTexturesUpdated (size_t numberOfShadowTextures)
 Event raised after all shadow textures have been rendered into for all queues / targets but before any other geometry has been rendered (including main scene geometry). More...
 
virtual bool sortLightsAffectingFrustum (LightList &lightList)
 Hook to allow the listener to override the ordering of lights for the entire frustum. More...
 

Detailed Description

Class that allows listening in on the various stages of SceneManager processing, so that custom behaviour can be implemented from outside.

Definition at line 318 of file OgreSceneManager.h.

Constructor & Destructor Documentation

Ogre::SceneManager::Listener::Listener ( )
inline

Definition at line 321 of file OgreSceneManager.h.

virtual Ogre::SceneManager::Listener::~Listener ( )
inlinevirtual

Definition at line 322 of file OgreSceneManager.h.

Member Function Documentation

virtual void Ogre::SceneManager::Listener::postFindVisibleObjects ( SceneManager source,
IlluminationRenderStage  irs,
Viewport v 
)
inlinevirtual

Called after searching for visible objects in this SceneManager.

Remarks
Note that the render queue at this stage will be full of the current scenes contents, ready for rendering. You may manually add renderables to this queue if you wish.
Parameters
sourceThe SceneManager instance raising this event.
irsThe stage of illumination being dealt with. IRS_NONE for a regular render, IRS_RENDER_TO_TEXTURE for a shadow caster render.
vThe viewport being updated. You can get the camera from here.

Reimplemented in Ogre::RTShader::ShaderGenerator::SGSceneManagerListener.

Definition at line 347 of file OgreSceneManager.h.

virtual void Ogre::SceneManager::Listener::preFindVisibleObjects ( SceneManager source,
IlluminationRenderStage  irs,
Viewport v 
)
inlinevirtual

Called prior to searching for visible objects in this SceneManager.

Remarks
Note that the render queue at this stage will be full of the last render's contents and will be cleared after this method is called.
Parameters
sourceThe SceneManager instance raising this event.
irsThe stage of illumination being dealt with. IRS_NONE for a regular render, IRS_RENDER_TO_TEXTURE for a shadow caster render.
vThe viewport being updated. You can get the camera from here.

Reimplemented in Ogre::Terrain, and Ogre::RTShader::ShaderGenerator::SGSceneManagerListener.

Definition at line 333 of file OgreSceneManager.h.

virtual void Ogre::SceneManager::Listener::sceneManagerDestroyed ( SceneManager source)
inlinevirtual

Event notifying the listener of the SceneManager's destruction.

Reimplemented in Ogre::Terrain.

Definition at line 410 of file OgreSceneManager.h.

virtual void Ogre::SceneManager::Listener::shadowTextureCasterPreViewProj ( const Light light,
Camera camera,
size_t  iteration 
)
inlinevirtual

This event occurs just before the view & projection matrices are set for rendering into a shadow texture.

Remarks
You can use this event hook to perform some custom processing, such as altering the camera being used for rendering the light's view, including setting custom view & projection matrices if you want to perform an advanced shadow technique.
Note
This event will only be fired when texture shadows are in use.
Parameters
lightPointer to the light for which shadows are being rendered
cameraPointer to the camera being used to render
iterationFor lights that use multiple shadow textures, the iteration number

Definition at line 380 of file OgreSceneManager.h.

virtual void Ogre::SceneManager::Listener::shadowTexturesUpdated ( size_t  numberOfShadowTextures)
inlinevirtual

Event raised after all shadow textures have been rendered into for all queues / targets but before any other geometry has been rendered (including main scene geometry).

Remarks
This callback is useful for those that wish to perform some additional processing on shadow textures before they are used to render shadows. For example you could perform some filtering by rendering the existing shadow textures into another alternative shadow texture with a shader.]
Note
This event will only be fired when texture shadows are in use.
Parameters
numberOfShadowTexturesThe number of shadow textures in use

Reimplemented in Ogre::RTShader::ShaderGenerator::SGSceneManagerListener.

Definition at line 364 of file OgreSceneManager.h.

virtual bool Ogre::SceneManager::Listener::sortLightsAffectingFrustum ( LightList lightList)
inlinevirtual

Hook to allow the listener to override the ordering of lights for the entire frustum.

Remarks
Whilst ordinarily lights are sorted per rendered object (
See also
MovableObject::queryLights), texture shadows adds another issue in that, given there is a finite number of shadow textures, we must choose which lights to render texture shadows from based on the entire frustum. These lights should always be listed first in every objects own list, followed by any other lights which will not cast texture shadows (either because they have shadow casting off, or there aren't enough shadow textures to service them).
This hook allows you to override the detailed ordering of the lights per frustum. The default ordering is shadow casters first (which you must also respect if you override this method), and ordered by distance from the camera within those 2 groups. Obviously the closest lights with shadow casting enabled will be listed first. Only lights within the range of the frustum will be in the list.
Parameters
lightListThe list of lights within range of the frustum which you may sort.
Returns
true if you sorted the list, false otherwise.

Definition at line 406 of file OgreSceneManager.h.


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