OGRE  1.12.13
Object-Oriented Graphics Rendering Engine
Ogre::SceneManager Class Referenceabstract

Manages the organisation and rendering of a 'scene': a collection of objects and potentially world geometry. More...

#include <OgreSceneManager.h>

+ Inheritance diagram for Ogre::SceneManager:

Classes

struct  lightLess
 Comparator for sorting lights relative to a point. More...
 
class  Listener
 Class that allows listening in on the various stages of SceneManager processing, so that custom behaviour can be implemented from outside. More...
 
struct  materialLess
 Comparator for material map, for sorting materials into render order (e.g. More...
 
struct  RenderContext
 
class  SceneMgrQueuedRenderableVisitor
 Inner helper class to implement the visitor pattern for rendering objects in a queue. More...
 
struct  SkyBoxGenParameters
 
struct  SkyDomeGenParameters
 
struct  SkyPlaneGenParameters
 

Public Types

typedef MapIterator< AnimationListAnimationIterator
 
typedef std::map< String, Animation * > AnimationList
 
typedef MapIterator< CameraListCameraIterator
 
typedef std::map< String, Camera * > CameraList
 
enum  IlluminationRenderStage { IRS_NONE, IRS_RENDER_TO_TEXTURE, IRS_RENDER_RECEIVER_PASS }
 Describes the stage of rendering when performing complex illumination. More...
 
typedef MapIterator< MovableObjectMapMovableObjectIterator
 
typedef std::map< String, MovableObject * > MovableObjectMap
 
enum  PrefabType { PT_PLANE, PT_CUBE, PT_SPHERE }
 Prefab shapes available without loading a model. More...
 
enum  QueryTypeMask : uint32 {
  WORLD_GEOMETRY_TYPE_MASK = 0x80000000, ENTITY_TYPE_MASK = 0x40000000, FX_TYPE_MASK = 0x20000000, STATICGEOMETRY_TYPE_MASK = 0x10000000,
  LIGHT_TYPE_MASK = 0x08000000, FRUSTUM_TYPE_MASK = 0x04000000, USER_TYPE_MASK_LIMIT = FRUSTUM_TYPE_MASK
}
 
enum  SpecialCaseRenderQueueMode { SCRQM_INCLUDE, SCRQM_EXCLUDE }
 Enumeration of the possible modes allowed for processing the special case render queue list. More...
 

Public Member Functions

 SceneManager (const String &instanceName)
 Constructor. More...
 
virtual ~SceneManager ()
 Default destructor. More...
 
bool _areRenderStateChangesSuppressed (void) const
 Are render state changes suppressed? More...
 
virtual void _findVisibleObjects (Camera *cam, VisibleObjectsBoundsInfo *visibleBounds, bool onlyShadowCasters)
 Internal method which parses the scene to find visible objects to render. More...
 
CompositorChain_getActiveCompositorChain () const
 Gets the active compositor chain of the current scene being rendered. More...
 
const AutoParamDataSource_getAutoParamDataSource ()
 
uint32 _getCombinedVisibilityMask (void) const
 Internal method for getting the combination between the global visibility mask and the per-viewport visibility mask. More...
 
IlluminationRenderStage _getCurrentRenderStage ()
 
void _handleLodEvents ()
 Handle LOD events. More...
 
void _injectRenderWithPass (Pass *pass, Renderable *rend, bool shadowDerivation=true, bool doLightIteration=false, const LightList *manualLightList=0)
 Render something as if it came from the current queue. More...
 
void _issueRenderOp (Renderable *rend, const Pass *pass)
 Internal method for issuing the render operation. More...
 
void _markGpuParamsDirty (uint16 mask)
 Method to allow you to mark gpu parameters as dirty, causing them to be updated according to the mask that you set when updateGpuProgramParameters is next called. More...
 
void _notifyAutotrackingSceneNode (SceneNode *node, bool autoTrack)
 Internal method for notifying the manager that a SceneNode is autotracking. More...
 
void _notifyEntityMaterialLodChanged (EntityMaterialLodChangedEvent &evt)
 Notify that an entity material LOD change event has occurred. More...
 
void _notifyEntityMeshLodChanged (EntityMeshLodChangedEvent &evt)
 Notify that an entity mesh LOD change event has occurred. More...
 
void _notifyMovableObjectLodChanged (MovableObjectLodChangedEvent &evt)
 Notify that a movable object LOD change event has occurred. More...
 
RenderContext_pauseRendering ()
 Pause rendering of the frame. More...
 
void _releaseManualHardwareResources ()
 Notifies the scene manager that hardware resources were lost. More...
 
void _renderQueueGroupObjects (RenderQueueGroup *group, QueuedRenderableCollection::OrganisationMode om)
 Render the objects in a given queue group. More...
 
virtual void _renderScene (Camera *camera, Viewport *vp, bool includeOverlays=true)
 Prompts the class to send its contents to the renderer. More...
 
void _renderVisibleObjects (void)
 Sends visible objects found in _findVisibleObjects to the rendering engine. More...
 
void _restoreManualHardwareResources ()
 Notifies the scene manager that hardware resources should be restored. More...
 
void _resumeRendering (RenderContext *context)
 Resume rendering of the frame. More...
 
void _setActiveCompositorChain (CompositorChain *chain)
 Sets the active compositor chain of the current scene being rendered. More...
 
void _setDestinationRenderSystem (RenderSystem *sys)
 Notifies the scene manager of its destination render system. More...
 
const Pass_setPass (const Pass *pass, bool evenIfSuppressed=false, bool shadowDerivation=true)
 Internal method for setting up the renderstate for a rendering pass. More...
 
void _suppressRenderStateChanges (bool suppress)
 Indicates to the SceneManager whether it should suppress changing the RenderSystem states when rendering objects. More...
 
virtual void _updateSceneGraph (Camera *cam)
 Internal method for updating the scene graph ie the tree of SceneNode instances managed by this class. More...
 
void addListener (Listener *s)
 Add a listener which will get called back on scene manager events. More...
 
void addLodListener (LodListener *listener)
 Add a level of detail listener. More...
 
void addRenderObjectListener (RenderObjectListener *newListener)
 Registers a new Render Object Listener which will be notified when rendering an object. More...
 
void addRenderQueueListener (RenderQueueListener *newListener)
 Registers a new RenderQueueListener which will be notified when render queues are processed. More...
 
void addSpecialCaseRenderQueue (uint8 qid)
 Adds an item to the 'special case' render queue list. More...
 
virtual void clearScene (void)
 Empties the entire scene, inluding all SceneNodes, Entities, Lights, BillboardSets etc. More...
 
void clearSpecialCaseRenderQueues (void)
 Clears the 'special case' render queue list. More...
 
const ColourValuegetAmbientLight (void) const
 Returns the ambient light level to be used for the scene. More...
 
ViewportgetCurrentViewport (void) const
 Gets the current viewport being rendered (advanced use only, only valid during viewport update. More...
 
RenderSystemgetDestinationRenderSystem ()
 Get the rendersystem subclass to which the output of this Scene Manager gets sent. More...
 
bool getFindVisibleObjects (void)
 Gets whether the SceneManager should search for visible objects, or whether they are being manually handled. More...
 
bool getFlipCullingOnNegativeScale () const
 Get whether to automatically flip the culling mode on objects whenever they are negatively scaled. More...
 
const StringgetName (void) const
 Return the instance name of this SceneManager. More...
 
bool getNormaliseNormalsOnScale () const
 Get whether to automatically normalise normals on objects whenever they are scaled. More...
 
virtual bool getOption (const String &strKey, void *pDestValue)
 Method for getting the value of an implementation-specific Scene Manager option. More...
 
virtual bool getOptionKeys (StringVector &refKeys)
 Method for getting all the implementation-specific options of the scene manager. More...
 
virtual bool getOptionValues (const String &strKey, StringVector &refValueList)
 Method for getting all possible values for a specific option. More...
 
SceneMgrQueuedRenderableVisitorgetQueuedRenderableVisitor (void) const
 Gets the current visitor object which processes queued renderables. More...
 
RenderQueuegetRenderQueue (void)
 Retrieves the internal render queue, for advanced users only. More...
 
const VisibleObjectsBoundsInfogetShadowCasterBoundsInfo (const Light *light, size_t iteration=0) const
 Returns the shadow caster AAB for a specific light-camera combination. More...
 
SpecialCaseRenderQueueMode getSpecialCaseRenderQueueMode (void)
 Gets the way the special case render queue list is processed. More...
 
virtual ViewPoint getSuggestedViewpoint (bool random=false)
 Asks the SceneManager to provide a suggested viewpoint from which the scene should be viewed. More...
 
virtual const StringgetTypeName (void) const =0
 Retrieve the type name of this scene manager. More...
 
uint32 getVisibilityMask (void)
 Gets a mask which is bitwise 'and'ed with objects own visibility masks to determine if the object is visible. More...
 
const VisibleObjectsBoundsInfogetVisibleObjectsBoundsInfo (const Camera *cam) const
 Returns a visibility boundary box for a specific camera. More...
 
uint8 getWorldGeometryRenderQueue (void)
 Gets the render queue that the world geometry (if any) this SceneManager renders will be associated with. More...
 
virtual bool hasOption (const String &strKey) const
 Method for verifying whether the scene manager has an implementation-specific option. More...
 
bool isLateMaterialResolving () const
 Gets whether using late material resolving or not. More...
 
bool isRenderQueueToBeProcessed (uint8 qid)
 Returns whether or not the named queue will be rendered based on the current 'special case' render queue list and mode. More...
 
void manualRender (Renderable *rend, const Pass *pass, Viewport *vp, const Affine3 &viewMatrix, const Matrix4 &projMatrix, bool doBeginEndFrame=false, bool lightScissoringClipping=true, bool doLightIteration=true, const LightList *manualLightList=0)
 Manual rendering method for rendering a single object. More...
 
void manualRender (RenderOperation *rend, Pass *pass, Viewport *vp, const Affine3 &worldMatrix, const Affine3 &viewMatrix, const Matrix4 &projMatrix, bool doBeginEndFrame=false)
 Manual rendering method, for advanced users only. More...
 
 OGRE_MUTEX (sceneGraphMutex)
 Mutex to protect the scene graph from simultaneous access from multiple threads. More...
 
void removeListener (Listener *s)
 Remove a listener. More...
 
void removeLodListener (LodListener *listener)
 Remove a level of detail listener. More...
 
void removeRenderObjectListener (RenderObjectListener *delListener)
 Removes a listener previously added with addRenderObjectListener. More...
 
void removeRenderQueueListener (RenderQueueListener *delListener)
 Removes a listener previously added with addRenderQueueListener. More...
 
void removeSpecialCaseRenderQueue (uint8 qid)
 Removes an item to the 'special case' render queue list. More...
 
void setAmbientLight (const ColourValue &colour)
 Sets the ambient light level to be used for the scene. More...
 
void setFindVisibleObjects (bool find)
 Sets whether the SceneManager should search for visible objects, or whether they are being manually handled. More...
 
void setFlipCullingOnNegativeScale (bool n)
 Set whether to automatically flip the culling mode on objects whenever they are negatively scaled. More...
 
void setLateMaterialResolving (bool isLate)
 Sets whether to use late material resolving or not. More...
 
void setNormaliseNormalsOnScale (bool n)
 Set whether to automatically normalise normals on objects whenever they are scaled. More...
 
virtual bool setOption (const String &strKey, const void *pValue)
 Method for setting a specific option of the Scene Manager. More...
 
void setQueuedRenderableVisitor (SceneMgrQueuedRenderableVisitor *visitor)
 Advanced method for supplying an alternative visitor, used for parsing the render queues and sending the results to the renderer. More...
 
void setSpecialCaseRenderQueueMode (SpecialCaseRenderQueueMode mode)
 Sets the way the special case render queue list is processed. More...
 
void setVisibilityMask (uint32 vmask)
 Sets a mask which is bitwise 'and'ed with objects own visibility masks to determine if the object is visible. More...
 
void setWorldGeometryRenderQueue (uint8 qid)
 Sets the render queue that the world geometry (if any) this SceneManager renders will be associated with. More...
 
Cameras
virtual CameracreateCamera (const String &name)
 Creates a camera to be managed by this scene manager. More...
 
CameragetCamera (const String &name) const
 Retrieves a pointer to the named camera. More...
 
bool hasCamera (const String &name) const
 Returns whether a camera with the given name exists. More...
 
virtual void destroyCamera (Camera *cam)
 Removes a camera from the scene. More...
 
virtual void destroyCamera (const String &name)
 Removes a camera from the scene. More...
 
virtual void destroyAllCameras (void)
 Removes (and destroys) all cameras from the scene. More...
 
void setCameraRelativeRendering (bool rel)
 Set whether to use camera-relative co-ordinates when rendering, ie to always place the camera at the origin and move the world around it. More...
 
bool getCameraRelativeRendering () const
 Get whether to use camera-relative co-ordinates when rendering, ie to always place the camera at the origin and move the world around it. More...
 
CameraIterator getCameraIterator (void)
 Returns a specialised MapIterator over all cameras in the scene. More...
 
const CameraListgetCameras () const
 Returns a const version of the camera list. More...
 
Lights
virtual LightcreateLight (const String &name)
 Creates a light for use in the scene. More...
 
LightcreateLight (const String &name, Light::LightTypes type)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual LightcreateLight ()
 Creates a light with a generated name. More...
 
LightcreateLight (Light::LightTypes type)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual LightgetLight (const String &name) const
 Returns a pointer to the named Light which has previously been added to the scene. More...
 
virtual bool hasLight (const String &name) const
 Returns whether a light with the given name exists. More...
 
const PlaneListgetLightClippingPlanes (Light *l)
 Retrieve a set of clipping planes for a given light. More...
 
const RealRectgetLightScissorRect (Light *l, const Camera *cam)
 Retrieve a scissor rectangle for a given light and camera. More...
 
virtual void invalidatePerFrameScissorRectCache ()
 Scissor rects are cached during frame, and this cache should be explicitly invalidated if several renders are done during one frame using different projections matrices, for example for tiled, stereo or multiview orthographic projection rendering. More...
 
virtual void destroyLight (const String &name)
 Removes the named light from the scene and destroys it. More...
 
virtual void destroyLight (Light *light)
 Removes the light from the scene and destroys it based on a pointer. More...
 
virtual void destroyAllLights (void)
 Removes and destroys all lights in the scene. More...
 
void _notifyLightsDirty (void)
 Advanced method to increase the lights dirty counter due to lights having changed. More...
 
ulong _getLightsDirtyCounter (void) const
 Advanced method to gets the lights dirty counter. More...
 
const LightList_getLightsAffectingFrustum (void) const
 Get the list of lights which could be affecting the frustum. More...
 
void _populateLightList (const Vector3 &position, Real radius, LightList &destList, uint32 lightMask=0xFFFFFFFF)
 Populate a light list with an ordered set of the lights which are closest to the position specified. More...
 
void _populateLightList (const SceneNode *sn, Real radius, LightList &destList, uint32 lightMask=0xFFFFFFFF)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
Scene Nodes
virtual SceneNodecreateSceneNode (void)
 Creates an instance of a SceneNode. More...
 
virtual SceneNodecreateSceneNode (const String &name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual void destroySceneNode (SceneNode *sn)
 Destroys a SceneNode. More...
 
virtual void destroySceneNode (const String &name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
SceneNodegetRootSceneNode (void)
 Gets the SceneNode at the root of the scene hierarchy. More...
 
SceneNodegetSceneNode (const String &name, bool throwExceptionIfNotFound=true) const
 Retrieves a named SceneNode from the scene graph. More...
 
bool hasSceneNode (const String &name) const
 Returns whether a scene node with the given name exists. More...
 
void setDisplaySceneNodes (bool display)
 Tells the SceneManager whether it should render the SceneNodes which make up the scene as well as the objects in the scene. More...
 
bool getDisplaySceneNodes (void) const
 Returns true if all scene nodes axis are to be displayed. More...
 
void showBoundingBoxes (bool bShow)
 Allows all bounding boxes of scene nodes to be displayed. More...
 
bool getShowBoundingBoxes () const
 Returns if all bounding boxes of scene nodes are to be displayed. More...
 
DebugDrawergetDebugDrawer ()
 
Entities
EntitycreateEntity (const String &entityName, const String &meshName, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Create an Entity (instance of a discrete mesh). More...
 
EntitycreateEntity (const String &entityName, const MeshPtr &pMesh)
 Create an Entity (instance of a discrete mesh). More...
 
EntitycreateEntity (const String &meshName)
 Create an Entity (instance of a discrete mesh) with an autogenerated name. More...
 
EntitycreateEntity (const MeshPtr &pMesh)
 Create an Entity (instance of a discrete mesh) with an autogenerated name. More...
 
EntitycreateEntity (const String &entityName, PrefabType ptype)
 Create an Entity (instance of a discrete mesh) from a range of prefab shapes. More...
 
EntitycreateEntity (PrefabType ptype)
 Create an Entity (instance of a discrete mesh) from a range of prefab shapes, generating the name. More...
 
EntitygetEntity (const String &name) const
 Retrieves a pointer to the named Entity. More...
 
bool hasEntity (const String &name) const
 Returns whether an entity with the given name exists. More...
 
void destroyEntity (Entity *ent)
 Removes & destroys an Entity from the SceneManager. More...
 
void destroyEntity (const String &name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual void destroyAllEntities (void)
 Removes & destroys all Entities. More...
 
Manual Objects
ManualObjectcreateManualObject (const String &name)
 Create a ManualObject, an object which you populate with geometry manually through a GL immediate-mode style interface. More...
 
ManualObjectcreateManualObject ()
 Create a ManualObject, an object which you populate with geometry manually through a GL immediate-mode style interface, generating the name. More...
 
ManualObjectgetManualObject (const String &name) const
 Retrieves a pointer to the named ManualObject. More...
 
bool hasManualObject (const String &name) const
 Returns whether a manual object with the given name exists. More...
 
void destroyManualObject (ManualObject *obj)
 Removes & destroys a ManualObject from the SceneManager. More...
 
void destroyManualObject (const String &name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void destroyAllManualObjects (void)
 Removes & destroys all ManualObjects from the SceneManager. More...
 
Billboard Chains
BillboardChaincreateBillboardChain (const String &name)
 Create a BillboardChain, an object which you can use to render a linked chain of billboards. More...
 
BillboardChaincreateBillboardChain ()
 Create a BillboardChain, an object which you can use to render a linked chain of billboards, with a generated name. More...
 
BillboardChaingetBillboardChain (const String &name) const
 Retrieves a pointer to the named BillboardChain. More...
 
bool hasBillboardChain (const String &name) const
 Returns whether a billboard chain with the given name exists. More...
 
void destroyBillboardChain (BillboardChain *obj)
 Removes & destroys a BillboardChain from the SceneManager. More...
 
void destroyBillboardChain (const String &name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void destroyAllBillboardChains (void)
 Removes & destroys all BillboardChains from the SceneManager. More...
 
RibbonTrailcreateRibbonTrail (const String &name)
 Create a RibbonTrail, an object which you can use to render a linked chain of billboards which follows one or more nodes. More...
 
RibbonTrailcreateRibbonTrail ()
 Create a RibbonTrail, an object which you can use to render a linked chain of billboards which follows one or more nodes, generating the name. More...
 
RibbonTrailgetRibbonTrail (const String &name) const
 Retrieves a pointer to the named RibbonTrail. More...
 
bool hasRibbonTrail (const String &name) const
 Returns whether a ribbon trail with the given name exists. More...
 
void destroyRibbonTrail (RibbonTrail *obj)
 Removes & destroys a RibbonTrail from the SceneManager. More...
 
void destroyRibbonTrail (const String &name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void destroyAllRibbonTrails (void)
 Removes & destroys all RibbonTrails from the SceneManager. More...
 
Particle System
ParticleSystemcreateParticleSystem (const String &name, const String &templateName)
 Creates a particle system based on a template. More...
 
ParticleSystemcreateParticleSystem (const String &name, size_t quota=500, const String &resourceGroup=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
 Create a blank particle system. More...
 
ParticleSystemcreateParticleSystem (size_t quota=500, const String &resourceGroup=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
 Create a blank particle system with a generated name. More...
 
ParticleSystemgetParticleSystem (const String &name) const
 Retrieves a pointer to the named ParticleSystem. More...
 
bool hasParticleSystem (const String &name) const
 Returns whether a particle system with the given name exists. More...
 
void destroyParticleSystem (ParticleSystem *obj)
 Removes & destroys a ParticleSystem from the SceneManager. More...
 
void destroyParticleSystem (const String &name)
 Removes & destroys a ParticleSystem from the SceneManager. More...
 
void destroyAllParticleSystems (void)
 Removes & destroys all ParticleSystems from the SceneManager. More...
 
World Geometry
virtual void prepareWorldGeometry (const String &filename)
 Sets the source of the 'world' geometry, i.e. More...
 
virtual void prepareWorldGeometry (DataStreamPtr &stream, const String &typeName=BLANKSTRING)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual void setWorldGeometry (const String &filename)
 Sets the source of the 'world' geometry, i.e. More...
 
virtual void setWorldGeometry (DataStreamPtr &stream, const String &typeName=BLANKSTRING)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual size_t estimateWorldGeometry (const String &filename)
 Estimate the number of loading stages required to load the named world geometry. More...
 
virtual size_t estimateWorldGeometry (DataStreamPtr &stream, const String &typeName=BLANKSTRING)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
Sky Rendering
void _queueSkiesForRendering (Camera *cam)
 
void setSkyPlane (bool enable, const Plane &plane, const String &materialName, Real scale=1000, Real tiling=10, bool drawFirst=true, Real bow=0, int xsegments=1, int ysegments=1, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Enables / disables a 'sky plane' i.e. More...
 
void _setSkyPlane (bool enable, const Plane &plane, const String &materialName, Real scale=1000, Real tiling=10, uint8 renderQueue=RENDER_QUEUE_SKIES_EARLY, Real bow=0, int xsegments=1, int ysegments=1, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void setSkyPlaneEnabled (bool enable)
 Enables / disables a 'sky plane'. More...
 
bool isSkyPlaneEnabled (void) const
 Return whether a key plane is enabled. More...
 
SceneNodegetSkyPlaneNode (void) const
 Get the sky plane node, if enabled. More...
 
const SkyPlaneGenParametersgetSkyPlaneGenParameters (void) const
 Get the parameters used to construct the SkyPlane, if any. More...
 
void setSkyBox (bool enable, const String &materialName, Real distance=5000, bool drawFirst=true, const Quaternion &orientation=Quaternion::IDENTITY, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Enables / disables a 'sky box' i.e. More...
 
void _setSkyBox (bool enable, const String &materialName, Real distance=5000, uint8 renderQueue=RENDER_QUEUE_SKIES_EARLY, const Quaternion &orientation=Quaternion::IDENTITY, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void setSkyBoxEnabled (bool enable)
 Enables / disables a 'sky box'. More...
 
bool isSkyBoxEnabled (void) const
 Return whether a skybox is enabled. More...
 
SceneNodegetSkyBoxNode (void) const
 Get the skybox node, if enabled. More...
 
const SkyBoxGenParametersgetSkyBoxGenParameters (void) const
 Get the parameters used to generate the current SkyBox, if any. More...
 
void setSkyDome (bool enable, const String &materialName, Real curvature=10, Real tiling=8, Real distance=4000, bool drawFirst=true, const Quaternion &orientation=Quaternion::IDENTITY, int xsegments=16, int ysegments=16, int ysegments_keep=-1, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Enables / disables a 'sky dome' i.e. More...
 
void _setSkyDome (bool enable, const String &materialName, Real curvature=10, Real tiling=8, Real distance=4000, uint8 renderQueue=RENDER_QUEUE_SKIES_EARLY, const Quaternion &orientation=Quaternion::IDENTITY, int xsegments=16, int ysegments=16, int ysegments_keep=-1, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void setSkyDomeEnabled (bool enable)
 Enables / disables a 'sky dome'. More...
 
bool isSkyDomeEnabled (void) const
 Return whether a skydome is enabled. More...
 
SceneNodegetSkyDomeNode (void) const
 Get the sky dome node, if enabled. More...
 
const SkyDomeGenParametersgetSkyDomeGenParameters (void) const
 Get the parameters used to generate the current SkyDome, if any. More...
 
Fogging
void setFog (FogMode mode=FOG_NONE, const ColourValue &colour=ColourValue::White, Real expDensity=0.001f, Real linearStart=0.0f, Real linearEnd=1.0f)
 Sets the fogging mode applied to the scene. More...
 
FogMode getFogMode (void) const
 Returns the fog mode for the scene. More...
 
const ColourValuegetFogColour (void) const
 Returns the fog colour for the scene. More...
 
Real getFogStart (void) const
 Returns the fog start distance for the scene. More...
 
Real getFogEnd (void) const
 Returns the fog end distance for the scene. More...
 
Real getFogDensity (void) const
 Returns the fog density for the scene. More...
 
Billboard Sets
BillboardSetcreateBillboardSet (unsigned int poolSize=20)
 Creates a new BillboardSet for use with this scene manager. More...
 
BillboardSetcreateBillboardSet (const String &name, unsigned int poolSize=20)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
BillboardSetgetBillboardSet (const String &name) const
 Retrieves a pointer to the named BillboardSet. More...
 
bool hasBillboardSet (const String &name) const
 Returns whether a billboardset with the given name exists. More...
 
void destroyBillboardSet (BillboardSet *set)
 Removes & destroys an BillboardSet from the SceneManager. More...
 
void destroyBillboardSet (const String &name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void destroyAllBillboardSets (void)
 Removes & destroys all BillboardSets. More...
 
Scene Node Animation
void _applySceneAnimations (void)
 Internal method for applying animations to scene nodes. More...
 
AnimationcreateAnimation (const String &name, Real length)
 Creates an animation which can be used to animate scene nodes. More...
 
AnimationgetAnimation (const String &name) const
 Looks up an Animation object previously created with createAnimation. More...
 
bool hasAnimation (const String &name) const
 Returns whether an animation with the given name exists. More...
 
void destroyAnimation (const String &name)
 Destroys an Animation. More...
 
void destroyAllAnimations (void)
 Removes all animations created using this SceneManager. More...
 
AnimationStatecreateAnimationState (const String &animName)
 Create an AnimationState object for managing application of animations. More...
 
AnimationStategetAnimationState (const String &animName) const
 Retrieves animation state as previously created using createAnimationState. More...
 
bool hasAnimationState (const String &name) const
 Returns whether an animation state with the given name exists. More...
 
void destroyAnimationState (const String &name)
 Destroys an AnimationState. More...
 
void destroyAllAnimationStates (void)
 Removes all animation states created using this SceneManager. More...
 
AnimationIterator getAnimationIterator (void)
 Returns a specialised MapIterator over all animations in the scene. More...
 
const AnimationListgetAnimations () const
 Returns a const version of the animation list. More...
 
AnimationStateIterator getAnimationStateIterator (void)
 Returns a specialised MapIterator over all animation states in the scene. More...
 
const AnimationStateMapgetAnimationStates ()
 Returns a specialised Map over all animation states in the scene. More...
 
Scene Queries
virtual AxisAlignedBoxSceneQuerycreateAABBQuery (const AxisAlignedBox &box, uint32 mask=0xFFFFFFFF)
 Creates an AxisAlignedBoxSceneQuery for this scene manager. More...
 
virtual SphereSceneQuerycreateSphereQuery (const Sphere &sphere, uint32 mask=0xFFFFFFFF)
 Creates a SphereSceneQuery for this scene manager. More...
 
virtual PlaneBoundedVolumeListSceneQuerycreatePlaneBoundedVolumeQuery (const PlaneBoundedVolumeList &volumes, uint32 mask=0xFFFFFFFF)
 Creates a PlaneBoundedVolumeListSceneQuery for this scene manager. More...
 
virtual RaySceneQuerycreateRayQuery (const Ray &ray, uint32 mask=0xFFFFFFFF)
 Creates a RaySceneQuery for this scene manager. More...
 
virtual IntersectionSceneQuerycreateIntersectionQuery (uint32 mask=0xFFFFFFFF)
 Creates an IntersectionSceneQuery for this scene manager. More...
 
void destroyQuery (SceneQuery *query)
 Destroys a scene query of any type. More...
 
Shadow Setup
void _suppressShadows (bool suppress)
 Indicates to the SceneManager whether it should suppress the active shadow rendering technique until told otherwise. More...
 
bool _areShadowsSuppressed (void) const
 Are shadows suppressed? More...
 
void setShadowTechnique (ShadowTechnique technique)
 Sets the general shadow technique to be used in this scene. More...
 
ShadowTechnique getShadowTechnique (void) const
 Gets the current shadow technique. More...
 
void setShowDebugShadows (bool debug)
 Enables / disables the rendering of debug information for shadows. More...
 
bool getShowDebugShadows (void) const
 Are debug shadows shown? More...
 
void setShadowColour (const ColourValue &colour)
 Set the colour used to modulate areas in shadow. More...
 
const ColourValuegetShadowColour (void) const
 Get the colour used to modulate areas in shadow. More...
 
void setShadowDirectionalLightExtrusionDistance (Real dist)
 Sets the distance a shadow volume is extruded for a directional light. More...
 
Real getShadowDirectionalLightExtrusionDistance (void) const
 Gets the distance a shadow volume is extruded for a directional light. More...
 
void setShadowFarDistance (Real distance)
 Sets the default maximum distance away from the camera that shadows will be visible. More...
 
Real getShadowFarDistance (void) const
 Gets the default maximum distance away from the camera that shadows will be visible. More...
 
Real getShadowFarDistanceSquared (void) const
 
void setShadowIndexBufferSize (size_t size)
 Sets the maximum size of the index buffer used to render shadow primitives. More...
 
size_t getShadowIndexBufferSize (void) const
 Get the size of the shadow index buffer. More...
 
const ShadowCameraSetupPtrgetShadowCameraSetup () const
 Get the shadow camera setup in use for all lights which don't have their own shadow camera setup. More...
 
void setShadowUseInfiniteFarPlane (bool enable)
 Sets whether we should use an inifinite camera far plane when rendering stencil shadows. More...
 
bool isShadowTechniqueStencilBased (void) const
 Is there a stencil shadow based shadowing technique in use? More...
 
bool isShadowTechniqueTextureBased (void) const
 Is there a texture shadow based shadowing technique in use? More...
 
bool isShadowTechniqueModulative (void) const
 Is there a modulative shadowing technique in use? More...
 
bool isShadowTechniqueAdditive (void) const
 Is there an additive shadowing technique in use? More...
 
bool isShadowTechniqueIntegrated (void) const
 Is the shadow technique integrated into primary materials? More...
 
bool isShadowTechniqueInUse (void) const
 Is there any shadowing technique in use? More...
 
void setShadowUseLightClipPlanes (bool enabled)
 Sets whether when using a built-in additive shadow mode, user clip planes should be used to restrict light rendering. More...
 
bool getShadowUseLightClipPlanes () const
 Gets whether when using a built-in additive shadow mode, user clip planes should be used to restrict light rendering. More...
 
Shadow Texture Config
virtual void prepareShadowTextures (Camera *cam, Viewport *vp, const LightList *lightList=0)
 Method for preparing shadow textures ready for use in a regular render Do not call manually unless before frame start or rendering is paused If lightList is not supplied, will render all lights in frustum. More...
 
void setShadowTextureSize (unsigned short size)
 Set the size of the texture used for all texture-based shadows. More...
 
void setShadowTextureConfig (size_t shadowIndex, uint16 width, uint16 height, PixelFormat format, uint16 fsaa=0, uint16 depthBufferPoolId=1)
 Set the detailed configuration for a shadow texture. More...
 
void setShadowTextureConfig (size_t shadowIndex, const ShadowTextureConfig &config)
 Set the detailed configuration for a shadow texture. More...
 
const ShadowTextureConfigListgetShadowTextureConfigList () const
 Get the current shadow texture settings. More...
 
ConstShadowTextureConfigIterator getShadowTextureConfigIterator () const
 
void setShadowTexturePixelFormat (PixelFormat fmt)
 Set the pixel format of the textures used for texture-based shadows. More...
 
void setShadowTextureFSAA (unsigned short fsaa)
 Set the level of multisample AA of the textures used for texture-based shadows. More...
 
void setShadowTextureCount (size_t count)
 Set the number of textures allocated for texture-based shadows. More...
 
size_t getShadowTextureCount (void) const
 
void setShadowTextureCountPerLightType (Light::LightTypes type, size_t count)
 Set the number of shadow textures a light type uses. More...
 
size_t getShadowTextureCountPerLightType (Light::LightTypes type) const
 Get the number of shadow textures is assigned for the given light type. More...
 
void setShadowTextureSettings (uint16 size, uint16 count, PixelFormat fmt=PF_X8R8G8B8, uint16 fsaa=0, uint16 depthBufferPoolId=1)
 Sets the size and count of textures used in texture-based shadows. More...
 
const TexturePtrgetShadowTexture (size_t shadowIndex)
 Get a reference to the shadow texture currently in use at the given index. More...
 
void setShadowDirLightTextureOffset (Real offset)
 Sets the proportional distance which a texture shadow which is generated from a directional light will be offset into the camera view to make best use of texture space. More...
 
Real getShadowDirLightTextureOffset (void) const
 Gets the proportional distance which a texture shadow which is generated from a directional light will be offset into the camera view to make best use of texture space. More...
 
void setShadowTextureFadeStart (Real fadeStart)
 Sets the proportional distance at which texture shadows begin to fade out. More...
 
void setShadowTextureFadeEnd (Real fadeEnd)
 Sets the proportional distance at which texture shadows finish to fading out. More...
 
void setShadowTextureSelfShadow (bool selfShadow)
 Sets whether or not texture shadows should attempt to self-shadow. More...
 
bool getShadowTextureSelfShadow (void) const
 Gets whether or not texture shadows attempt to self-shadow. More...
 
void setShadowTextureCasterMaterial (const MaterialPtr &mat)
 Sets the default material to use for rendering shadow casters. More...
 
void setShadowTextureReceiverMaterial (const MaterialPtr &mat)
 Sets the default material to use for rendering shadow receivers. More...
 
void setShadowCasterRenderBackFaces (bool bf)
 Sets whether or not shadow casters should be rendered into shadow textures using their back faces rather than their front faces. More...
 
bool getShadowCasterRenderBackFaces () const
 Gets whether or not shadow casters should be rendered into shadow textures using their back faces rather than their front faces. More...
 
void setShadowCameraSetup (const ShadowCameraSetupPtr &shadowSetup)
 Set the shadow camera setup to use for all lights which don't have their own shadow camera setup. More...
 
Static Geometry
StaticGeometrycreateStaticGeometry (const String &name)
 Creates a StaticGeometry instance suitable for use with this SceneManager. More...
 
StaticGeometrygetStaticGeometry (const String &name) const
 Retrieve a previously created StaticGeometry instance. More...
 
bool hasStaticGeometry (const String &name) const
 Returns whether a static geometry instance with the given name exists. More...
 
void destroyStaticGeometry (StaticGeometry *geom)
 Remove & destroy a StaticGeometry instance. More...
 
void destroyStaticGeometry (const String &name)
 Remove & destroy a StaticGeometry instance. More...
 
void destroyAllStaticGeometry (void)
 Remove & destroy all StaticGeometry instances. More...
 
Instancing
InstanceManagercreateInstanceManager (const String &customName, const String &meshName, const String &groupName, InstanceManager::InstancingTechnique technique, size_t numInstancesPerBatch, uint16 flags=0, unsigned short subMeshIdx=0)
 Creates an InstanceManager interface to create & manipulate instanced entities You need to call this function at least once before start calling createInstancedEntity to build up an instance based on the given mesh. More...
 
InstanceManagergetInstanceManager (const String &managerName) const
 Retrieves an existing InstanceManager by it's name. More...
 
bool hasInstanceManager (const String &managerName) const
 Returns whether an InstanceManager with the given name exists. More...
 
void destroyInstanceManager (const String &name)
 Destroys an InstanceManager if it was created with createInstanceManager() More...
 
void destroyInstanceManager (InstanceManager *instanceManager)
 
void destroyAllInstanceManagers (void)
 
size_t getNumInstancesPerBatch (const String &meshName, const String &groupName, const String &materialName, InstanceManager::InstancingTechnique technique, size_t numInstancesPerBatch, uint16 flags=0, unsigned short subMeshIdx=0)
 
InstancedEntitycreateInstancedEntity (const String &materialName, const String &managerName)
 Creates an InstancedEntity based on an existing InstanceManager. More...
 
void destroyInstancedEntity (InstancedEntity *instancedEntity)
 Removes an InstancedEntity,. More...
 
void _addDirtyInstanceManager (InstanceManager *dirtyManager)
 Called by an InstanceManager when it has at least one InstanceBatch that needs their bounds to be updated for proper culling. More...
 
Movable Objects
MovableObjectcreateMovableObject (const String &name, const String &typeName, const NameValuePairList *params=0)
 Create a movable object of the type specified. More...
 
MovableObjectcreateMovableObject (const String &typeName, const NameValuePairList *params=0)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void destroyMovableObject (const String &name, const String &typeName)
 Destroys a MovableObject with the name specified, of the type specified. More...
 
void destroyMovableObject (MovableObject *m)
 Destroys a MovableObject. More...
 
void destroyAllMovableObjectsByType (const String &typeName)
 Destroy all MovableObjects of a given type. More...
 
void destroyAllMovableObjects (void)
 Destroy all MovableObjects. More...
 
MovableObjectgetMovableObject (const String &name, const String &typeName) const
 Get a reference to a previously created MovableObject. More...
 
bool hasMovableObject (const String &name, const String &typeName) const
 Returns whether a movable object instance with the given name exists. More...
 
const MovableObjectMapgetMovableObjects (const String &typeName)
 Get all MovableObect instances of a given type. More...
 
MovableObjectIterator getMovableObjectIterator (const String &typeName)
 
void injectMovableObject (MovableObject *m)
 Inject a MovableObject instance created externally. More...
 
void extractMovableObject (const String &name, const String &typeName)
 Extract a previously injected MovableObject. More...
 
void extractMovableObject (MovableObject *m)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void extractAllMovableObjectsByType (const String &typeName)
 Extract all injected MovableObjects of a given type. More...
 

Detailed Description

Manages the organisation and rendering of a 'scene': a collection of objects and potentially world geometry.

This class defines the interface and the basic behaviour of a 'Scene Manager'. A SceneManager organises the culling and rendering of the scene, in conjunction with the RenderQueue. This class is designed to be extended through subclassing in order to provide more specialised scene organisation structures for particular needs. The default SceneManager culls based on a hierarchy of node bounding boxes, other implementations can use an octree (see OctreeSceneManager), a BSP tree (see BspSceneManager), and many other options. New SceneManager implementations can be added at runtime by plugins, see SceneManagerEnumerator for the interfaces for adding new SceneManager types.

There is a distinction between 'objects' (which subclass MovableObject, and are movable, discrete objects in the world), and 'world geometry', which is large, generally static geometry. World geometry tends to influence the SceneManager organisational structure (e.g. lots of indoor static geometry might result in a spatial tree structure) and as such world geometry is generally tied to a given SceneManager implementation, whilst MovableObject instances can be used with any SceneManager. Subclasses are free to define world geometry however they please.

Multiple SceneManager instances can exist at one time, each one with a distinct scene. Which SceneManager is used to render a scene is dependent on the Camera, which will always call back the SceneManager which created it to render the scene.

Member Typedef Documentation

◆ CameraList

◆ AnimationList

◆ MovableObjectMap

◆ CameraIterator

◆ AnimationIterator

◆ MovableObjectIterator

Member Enumeration Documentation

◆ QueryTypeMask

Enumerator
WORLD_GEOMETRY_TYPE_MASK 

Query type mask which will be used for world geometry.

See also
SceneQuery
ENTITY_TYPE_MASK 

Query type mask which will be used for entities.

See also
SceneQuery
FX_TYPE_MASK 

Query type mask which will be used for effects like billboardsets / particle systems.

See also
SceneQuery
STATICGEOMETRY_TYPE_MASK 

Query type mask which will be used for StaticGeometry.

See also
SceneQuery
LIGHT_TYPE_MASK 

Query type mask which will be used for lights.

See also
SceneQuery
FRUSTUM_TYPE_MASK 

Query type mask which will be used for frusta and cameras.

See also
SceneQuery
USER_TYPE_MASK_LIMIT 

User type mask limit.

◆ IlluminationRenderStage

Describes the stage of rendering when performing complex illumination.

Enumerator
IRS_NONE 

No special illumination stage.

IRS_RENDER_TO_TEXTURE 

Render to texture stage, used for texture based shadows.

IRS_RENDER_RECEIVER_PASS 

Render from shadow texture to receivers stage.

◆ SpecialCaseRenderQueueMode

Enumeration of the possible modes allowed for processing the special case render queue list.

See also
SceneManager::setSpecialCaseRenderQueueMode
Enumerator
SCRQM_INCLUDE 

Render only the queues in the special case list.

SCRQM_EXCLUDE 

Render all except the queues in the special case list.

◆ PrefabType

Prefab shapes available without loading a model.

Note
Minimal implementation at present.
Enumerator
PT_PLANE 
PT_CUBE 
PT_SPHERE 

Constructor & Destructor Documentation

◆ SceneManager()

Ogre::SceneManager::SceneManager ( const String instanceName)

Constructor.

◆ ~SceneManager()

virtual Ogre::SceneManager::~SceneManager ( )
virtual

Default destructor.

Member Function Documentation

◆ _pauseRendering()

RenderContext* Ogre::SceneManager::_pauseRendering ( )

Pause rendering of the frame.

This has to be called when inside a renderScene call (Usually using a listener of some sort)

◆ _resumeRendering()

void Ogre::SceneManager::_resumeRendering ( RenderContext context)

Resume rendering of the frame.

This has to be called after a _pauseRendering call

Parameters
contextThe rendring context, as returned by the _pauseRendering call

◆ OGRE_MUTEX()

Ogre::SceneManager::OGRE_MUTEX ( sceneGraphMutex  )

Mutex to protect the scene graph from simultaneous access from multiple threads.

Remarks
If you are updating the scene in a separate thread from the rendering thread, then you should lock this mutex before making any changes to the scene graph - that means creating, modifying or deleting a scene node, or attaching / detaching objects. It is your responsibility to take out this lock, the detail methods on the nodes will not do it for you (for the reasons discussed below).
Note that locking this mutex will prevent the scene being rendered until it is unlocked again. Therefore you should do this sparingly. Try to create any objects you need separately and fully prepare them before doing all your scene graph work in one go, thus keeping this lock for the shortest time possible.
Note
A single global lock is used rather than a per-node lock since it keeps the number of locks required during rendering down to a minimum. Obtaining a lock, even if there is no contention, is not free so for performance it is good to do it as little as possible. Since modifying the scene in a separate thread is a fairly rare occurrence (relative to rendering), it is better to keep the locking required during rendering lower than to make update locks more granular.

◆ getName()

const String& Ogre::SceneManager::getName ( void  ) const
inline

Return the instance name of this SceneManager.

◆ getTypeName()

virtual const String& Ogre::SceneManager::getTypeName ( void  ) const
pure virtual

Retrieve the type name of this scene manager.

Remarks
This method has to be implemented by subclasses. It should return the type name of this SceneManager which agrees with the type name of the SceneManagerFactory which created it.

Implemented in Ogre::BspSceneManager, Ogre::OctreeSceneManager, Ogre::PCZSceneManager, and Ogre::DefaultSceneManager.

◆ createCamera()

virtual Camera* Ogre::SceneManager::createCamera ( const String name)
virtual

Creates a camera to be managed by this scene manager.

Remarks
This camera must be added to the scene at a later time using the attachObject method of the SceneNode class.
Parameters
nameName to give the new camera.

Reimplemented in Ogre::PCZSceneManager, and Ogre::OctreeSceneManager.

◆ getCamera()

Camera* Ogre::SceneManager::getCamera ( const String name) const

Retrieves a pointer to the named camera.

Note
Throws an exception if the named instance does not exist

◆ hasCamera()

bool Ogre::SceneManager::hasCamera ( const String name) const

Returns whether a camera with the given name exists.

◆ destroyCamera() [1/2]

virtual void Ogre::SceneManager::destroyCamera ( Camera cam)
virtual

Removes a camera from the scene.

Remarks
This method removes a previously added camera from the scene. The camera is deleted so the caller must ensure no references to it's previous instance (e.g. in a SceneNode) are used.
Parameters
camPointer to the camera to remove

◆ destroyCamera() [2/2]

virtual void Ogre::SceneManager::destroyCamera ( const String name)
virtual

Removes a camera from the scene.

Remarks
This method removes an camera from the scene based on the camera's name rather than a pointer.

◆ destroyAllCameras()

virtual void Ogre::SceneManager::destroyAllCameras ( void  )
virtual

Removes (and destroys) all cameras from the scene.

Remarks
Some cameras are internal created to dealing with texture shadow, their aren't supposed to destroy outside. So, while you are using texture shadow, don't call this method, or you can set the shadow technique other than texture-based, which will destroy all internal created shadow cameras and textures.

◆ setCameraRelativeRendering()

void Ogre::SceneManager::setCameraRelativeRendering ( bool  rel)
inline

Set whether to use camera-relative co-ordinates when rendering, ie to always place the camera at the origin and move the world around it.

Remarks
This is a technique to alleviate some of the precision issues associated with rendering far from the origin, where single-precision floats as used in most GPUs begin to lose their precision. Instead of including the camera translation in the view matrix, it only includes the rotation, and the world matrices of objects must be expressed relative to this.
Note
If you need this option, you will probably also need to enable double-precision mode in Ogre (OGRE_DOUBLE_PRECISION), since even though this will alleviate the rendering precision, the source camera and object positions will still suffer from precision issues leading to jerky movement.

◆ getCameraRelativeRendering()

bool Ogre::SceneManager::getCameraRelativeRendering ( ) const
inline

Get whether to use camera-relative co-ordinates when rendering, ie to always place the camera at the origin and move the world around it.

◆ getCameraIterator()

CameraIterator Ogre::SceneManager::getCameraIterator ( void  )
inline

Returns a specialised MapIterator over all cameras in the scene.

Deprecated:
use getCameras()

◆ getCameras()

const CameraList& Ogre::SceneManager::getCameras ( ) const
inline

Returns a const version of the camera list.

◆ createLight() [1/4]

virtual Light* Ogre::SceneManager::createLight ( const String name)
virtual

Creates a light for use in the scene.

Remarks
Lights can either be in a fixed position and independent of the scene graph, or they can be attached to SceneNodes so they derive their position from the parent node. Either way, they are created using this method so that the SceneManager manages their existence.
Parameters
nameThe name of the new light, to identify it later.

Reimplemented in Ogre::PCZSceneManager.

◆ createLight() [2/4]

Light* Ogre::SceneManager::createLight ( const String name,
Light::LightTypes  type 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ createLight() [3/4]

virtual Light* Ogre::SceneManager::createLight ( )
virtual

Creates a light with a generated name.

◆ createLight() [4/4]

Light* Ogre::SceneManager::createLight ( Light::LightTypes  type)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ getLight()

virtual Light* Ogre::SceneManager::getLight ( const String name) const
virtual

Returns a pointer to the named Light which has previously been added to the scene.

Note
Throws an exception if the named instance does not exist

Reimplemented in Ogre::PCZSceneManager.

◆ hasLight()

virtual bool Ogre::SceneManager::hasLight ( const String name) const
virtual

Returns whether a light with the given name exists.

Reimplemented in Ogre::PCZSceneManager.

◆ getLightClippingPlanes()

const PlaneList& Ogre::SceneManager::getLightClippingPlanes ( Light l)

Retrieve a set of clipping planes for a given light.

◆ getLightScissorRect()

const RealRect& Ogre::SceneManager::getLightScissorRect ( Light l,
const Camera cam 
)

Retrieve a scissor rectangle for a given light and camera.

◆ invalidatePerFrameScissorRectCache()

virtual void Ogre::SceneManager::invalidatePerFrameScissorRectCache ( )
virtual

Scissor rects are cached during frame, and this cache should be explicitly invalidated if several renders are done during one frame using different projections matrices, for example for tiled, stereo or multiview orthographic projection rendering.

◆ destroyLight() [1/2]

virtual void Ogre::SceneManager::destroyLight ( const String name)
virtual

Removes the named light from the scene and destroys it.

Remarks
Any pointers held to this light after calling this method will be invalid.

Reimplemented in Ogre::PCZSceneManager.

◆ destroyLight() [2/2]

virtual void Ogre::SceneManager::destroyLight ( Light light)
virtual

Removes the light from the scene and destroys it based on a pointer.

Remarks
Any pointers held to this light after calling this method will be invalid.

◆ destroyAllLights()

virtual void Ogre::SceneManager::destroyAllLights ( void  )
virtual

Removes and destroys all lights in the scene.

Reimplemented in Ogre::PCZSceneManager.

◆ _notifyLightsDirty()

void Ogre::SceneManager::_notifyLightsDirty ( void  )

Advanced method to increase the lights dirty counter due to lights having changed.

Remarks
The SceneManager tracks the list of lights affecting the current frustum, and if changes are detected (including changes to the light list itself or to a light's position or attenuation range) then it increases the lights dirty counter.
You could call this method to force all the objects in the scene to re-populate their light list, but doing so may harm performance so should be avoided if possible.

◆ _getLightsDirtyCounter()

ulong Ogre::SceneManager::_getLightsDirtyCounter ( void  ) const
inline

Advanced method to gets the lights dirty counter.

Remarks
The SceneManager tracks the list of lights affecting the current frustum, and if changes are detected (including changes to the light list itself or to a light's position or attenuation range) then it increases the lights dirty counter.

◆ _getLightsAffectingFrustum()

const LightList& Ogre::SceneManager::_getLightsAffectingFrustum ( void  ) const

Get the list of lights which could be affecting the frustum.

Remarks
This returns a cached light list which is populated when rendering the scene.

◆ _populateLightList() [1/2]

void Ogre::SceneManager::_populateLightList ( const Vector3 position,
Real  radius,
LightList destList,
uint32  lightMask = 0xFFFFFFFF 
)

Populate a light list with an ordered set of the lights which are closest to the position specified.

Remarks
Note that since directional lights have no position, they are always considered closer than any point lights and as such will always take precedence. The returned lights are those in the cached list of lights (i.e. those returned by SceneManager::_getLightsAffectingFrustum) sorted by distance.
The number of items in the list may exceed the maximum number of lights supported by the renderer, but the extraneous ones will never be used. In fact the limit will be imposed by Pass::getMaxSimultaneousLights.
Parameters
positionThe position at which to evaluate the list of lights
radiusThe bounding radius to test
destListList to be populated with ordered set of lights; will be cleared by this method before population.
lightMaskThe mask with which to include / exclude lights

◆ _populateLightList() [2/2]

void Ogre::SceneManager::_populateLightList ( const SceneNode sn,
Real  radius,
LightList destList,
uint32  lightMask = 0xFFFFFFFF 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ createSceneNode() [1/2]

virtual SceneNode* Ogre::SceneManager::createSceneNode ( void  )
virtual

Creates an instance of a SceneNode.

Remarks
Note that this does not add the SceneNode to the scene hierarchy. This method is for convenience, since it allows an instance to be created for which the SceneManager is responsible for allocating and releasing memory, which is convenient in complex scenes.
To include the returned SceneNode in the scene, use the addChild method of the SceneNode which is to be it's parent.
Note that this method takes no parameters, and the node created is unnamed (it is actually given a generated name, which you can retrieve if you want). If you wish to create a node with a specific name, call the alternative method which takes a name parameter.

Reimplemented in Ogre::PCZSceneManager.

◆ createSceneNode() [2/2]

virtual SceneNode* Ogre::SceneManager::createSceneNode ( const String name)
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented in Ogre::PCZSceneManager.

◆ destroySceneNode() [1/2]

virtual void Ogre::SceneManager::destroySceneNode ( SceneNode sn)
virtual

Destroys a SceneNode.

Remarks
This allows you to physically delete an individual SceneNode if you want to. Note that this is not normally recommended, it's better to allow SceneManager to delete the nodes when the scene is cleared.

Reimplemented in Ogre::PCZSceneManager.

◆ destroySceneNode() [2/2]

virtual void Ogre::SceneManager::destroySceneNode ( const String name)
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented in Ogre::PCZSceneManager, and Ogre::OctreeSceneManager.

◆ getRootSceneNode()

SceneNode* Ogre::SceneManager::getRootSceneNode ( void  )

Gets the SceneNode at the root of the scene hierarchy.

Remarks
The entire scene is held as a hierarchy of nodes, which allows things like relative transforms, general changes in rendering state etc (See the SceneNode class for more info). In this basic SceneManager class, the application using Ogre is free to structure this hierarchy however it likes, since it has no real significance apart from making transforms relative to each node (more specialised subclasses will provide utility methods for building specific node structures e.g. loading a BSP tree).
However, in all cases there is only ever one root node of the hierarchy, and this method returns a pointer to it.

◆ getSceneNode()

SceneNode* Ogre::SceneManager::getSceneNode ( const String name,
bool  throwExceptionIfNotFound = true 
) const

Retrieves a named SceneNode from the scene graph.

If you chose to name a SceneNode as you created it, you can look it up wherever it is in the scene graph using this method.

Parameters
name
throwExceptionIfNotFoundThrows an exception if the named instance does not exist

◆ hasSceneNode()

bool Ogre::SceneManager::hasSceneNode ( const String name) const
inline

Returns whether a scene node with the given name exists.

◆ setDisplaySceneNodes()

void Ogre::SceneManager::setDisplaySceneNodes ( bool  display)

Tells the SceneManager whether it should render the SceneNodes which make up the scene as well as the objects in the scene.

Remarks
This method is mainly for debugging purposes. If you set this to 'true', each node will be rendered as a set of 3 axes to allow you to easily see the orientation of the nodes.

◆ getDisplaySceneNodes()

bool Ogre::SceneManager::getDisplaySceneNodes ( void  ) const
inline

Returns true if all scene nodes axis are to be displayed.

◆ showBoundingBoxes()

void Ogre::SceneManager::showBoundingBoxes ( bool  bShow)

Allows all bounding boxes of scene nodes to be displayed.

◆ getShowBoundingBoxes()

bool Ogre::SceneManager::getShowBoundingBoxes ( ) const

Returns if all bounding boxes of scene nodes are to be displayed.

◆ getDebugDrawer()

DebugDrawer* Ogre::SceneManager::getDebugDrawer ( )
inline

◆ createEntity() [1/6]

Entity* Ogre::SceneManager::createEntity ( const String entityName,
const String meshName,
const String groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME 
)

Create an Entity (instance of a discrete mesh).

Parameters
entityNameThe name to be given to the entity (must be unique).
meshNameThe name of the Mesh it is to be based on (e.g. 'knot.oof'). The mesh will be loaded if it is not already.
groupNameThe resource name where the mesh lives

◆ createEntity() [2/6]

Entity* Ogre::SceneManager::createEntity ( const String entityName,
const MeshPtr pMesh 
)

Create an Entity (instance of a discrete mesh).

Parameters
entityNameThe name to be given to the entity (must be unique).
pMeshThe pointer to the Mesh it is to be based on.

◆ createEntity() [3/6]

Entity* Ogre::SceneManager::createEntity ( const String meshName)

Create an Entity (instance of a discrete mesh) with an autogenerated name.

Parameters
meshNameThe name of the Mesh it is to be based on (e.g. 'knot.oof'). The mesh will be loaded if it is not already.

◆ createEntity() [4/6]

Entity* Ogre::SceneManager::createEntity ( const MeshPtr pMesh)

Create an Entity (instance of a discrete mesh) with an autogenerated name.

Parameters
pMeshThe pointer to the Mesh it is to be based on.

◆ createEntity() [5/6]

Entity* Ogre::SceneManager::createEntity ( const String entityName,
PrefabType  ptype 
)

Create an Entity (instance of a discrete mesh) from a range of prefab shapes.

Parameters
entityNameThe name to be given to the entity (must be unique).
ptypeThe prefab type.

◆ createEntity() [6/6]

Entity* Ogre::SceneManager::createEntity ( PrefabType  ptype)

Create an Entity (instance of a discrete mesh) from a range of prefab shapes, generating the name.

Parameters
ptypeThe prefab type.

◆ getEntity()

Entity* Ogre::SceneManager::getEntity ( const String name) const

Retrieves a pointer to the named Entity.

Note
Throws an exception if the named instance does not exist

◆ hasEntity()

bool Ogre::SceneManager::hasEntity ( const String name) const

Returns whether an entity with the given name exists.

◆ destroyEntity() [1/2]

void Ogre::SceneManager::destroyEntity ( Entity ent)

Removes & destroys an Entity from the SceneManager.

Warning
Must only be done if the Entity is not attached to a SceneNode. It may be safer to wait to clear the whole scene if you are unsure use clearScene.
See also
SceneManager::clearScene

◆ destroyEntity() [2/2]

void Ogre::SceneManager::destroyEntity ( const String name)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ destroyAllEntities()

virtual void Ogre::SceneManager::destroyAllEntities ( void  )
virtual

Removes & destroys all Entities.

Warning
Again, use caution since no Entity must be referred to elsewhere e.g. attached to a SceneNode otherwise a crash is likely. Use clearScene if you are unsure (it clears SceneNode entries too.)
See also
SceneManager::clearScene

◆ createManualObject() [1/2]

ManualObject* Ogre::SceneManager::createManualObject ( const String name)

Create a ManualObject, an object which you populate with geometry manually through a GL immediate-mode style interface.

Parameters
nameThe name to be given to the object (must be unique).

◆ createManualObject() [2/2]

ManualObject* Ogre::SceneManager::createManualObject ( )

Create a ManualObject, an object which you populate with geometry manually through a GL immediate-mode style interface, generating the name.

◆ getManualObject()

ManualObject* Ogre::SceneManager::getManualObject ( const String name) const

Retrieves a pointer to the named ManualObject.

Note
Throws an exception if the named instance does not exist

◆ hasManualObject()

bool Ogre::SceneManager::hasManualObject ( const String name) const

Returns whether a manual object with the given name exists.

◆ destroyManualObject() [1/2]

void Ogre::SceneManager::destroyManualObject ( ManualObject obj)

Removes & destroys a ManualObject from the SceneManager.

◆ destroyManualObject() [2/2]

void Ogre::SceneManager::destroyManualObject ( const String name)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ destroyAllManualObjects()

void Ogre::SceneManager::destroyAllManualObjects ( void  )

Removes & destroys all ManualObjects from the SceneManager.

◆ createBillboardChain() [1/2]

BillboardChain* Ogre::SceneManager::createBillboardChain ( const String name)

Create a BillboardChain, an object which you can use to render a linked chain of billboards.

Parameters
nameThe name to be given to the object (must be unique).

◆ createBillboardChain() [2/2]

BillboardChain* Ogre::SceneManager::createBillboardChain ( )

Create a BillboardChain, an object which you can use to render a linked chain of billboards, with a generated name.

◆ getBillboardChain()

BillboardChain* Ogre::SceneManager::getBillboardChain ( const String name) const

Retrieves a pointer to the named BillboardChain.

Note
Throws an exception if the named instance does not exist

◆ hasBillboardChain()

bool Ogre::SceneManager::hasBillboardChain ( const String name) const

Returns whether a billboard chain with the given name exists.

◆ destroyBillboardChain() [1/2]

void Ogre::SceneManager::destroyBillboardChain ( BillboardChain obj)

Removes & destroys a BillboardChain from the SceneManager.

◆ destroyBillboardChain() [2/2]

void Ogre::SceneManager::destroyBillboardChain ( const String name)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ destroyAllBillboardChains()

void Ogre::SceneManager::destroyAllBillboardChains ( void  )

Removes & destroys all BillboardChains from the SceneManager.

◆ createRibbonTrail() [1/2]

RibbonTrail* Ogre::SceneManager::createRibbonTrail ( const String name)

Create a RibbonTrail, an object which you can use to render a linked chain of billboards which follows one or more nodes.

Parameters
nameThe name to be given to the object (must be unique).

◆ createRibbonTrail() [2/2]

RibbonTrail* Ogre::SceneManager::createRibbonTrail ( )

Create a RibbonTrail, an object which you can use to render a linked chain of billboards which follows one or more nodes, generating the name.

◆ getRibbonTrail()

RibbonTrail* Ogre::SceneManager::getRibbonTrail ( const String name) const

Retrieves a pointer to the named RibbonTrail.

Note
Throws an exception if the named instance does not exist

◆ hasRibbonTrail()

bool Ogre::SceneManager::hasRibbonTrail ( const String name) const

Returns whether a ribbon trail with the given name exists.

◆ destroyRibbonTrail() [1/2]

void Ogre::SceneManager::destroyRibbonTrail ( RibbonTrail obj)

Removes & destroys a RibbonTrail from the SceneManager.

◆ destroyRibbonTrail() [2/2]

void Ogre::SceneManager::destroyRibbonTrail ( const String name)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ destroyAllRibbonTrails()

void Ogre::SceneManager::destroyAllRibbonTrails ( void  )

Removes & destroys all RibbonTrails from the SceneManager.

◆ createParticleSystem() [1/3]

ParticleSystem* Ogre::SceneManager::createParticleSystem ( const String name,
const String templateName 
)

Creates a particle system based on a template.

Remarks
This method creates a new ParticleSystem instance based on the named template (defined through ParticleSystemManager::createTemplate) and returns a pointer to the caller. The caller should not delete this object, it will be freed at system shutdown, or can be released earlier using the destroyParticleSystem method.
Each system created from a template takes the template's settings at the time of creation, but is completely separate from the template from there on.
Creating a particle system does not make it a part of the scene. As with other MovableObject subclasses, a ParticleSystem is not rendered until it is attached to a SceneNode.
This is probably the more useful particle system creation method since it does not require manual setup of the system. Note that the initial quota is based on the template but may be changed later.
Parameters
nameThe name to give the new particle system instance.
templateNameThe name of the template to base the new instance on.

◆ createParticleSystem() [2/3]

ParticleSystem* Ogre::SceneManager::createParticleSystem ( const String name,
size_t  quota = 500,
const String resourceGroup = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME 
)

Create a blank particle system.

Remarks
This method creates a new, blank ParticleSystem instance and returns a pointer to it. The caller should not delete this object, it will be freed at system shutdown, or can be released earlier using the destroyParticleSystem method.
The instance returned from this method won't actually do anything because on creation a particle system has no emitters. The caller should manipulate the instance through it's ParticleSystem methods to actually create a real particle effect.
Creating a particle system does not make it a part of the scene. As with other MovableObject subclasses, a ParticleSystem is not rendered until it is attached to a SceneNode.
Parameters
nameThe name to give the ParticleSystem.
quotaThe maximum number of particles to allow in this system.
resourceGroupThe resource group which will be used to load dependent resources

◆ createParticleSystem() [3/3]

ParticleSystem* Ogre::SceneManager::createParticleSystem ( size_t  quota = 500,
const String resourceGroup = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME 
)

Create a blank particle system with a generated name.

Remarks
This method creates a new, blank ParticleSystem instance and returns a pointer to it. The caller should not delete this object, it will be freed at system shutdown, or can be released earlier using the destroyParticleSystem method.
The instance returned from this method won't actually do anything because on creation a particle system has no emitters. The caller should manipulate the instance through it's ParticleSystem methods to actually create a real particle effect.
Creating a particle system does not make it a part of the scene. As with other MovableObject subclasses, a ParticleSystem is not rendered until it is attached to a SceneNode.
Parameters
quotaThe maximum number of particles to allow in this system.
resourceGroupThe resource group which will be used to load dependent resources

◆ getParticleSystem()

ParticleSystem* Ogre::SceneManager::getParticleSystem ( const String name) const

Retrieves a pointer to the named ParticleSystem.

Note
Throws an exception if the named instance does not exist

◆ hasParticleSystem()

bool Ogre::SceneManager::hasParticleSystem ( const String name) const

Returns whether a particle system with the given name exists.

◆ destroyParticleSystem() [1/2]

void Ogre::SceneManager::destroyParticleSystem ( ParticleSystem obj)

Removes & destroys a ParticleSystem from the SceneManager.

◆ destroyParticleSystem() [2/2]

void Ogre::SceneManager::destroyParticleSystem ( const String name)

Removes & destroys a ParticleSystem from the SceneManager.

◆ destroyAllParticleSystems()

void Ogre::SceneManager::destroyAllParticleSystems ( void  )

Removes & destroys all ParticleSystems from the SceneManager.

◆ clearScene()

virtual void Ogre::SceneManager::clearScene ( void  )
virtual

Empties the entire scene, inluding all SceneNodes, Entities, Lights, BillboardSets etc.

Cameras are not deleted at this stage since they are still referenced by viewports, which are not destroyed during this process.

Reimplemented in Ogre::OctreeSceneManager, and Ogre::PCZSceneManager.

◆ setAmbientLight()

void Ogre::SceneManager::setAmbientLight ( const ColourValue colour)

Sets the ambient light level to be used for the scene.

Remarks
This sets the colour and intensity of the ambient light in the scene, i.e. the light which is 'sourceless' and illuminates all objects equally. The colour of an object is affected by a combination of the light in the scene, and the amount of light that object reflects (in this case based on the Material::ambient property).
By default the ambient light in the scene is ColourValue::Black, i.e. no ambient light. This means that any objects rendered with a Material which has lighting enabled (see Material::setLightingEnabled) will not be visible unless you have some dynamic lights in your scene.

◆ getAmbientLight()

const ColourValue& Ogre::SceneManager::getAmbientLight ( void  ) const

Returns the ambient light level to be used for the scene.

◆ prepareWorldGeometry() [1/2]

virtual void Ogre::SceneManager::prepareWorldGeometry ( const String filename)
virtual

Sets the source of the 'world' geometry, i.e.

the large, mainly static geometry making up the world e.g. rooms, landscape etc. This function can be called before setWorldGeometry in a background thread, do to some slow tasks (e.g. IO) that do not involve the backend render system.

Remarks
Depending on the type of SceneManager (subclasses will be specialised for particular world geometry types) you have requested via the Root or SceneManagerEnumerator classes, you can pass a filename to this method and it will attempt to load the world-level geometry for use. If you try to load an inappropriate type of world data an exception will be thrown. The default SceneManager cannot handle any sort of world geometry and so will always throw an exception. However subclasses like BspSceneManager can load particular types of world geometry e.g. "q3dm1.bsp".

◆ prepareWorldGeometry() [2/2]

virtual void Ogre::SceneManager::prepareWorldGeometry ( DataStreamPtr stream,
const String typeName = BLANKSTRING 
)
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
streamData stream containing data to load
typeNameString identifying the type of world geometry contained in the stream - not required if this manager only supports one type of world geometry.

◆ setWorldGeometry() [1/2]

virtual void Ogre::SceneManager::setWorldGeometry ( const String filename)
virtual

Sets the source of the 'world' geometry, i.e.

the large, mainly static geometry making up the world e.g. rooms, landscape etc.

Remarks
Depending on the type of SceneManager (subclasses will be specialised for particular world geometry types) you have requested via the Root or SceneManagerEnumerator classes, you can pass a filename to this method and it will attempt to load the world-level geometry for use. If you try to load an inappropriate type of world data an exception will be thrown. The default SceneManager cannot handle any sort of world geometry and so will always throw an exception. However subclasses like BspSceneManager can load particular types of world geometry e.g. "q3dm1.bsp".

Reimplemented in Ogre::BspSceneManager.

◆ setWorldGeometry() [2/2]

virtual void Ogre::SceneManager::setWorldGeometry ( DataStreamPtr stream,
const String typeName = BLANKSTRING 
)
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
streamData stream containing data to load
typeNameString identifying the type of world geometry contained in the stream - not required if this manager only supports one type of world geometry.

Reimplemented in Ogre::BspSceneManager.

◆ estimateWorldGeometry() [1/2]

virtual size_t Ogre::SceneManager::estimateWorldGeometry ( const String filename)
inlinevirtual

Estimate the number of loading stages required to load the named world geometry.

Remarks
This method should be overridden by SceneManagers that provide custom world geometry that can take some time to load. They should return from this method a count of the number of stages of progress they can report on whilst loading. During real loading (setWorldGeometry), they should call ResourceGroupManager::_notifyWorldGeometryProgress exactly that number of times when loading the geometry for real.
Note
The default is to return 0, ie to not report progress.

Reimplemented in Ogre::BspSceneManager.

◆ estimateWorldGeometry() [2/2]

virtual size_t Ogre::SceneManager::estimateWorldGeometry ( DataStreamPtr stream,
const String typeName = BLANKSTRING 
)
inlinevirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
streamData stream containing data to load
typeNameString identifying the type of world geometry contained in the stream - not required if this manager only supports one type of world geometry.

Reimplemented in Ogre::BspSceneManager.

◆ getSuggestedViewpoint()

virtual ViewPoint Ogre::SceneManager::getSuggestedViewpoint ( bool  random = false)
virtual

Asks the SceneManager to provide a suggested viewpoint from which the scene should be viewed.

Remarks
Typically this method returns the origin unless a) world geometry has been loaded using SceneManager::setWorldGeometry and b) that world geometry has suggested 'start' points. If there is more than one viewpoint which the scene manager can suggest, it will always suggest the first one unless the random parameter is true.
Parameters
randomIf true, and there is more than one possible suggestion, a random one will be used. If false the same one will always be suggested.
Returns
On success, true is returned.
On failure, false is returned.

Reimplemented in Ogre::BspSceneManager.

◆ setOption()

virtual bool Ogre::SceneManager::setOption ( const String strKey,
const void *  pValue 
)
inlinevirtual

Method for setting a specific option of the Scene Manager.

These options are usually specific for a certain implemntation of the Scene Manager class, and may (and probably will) not exist across different implementations.

Parameters
strKeyThe name of the option to set
pValueA pointer to the value - the size should be calculated by the scene manager based on the key
Returns
On success, true is returned.
On failure, false is returned.

Reimplemented in Ogre::PCZSceneManager, and Ogre::OctreeSceneManager.

◆ getOption()

virtual bool Ogre::SceneManager::getOption ( const String strKey,
void *  pDestValue 
)
inlinevirtual

Method for getting the value of an implementation-specific Scene Manager option.

Parameters
strKeyThe name of the option
pDestValueA pointer to a memory location where the value will be copied. Currently, the memory will be allocated by the scene manager, but this may change
Returns
On success, true is returned and pDestValue points to the value of the given option.
On failure, false is returned and pDestValue is set to NULL.

Reimplemented in Ogre::PCZSceneManager, and Ogre::OctreeSceneManager.

◆ hasOption()

virtual bool Ogre::SceneManager::hasOption ( const String strKey) const
inlinevirtual

Method for verifying whether the scene manager has an implementation-specific option.

Parameters
strKeyThe name of the option to check for.
Returns
If the scene manager contains the given option, true is returned.
Remarks
If it does not, false is returned.

◆ getOptionValues()

virtual bool Ogre::SceneManager::getOptionValues ( const String strKey,
StringVector refValueList 
)
inlinevirtual

Method for getting all possible values for a specific option.

When this list is too large (i.e. the option expects, for example, a float), the return value will be true, but the list will contain just one element whose size will be set to 0. Otherwise, the list will be filled with all the possible values the option can accept.

Parameters
strKeyThe name of the option to get the values for.
refValueListA reference to a list that will be filled with the available values.
Returns
On success (the option exists), true is returned.
On failure, false is returned.

Reimplemented in Ogre::PCZSceneManager, and Ogre::OctreeSceneManager.

◆ getOptionKeys()

virtual bool Ogre::SceneManager::getOptionKeys ( StringVector refKeys)
inlinevirtual

Method for getting all the implementation-specific options of the scene manager.

Parameters
refKeysA reference to a list that will be filled with all the available options.
Returns
On success, true is returned. On failure, false is returned.

Reimplemented in Ogre::PCZSceneManager, and Ogre::OctreeSceneManager.

◆ _updateSceneGraph()

virtual void Ogre::SceneManager::_updateSceneGraph ( Camera cam)
virtual

Internal method for updating the scene graph ie the tree of SceneNode instances managed by this class.

Remarks
This must be done before issuing objects to the rendering pipeline, since derived transformations from parent nodes are not updated until required. This SceneManager is a basic implementation which simply updates all nodes from the root. This ensures the scene is up to date but requires all the nodes to be updated even if they are not visible. Subclasses could trim this such that only potentially visible nodes are updated.

Reimplemented in Ogre::PCZSceneManager, and Ogre::OctreeSceneManager.

◆ _findVisibleObjects()

virtual void Ogre::SceneManager::_findVisibleObjects ( Camera cam,
VisibleObjectsBoundsInfo visibleBounds,
bool  onlyShadowCasters 
)
virtual

Internal method which parses the scene to find visible objects to render.

Remarks
If you're implementing a custom scene manager, this is the most important method to override since it's here you can apply your custom world partitioning scheme. Once you have added the appropriate objects to the render queue, you can let the default SceneManager objects _renderVisibleObjects handle the actual rendering of the objects you pick.
Any visible objects will be added to a rendering queue, which is indexed by material in order to ensure objects with the same material are rendered together to minimise render state changes.

Reimplemented in Ogre::BspSceneManager, Ogre::PCZSceneManager, and Ogre::OctreeSceneManager.

◆ _issueRenderOp()

void Ogre::SceneManager::_issueRenderOp ( Renderable rend,
const Pass pass 
)

Internal method for issuing the render operation.

◆ _renderVisibleObjects()

void Ogre::SceneManager::_renderVisibleObjects ( void  )

Sends visible objects found in _findVisibleObjects to the rendering engine.

◆ _renderScene()

virtual void Ogre::SceneManager::_renderScene ( Camera camera,
Viewport vp,
bool  includeOverlays = true 
)
virtual

Prompts the class to send its contents to the renderer.

Remarks
This method prompts the scene manager to send the contents of the scene it manages to the rendering pipeline, possibly preceded by some sorting, culling or other scene management tasks. Note that this method is not normally called directly by the user application; it is called automatically by the Ogre rendering loop.
Parameters
cameraPointer to a camera from whose viewpoint the scene is to be rendered.
vpThe target viewport
includeOverlaysunused

Reimplemented in Ogre::PCZSceneManager.

◆ _setDestinationRenderSystem()

void Ogre::SceneManager::_setDestinationRenderSystem ( RenderSystem sys)

Notifies the scene manager of its destination render system.

Remarks
Called automatically by RenderSystem::addSceneManager this method simply notifies the manager of the render system to which its output must be directed.
Parameters
sysPointer to the RenderSystem subclass to be used as a render target.

◆ _releaseManualHardwareResources()

void Ogre::SceneManager::_releaseManualHardwareResources ( )

Notifies the scene manager that hardware resources were lost.

Remarks
Called automatically by RenderSystem if hardware resources were lost and can not be restored using some internal mechanism. Among affected resources are manual meshes without loaders, manual textures without loaders, ManualObjects, etc.

◆ _restoreManualHardwareResources()

void Ogre::SceneManager::_restoreManualHardwareResources ( )

Notifies the scene manager that hardware resources should be restored.

Remarks
Called automatically by RenderSystem if hardware resources were lost and can not be restored using some internal mechanism. Among affected resources are manual meshes without loaders, manual textures without loaders, ManualObjects, etc.

◆ _queueSkiesForRendering()

void Ogre::SceneManager::_queueSkiesForRendering ( Camera cam)
inline

◆ setSkyPlane()

void Ogre::SceneManager::setSkyPlane ( bool  enable,
const Plane plane,
const String materialName,
Real  scale = 1000,
Real  tiling = 10,
bool  drawFirst = true,
Real  bow = 0,
int  xsegments = 1,
int  ysegments = 1,
const String groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME 
)

Enables / disables a 'sky plane' i.e.

a plane at constant distance from the camera representing the sky.

Remarks
You can create sky planes yourself using the standard mesh and entity methods, but this creates a plane which the camera can never get closer or further away from - it moves with the camera. (NB you could create this effect by creating a world plane which was attached to the same SceneNode as the Camera too, but this would only apply to a single camera whereas this plane applies to any camera using this scene manager).
Note
To apply scaling, scrolls etc to the sky texture(s) you should use the TextureUnitState class methods.
Parameters
enableTrue to enable the plane, false to disable it
planeDetails of the plane, i.e. it's normal and it's distance from the camera.
materialNameThe name of the material the plane will use
scaleThe scaling applied to the sky plane - higher values mean a bigger sky plane - you may want to tweak this depending on the size of plane.d and the other characteristics of your scene
tilingHow many times to tile the texture across the sky. Applies to all texture layers. If you need finer control use the TextureUnitState texture coordinate transformation methods.
drawFirstIf true, the plane is drawn before all other geometry in the scene, without updating the depth buffer. This is the safest rendering method since all other objects will always appear in front of the sky. However this is not the most efficient way if most of the sky is often occluded by other objects. If this is the case, you can set this parameter to false meaning it draws after all other geometry which can be an optimisation - however you must ensure that the plane.d value is large enough that no objects will 'poke through' the sky plane when it is rendered.
bowIf zero, the plane will be completely flat (like previous versions. If above zero, the plane will be curved, allowing the sky to appear below camera level. Curved sky planes are simular to skydomes, but are more compatible with fog.
xsegments,ysegmentsDetermines the number of segments the plane will have to it. This is most important when you are bowing the plane, but may also be useful if you need tessellation on the plane to perform per-vertex effects.
groupNameThe name of the resource group to which to assign the plane mesh.

◆ _setSkyPlane()

void Ogre::SceneManager::_setSkyPlane ( bool  enable,
const Plane plane,
const String materialName,
Real  scale = 1000,
Real  tiling = 10,
uint8  renderQueue = RENDER_QUEUE_SKIES_EARLY,
Real  bow = 0,
int  xsegments = 1,
int  ysegments = 1,
const String groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ setSkyPlaneEnabled()

void Ogre::SceneManager::setSkyPlaneEnabled ( bool  enable)
inline

Enables / disables a 'sky plane'.

◆ isSkyPlaneEnabled()

bool Ogre::SceneManager::isSkyPlaneEnabled ( void  ) const
inline

Return whether a key plane is enabled.

◆ getSkyPlaneNode()

SceneNode* Ogre::SceneManager::getSkyPlaneNode ( void  ) const
inline

Get the sky plane node, if enabled.

◆ getSkyPlaneGenParameters()

const SkyPlaneGenParameters& Ogre::SceneManager::getSkyPlaneGenParameters ( void  ) const
inline

Get the parameters used to construct the SkyPlane, if any.

◆ setSkyBox()

void Ogre::SceneManager::setSkyBox ( bool  enable,
const String materialName,
Real  distance = 5000,
bool  drawFirst = true,
const Quaternion orientation = Quaternion::IDENTITY,
const String groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME 
)

Enables / disables a 'sky box' i.e.

a 6-sided box at constant distance from the camera representing the sky.

Remarks
You could create a sky box yourself using the standard mesh and entity methods, but this creates a plane which the camera can never get closer or further away from - it moves with the camera. (NB you could create this effect by creating a world box which was attached to the same SceneNode as the Camera too, but this would only apply to a single camera whereas this skybox applies to any camera using this scene manager).
The material you use for the skybox can either contain layers which are single textures, or they can be cubic textures, i.e. made up of 6 images, one for each plane of the cube. See the TextureUnitState class for more information.
Parameters
enableTrue to enable the skybox, false to disable it
materialNameThe name of the material the box will use
distanceDistance in world coorinates from the camera to each plane of the box. The default is normally OK.
drawFirstIf true, the box is drawn before all other geometry in the scene, without updating the depth buffer. This is the safest rendering method since all other objects will always appear in front of the sky. However this is not the most efficient way if most of the sky is often occluded by other objects. If this is the case, you can set this parameter to false meaning it draws after all other geometry which can be an optimisation - however you must ensure that the distance value is large enough that no objects will 'poke through' the sky box when it is rendered.
orientationOptional parameter to specify the orientation of the box. By default the 'top' of the box is deemed to be in the +y direction, and the 'front' at the -z direction. You can use this parameter to rotate the sky if you want.
groupNameThe name of the resource group to which to assign the plane mesh.

◆ _setSkyBox()

void Ogre::SceneManager::_setSkyBox ( bool  enable,
const String materialName,
Real  distance = 5000,
uint8  renderQueue = RENDER_QUEUE_SKIES_EARLY,
const Quaternion orientation = Quaternion::IDENTITY,
const String groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ setSkyBoxEnabled()

void Ogre::SceneManager::setSkyBoxEnabled ( bool  enable)
inline

Enables / disables a 'sky box'.

◆ isSkyBoxEnabled()

bool Ogre::SceneManager::isSkyBoxEnabled ( void  ) const
inline

Return whether a skybox is enabled.

◆ getSkyBoxNode()

SceneNode* Ogre::SceneManager::getSkyBoxNode ( void  ) const
inline

Get the skybox node, if enabled.

◆ getSkyBoxGenParameters()

const SkyBoxGenParameters& Ogre::SceneManager::getSkyBoxGenParameters ( void  ) const
inline

Get the parameters used to generate the current SkyBox, if any.

◆ setSkyDome()

void Ogre::SceneManager::setSkyDome ( bool  enable,
const String materialName,
Real  curvature = 10,
Real  tiling = 8,
Real  distance = 4000,
bool  drawFirst = true,
const Quaternion orientation = Quaternion::IDENTITY,
int  xsegments = 16,
int  ysegments = 16,
int  ysegments_keep = -1,
const String groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME 
)

Enables / disables a 'sky dome' i.e.

an illusion of a curved sky.

Remarks
A sky dome is actually formed by 5 sides of a cube, but with texture coordinates generated such that the surface appears curved like a dome. Sky domes are appropriate where you need a realistic looking sky where the scene is not going to be 'fogged', and there is always a 'floor' of some sort to prevent the viewer looking below the horizon (the distortion effect below the horizon can be pretty horrible, and there is never anyhting directly below the viewer). If you need a complete wrap-around background, use the setSkyBox method instead. You can actually combine a sky box and a sky dome if you want, to give a positional backdrop with an overlayed curved cloud layer.
Sky domes work well with 2D repeating textures like clouds. You can change the apparent 'curvature' of the sky depending on how your scene is viewed - lower curvatures are better for 'open' scenes like landscapes, whilst higher curvatures are better for say FPS levels where you don't see a lot of the sky at once and the exaggerated curve looks good.
Parameters
enableTrue to enable the skydome, false to disable it
materialNameThe name of the material the dome will use
curvatureThe curvature of the dome. Good values are between 2 and 65. Higher values are more curved leading to a smoother effect, lower values are less curved meaning more distortion at the horizons but a better distance effect.
tilingHow many times to tile the texture(s) across the dome.
distanceDistance in world coorinates from the camera to each plane of the box the dome is rendered on. The default is normally OK.
drawFirstIf true, the dome is drawn before all other geometry in the scene, without updating the depth buffer. This is the safest rendering method since all other objects will always appear in front of the sky. However this is not the most efficient way if most of the sky is often occluded by other objects. If this is the case, you can set this parameter to false meaning it draws after all other geometry which can be an optimisation - however you must ensure that the distance value is large enough that no objects will 'poke through' the sky when it is rendered.
orientationOptional parameter to specify the orientation of the dome. By default the 'top' of the dome is deemed to be in the +y direction, and the 'front' at the -z direction. You can use this parameter to rotate the sky if you want.
groupNameThe name of the resource group to which to assign the plane mesh.
xsegments,ysegments,ysegments_keepsee MeshManager::createCurvedIllusionPlane

◆ _setSkyDome()

void Ogre::SceneManager::_setSkyDome ( bool  enable,
const String materialName,
Real  curvature = 10,
Real  tiling = 8,
Real  distance = 4000,
uint8  renderQueue = RENDER_QUEUE_SKIES_EARLY,
const Quaternion orientation = Quaternion::IDENTITY,
int  xsegments = 16,
int  ysegments = 16,
int  ysegments_keep = -1,
const String groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ setSkyDomeEnabled()

void Ogre::SceneManager::setSkyDomeEnabled ( bool  enable)
inline

Enables / disables a 'sky dome'.

◆ isSkyDomeEnabled()

bool Ogre::SceneManager::isSkyDomeEnabled ( void  ) const
inline

Return whether a skydome is enabled.

◆ getSkyDomeNode()

SceneNode* Ogre::SceneManager::getSkyDomeNode ( void  ) const
inline

Get the sky dome node, if enabled.

◆ getSkyDomeGenParameters()

const SkyDomeGenParameters& Ogre::SceneManager::getSkyDomeGenParameters ( void  ) const
inline

Get the parameters used to generate the current SkyDome, if any.

◆ setFog()

void Ogre::SceneManager::setFog ( FogMode  mode = FOG_NONE,
const ColourValue colour = ColourValue::White,
Real  expDensity = 0.001f,
Real  linearStart = 0.0f,
Real  linearEnd = 1.0f 
)

Sets the fogging mode applied to the scene.

Remarks
This method sets up the scene-wide fogging effect. These settings apply to all geometry rendered, UNLESS the material with which it is rendered has it's own fog settings (see Material::setFog).
Parameters
modeSet up the mode of fog as described in the FogMode enum, or set to FOG_NONE to turn off.
colourThe colour of the fog. Either set this to the same as your viewport background colour, or to blend in with a skydome or skybox.
expDensityThe density of the fog in FOG_EXP or FOG_EXP2 mode, as a value between 0 and 1. The default is 0.001.
linearStartDistance in world units at which linear fog starts to encroach. Only applicable if mode is FOG_LINEAR.
linearEndDistance in world units at which linear fog becomes completely opaque. Only applicable if mode is FOG_LINEAR.

◆ getFogMode()

FogMode Ogre::SceneManager::getFogMode ( void  ) const

Returns the fog mode for the scene.

◆ getFogColour()

const ColourValue& Ogre::SceneManager::getFogColour ( void  ) const

Returns the fog colour for the scene.

◆ getFogStart()

Real Ogre::SceneManager::getFogStart ( void  ) const

Returns the fog start distance for the scene.

◆ getFogEnd()

Real Ogre::SceneManager::getFogEnd ( void  ) const

Returns the fog end distance for the scene.

◆ getFogDensity()

Real Ogre::SceneManager::getFogDensity ( void  ) const

Returns the fog density for the scene.

◆ createBillboardSet() [1/2]

BillboardSet* Ogre::SceneManager::createBillboardSet ( unsigned int  poolSize = 20)

Creates a new BillboardSet for use with this scene manager.

This method creates a new BillboardSet which is registered with
the SceneManager. The SceneManager will destroy this object when
it shuts down or when the SceneManager::clearScene method is
called, so the caller does not have to worry about destroying
this object (in fact, it definitely should not do this).
See the BillboardSet documentations for full details of the returned class.
Parameters
poolSizeThe initial size of the pool of billboards (see BillboardSet for more information)
See also
BillboardSet

◆ createBillboardSet() [2/2]

BillboardSet* Ogre::SceneManager::createBillboardSet ( const String name,
unsigned int  poolSize = 20 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a new BillboardSet for use with this scene manager.

This method creates a new BillboardSet which is registered with
the SceneManager. The SceneManager will destroy this object when
it shuts down or when the SceneManager::clearScene method is
called, so the caller does not have to worry about destroying
this object (in fact, it definitely should not do this).
See the BillboardSet documentations for full details of the returned class.
Parameters
poolSizeThe initial size of the pool of billboards (see BillboardSet for more information)
See also
BillboardSet
Parameters
nameThe name to give to this billboard set. Must be unique.

◆ getBillboardSet()

BillboardSet* Ogre::SceneManager::getBillboardSet ( const String name) const

Retrieves a pointer to the named BillboardSet.

Note
Throws an exception if the named instance does not exist

◆ hasBillboardSet()

bool Ogre::SceneManager::hasBillboardSet ( const String name) const

Returns whether a billboardset with the given name exists.

◆ destroyBillboardSet() [1/2]

void Ogre::SceneManager::destroyBillboardSet ( BillboardSet set)

Removes & destroys an BillboardSet from the SceneManager.

Warning
Must only be done if the BillboardSet is not attached to a SceneNode. It may be safer to wait to clear the whole scene. If you are unsure, use clearScene.

◆ destroyBillboardSet() [2/2]

void Ogre::SceneManager::destroyBillboardSet ( const String name)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ destroyAllBillboardSets()

void Ogre::SceneManager::destroyAllBillboardSets ( void  )

Removes & destroys all BillboardSets.

Warning
Again, use caution since no BillboardSet must be referred to elsewhere e.g. attached to a SceneNode otherwise a crash is likely. Use clearScene if you are unsure (it clears SceneNode entries too.)
See also
SceneManager::clearScene

◆ _applySceneAnimations()

void Ogre::SceneManager::_applySceneAnimations ( void  )

Internal method for applying animations to scene nodes.

Remarks
Uses the internally stored AnimationState objects to apply animation to SceneNodes.

◆ createAnimation()

Animation* Ogre::SceneManager::createAnimation ( const String name,
Real  length 
)

Creates an animation which can be used to animate scene nodes.

Remarks
An animation is a collection of 'tracks' which over time change the position / orientation of Node objects. In this case, the animation will likely have tracks to modify the position / orientation of SceneNode objects, e.g. to make objects move along a path.
You don't need to use an Animation object to move objects around - you can do it yourself using the methods of the Node in your FrameListener class. However, when you need relatively complex scripted animation, this is the class to use since it will interpolate between keyframes for you and generally make the whole process easier to manage.
A single animation can affect multiple Node objects (each AnimationTrack affects a single Node). In addition, through animation blending a single Node can be affected by multiple animations, athough this is more useful when performing skeletal animation (see Skeleton::createAnimation).
Note that whilst it uses the same classes, the animations created here are kept separate from the skeletal animations of meshes (each Skeleton owns those animations).
Parameters
nameThe name of the animation, must be unique within this SceneManager.
lengthThe total length of the animation.

◆ getAnimation()

Animation* Ogre::SceneManager::getAnimation ( const String name) const

Looks up an Animation object previously created with createAnimation.

Note
Throws an exception if the named instance does not exist

◆ hasAnimation()

bool Ogre::SceneManager::hasAnimation ( const String name) const

Returns whether an animation with the given name exists.

◆ destroyAnimation()

void Ogre::SceneManager::destroyAnimation ( const String name)

Destroys an Animation.

Remarks
You should ensure that none of your code is referencing this animation objects since the memory will be freed.

◆ destroyAllAnimations()

void Ogre::SceneManager::destroyAllAnimations ( void  )

Removes all animations created using this SceneManager.

◆ createAnimationState()

AnimationState* Ogre::SceneManager::createAnimationState ( const String animName)

Create an AnimationState object for managing application of animations.

Remarks
You can create Animation objects for animating SceneNode obejcts using the createAnimation method. However, in order to actually apply those animations you have to call methods on Node and Animation in a particular order (namely Node::resetToInitialState and Animation::apply). To make this easier and to help track the current time position of animations, the AnimationState object is provided. So if you don't want to control animation application manually, call this method, update the returned object as you like every frame and let SceneManager apply the animation state for you.
Remember, AnimationState objects are disabled by default at creation time. Turn them on when you want them using their setEnabled method.
Note that any SceneNode affected by this automatic animation will have it's state reset to it's initial position before application of the animation. Unless specifically modified using Node::setInitialState the Node assumes it's initial state is at the origin. If you want the base state of the SceneNode to be elsewhere, make your changes to the node using the standard transform methods, then call setInitialState to 'bake' this reference position into the node.
If the target of your animation is to be a generic AnimableValue, you should ensure that it has a base value set (unlike nodes this has no default).
See also
AnimableValue::setAsBaseValue.
Parameters
animNameThe name of an animation created already with createAnimation.

◆ getAnimationState()

AnimationState* Ogre::SceneManager::getAnimationState ( const String animName) const

Retrieves animation state as previously created using createAnimationState.

Note
Throws an exception if the named instance does not exist

◆ hasAnimationState()

bool Ogre::SceneManager::hasAnimationState ( const String name) const

Returns whether an animation state with the given name exists.

◆ destroyAnimationState()

void Ogre::SceneManager::destroyAnimationState ( const String name)

Destroys an AnimationState.

Remarks
You should ensure that none of your code is referencing this animation state object since the memory will be freed.

◆ destroyAllAnimationStates()

void Ogre::SceneManager::destroyAllAnimationStates ( void  )

Removes all animation states created using this SceneManager.

◆ getAnimationIterator()

AnimationIterator Ogre::SceneManager::getAnimationIterator ( void  )
inline

Returns a specialised MapIterator over all animations in the scene.

Deprecated:
use getAnimations()

◆ getAnimations()

const AnimationList& Ogre::SceneManager::getAnimations ( ) const
inline

Returns a const version of the animation list.

◆ getAnimationStateIterator()

AnimationStateIterator Ogre::SceneManager::getAnimationStateIterator ( void  )
inline

Returns a specialised MapIterator over all animation states in the scene.

Deprecated:
use getAnimationStates()

References Ogre::AnimationStateSet::getAnimationStateIterator().

◆ getAnimationStates()

const AnimationStateMap& Ogre::SceneManager::getAnimationStates ( )
inline

Returns a specialised Map over all animation states in the scene.

References Ogre::AnimationStateSet::getAnimationStates().

◆ manualRender() [1/2]

void Ogre::SceneManager::manualRender ( RenderOperation rend,
Pass pass,
Viewport vp,
const Affine3 worldMatrix,
const Affine3 viewMatrix,
const Matrix4 projMatrix,
bool  doBeginEndFrame = false 
)

Manual rendering method, for advanced users only.

Remarks
This method allows you to send rendering commands through the pipeline on demand, bypassing OGRE's normal world processing. You should only use this if you really know what you're doing; OGRE does lots of things for you that you really should let it do. However, there are times where it may be useful to have this manual interface, for example overlaying something on top of the scene rendered by OGRE.
Because this is an instant rendering method, timing is important. The best time to call it is from a RenderTargetListener event handler.
Don't call this method a lot, it's designed for rare (1 or 2 times per frame) use. Calling it regularly per frame will cause frame rate drops!
Parameters
rendA RenderOperation object describing the rendering op
passThe Pass to use for this render
vpPointer to the viewport to render to, or 0 to use the current viewport
worldMatrixThe transform to apply from object to world space
viewMatrixThe transform to apply from world to view space
projMatrixThe transform to apply from view to screen space
doBeginEndFrameIf true, beginFrame() and endFrame() are called, otherwise not. You should leave this as false if you are calling this within the main render loop.

◆ manualRender() [2/2]

void Ogre::SceneManager::manualRender ( Renderable rend,
const Pass pass,
Viewport vp,
const Affine3 viewMatrix,
const Matrix4 projMatrix,
bool  doBeginEndFrame = false,
bool  lightScissoringClipping = true,
bool  doLightIteration = true,
const LightList manualLightList = 0 
)

Manual rendering method for rendering a single object.

Parameters
rendThe renderable to issue to the pipeline
passThe pass to use
vpPointer to the viewport to render to, or 0 to use the existing viewport
doBeginEndFrameIf true, beginFrame() and endFrame() are called, otherwise not. You should leave this as false if you are calling this within the main render loop.
viewMatrixThe transform to apply from world to view space
projMatrixThe transform to apply from view to screen space
lightScissoringClippingIf true, passes that have the getLightScissorEnabled and/or getLightClipPlanesEnabled flags will cause calculation and setting of scissor rectangle and user clip planes.
doLightIterationIf true, this method will issue the renderable to the pipeline possibly multiple times, if the pass indicates it should be done once per light
manualLightListOnly applicable if doLightIteration is false, this method allows you to pass in a previously determined set of lights which will be used for a single render of this object.

◆ getRenderQueue()

RenderQueue* Ogre::SceneManager::getRenderQueue ( void  )

Retrieves the internal render queue, for advanced users only.

Remarks
The render queue is mainly used internally to manage the scene object rendering queue, it also exports some methods to allow advanced users to configure the behavior of rendering process. Most methods provided by RenderQueue are supposed to be used internally only, you should reference to the RenderQueue API for more information. Do not access this directly unless you know what you are doing.

◆ addRenderQueueListener()

void Ogre::SceneManager::addRenderQueueListener ( RenderQueueListener newListener)

Registers a new RenderQueueListener which will be notified when render queues are processed.

◆ removeRenderQueueListener()

void Ogre::SceneManager::removeRenderQueueListener ( RenderQueueListener delListener)

Removes a listener previously added with addRenderQueueListener.

◆ addRenderObjectListener()

void Ogre::SceneManager::addRenderObjectListener ( RenderObjectListener newListener)

Registers a new Render Object Listener which will be notified when rendering an object.


◆ removeRenderObjectListener()

void Ogre::SceneManager::removeRenderObjectListener ( RenderObjectListener delListener)

Removes a listener previously added with addRenderObjectListener.

◆ addSpecialCaseRenderQueue()

void Ogre::SceneManager::addSpecialCaseRenderQueue ( uint8  qid)

Adds an item to the 'special case' render queue list.

Remarks
Normally all render queues are rendered, in their usual sequence, only varying if a RenderQueueListener nominates for the queue to be repeated or skipped. This method allows you to add a render queue to a 'special case' list, which varies the behaviour. The effect of this list depends on the 'mode' in which this list is in, which might be to exclude these render queues, or to include them alone (excluding all other queues). This allows you to perform broad selective rendering without requiring a RenderQueueListener.
Parameters
qidThe identifier of the queue which should be added to the special case list. Nothing happens if the queue is already in the list.

◆ removeSpecialCaseRenderQueue()

void Ogre::SceneManager::removeSpecialCaseRenderQueue ( uint8  qid)

Removes an item to the 'special case' render queue list.

See also
SceneManager::addSpecialCaseRenderQueue
Parameters
qidThe identifier of the queue which should be removed from the special case list. Nothing happens if the queue is not in the list.

◆ clearSpecialCaseRenderQueues()

void Ogre::SceneManager::clearSpecialCaseRenderQueues ( void  )

Clears the 'special case' render queue list.

See also
SceneManager::addSpecialCaseRenderQueue

◆ setSpecialCaseRenderQueueMode()

void Ogre::SceneManager::setSpecialCaseRenderQueueMode ( SpecialCaseRenderQueueMode  mode)

Sets the way the special case render queue list is processed.

See also
SceneManager::addSpecialCaseRenderQueue
Parameters
modeThe mode of processing

◆ getSpecialCaseRenderQueueMode()

SpecialCaseRenderQueueMode Ogre::SceneManager::getSpecialCaseRenderQueueMode ( void  )

Gets the way the special case render queue list is processed.

◆ isRenderQueueToBeProcessed()

bool Ogre::SceneManager::isRenderQueueToBeProcessed ( uint8  qid)

Returns whether or not the named queue will be rendered based on the current 'special case' render queue list and mode.

See also
SceneManager::addSpecialCaseRenderQueue
Parameters
qidThe identifier of the queue which should be tested
Returns
true if the queue will be rendered, false otherwise

◆ setWorldGeometryRenderQueue()

void Ogre::SceneManager::setWorldGeometryRenderQueue ( uint8  qid)

Sets the render queue that the world geometry (if any) this SceneManager renders will be associated with.

Remarks
SceneManagers which provide 'world geometry' should place it in a specialised render queue in order to make it possible to enable / disable it easily using the addSpecialCaseRenderQueue method. Even if the SceneManager does not use the render queues to render the world geometry, it should still pick a queue to represent it's manual rendering, and check isRenderQueueToBeProcessed before rendering.
Note
Setting this may not affect the actual ordering of rendering the world geometry, if the world geometry is being rendered manually by the SceneManager. If the SceneManager feeds world geometry into the queues, however, the ordering will be affected.

◆ getWorldGeometryRenderQueue()

uint8 Ogre::SceneManager::getWorldGeometryRenderQueue ( void  )

Gets the render queue that the world geometry (if any) this SceneManager renders will be associated with.

Remarks
SceneManagers which provide 'world geometry' should place it in a specialised render queue in order to make it possible to enable / disable it easily using the addSpecialCaseRenderQueue method. Even if the SceneManager does not use the render queues to render the world geometry, it should still pick a queue to represent it's manual rendering, and check isRenderQueueToBeProcessed before rendering.

◆ _notifyAutotrackingSceneNode()

void Ogre::SceneManager::_notifyAutotrackingSceneNode ( SceneNode node,
bool  autoTrack 
)

Internal method for notifying the manager that a SceneNode is autotracking.

◆ createAABBQuery()

virtual AxisAlignedBoxSceneQuery* Ogre::SceneManager::createAABBQuery ( const AxisAlignedBox box,
uint32  mask = 0xFFFFFFFF 
)
virtual

Creates an AxisAlignedBoxSceneQuery for this scene manager.

Remarks
This method creates a new instance of a query object for this scene manager, for an axis aligned box region. See SceneQuery and AxisAlignedBoxSceneQuery for full details.
The instance returned from this method must be destroyed by calling SceneManager::destroyQuery when it is no longer required.
Parameters
boxDetails of the box which describes the region for this query.
maskThe query mask to apply to this query; can be used to filter out certain objects; see SceneQuery for details.

Reimplemented in Ogre::PCZSceneManager, and Ogre::OctreeSceneManager.

◆ createSphereQuery()

virtual SphereSceneQuery* Ogre::SceneManager::createSphereQuery ( const Sphere sphere,
uint32  mask = 0xFFFFFFFF 
)
virtual

Creates a SphereSceneQuery for this scene manager.

Remarks
This method creates a new instance of a query object for this scene manager, for a spherical region. See SceneQuery and SphereSceneQuery for full details.
The instance returned from this method must be destroyed by calling SceneManager::destroyQuery when it is no longer required.
Parameters
sphereDetails of the sphere which describes the region for this query.
maskThe query mask to apply to this query; can be used to filter out certain objects; see SceneQuery for details.

Reimplemented in Ogre::PCZSceneManager, and Ogre::OctreeSceneManager.

◆ createPlaneBoundedVolumeQuery()

virtual PlaneBoundedVolumeListSceneQuery* Ogre::SceneManager::createPlaneBoundedVolumeQuery ( const PlaneBoundedVolumeList volumes,
uint32  mask = 0xFFFFFFFF 
)
virtual

Creates a PlaneBoundedVolumeListSceneQuery for this scene manager.

Remarks
This method creates a new instance of a query object for this scene manager, for a region enclosed by a set of planes (normals pointing inwards). See SceneQuery and PlaneBoundedVolumeListSceneQuery for full details.
The instance returned from this method must be destroyed by calling SceneManager::destroyQuery when it is no longer required.
Parameters
volumesDetails of the volumes which describe the region for this query.
maskThe query mask to apply to this query; can be used to filter out certain objects; see SceneQuery for details.

Reimplemented in Ogre::PCZSceneManager, and Ogre::OctreeSceneManager.

◆ createRayQuery()

virtual RaySceneQuery* Ogre::SceneManager::createRayQuery ( const Ray ray,
uint32  mask = 0xFFFFFFFF 
)
virtual

Creates a RaySceneQuery for this scene manager.

Remarks
This method creates a new instance of a query object for this scene manager, looking for objects which fall along a ray. See SceneQuery and RaySceneQuery for full details.
The instance returned from this method must be destroyed by calling SceneManager::destroyQuery when it is no longer required.
Parameters
rayDetails of the ray which describes the region for this query.
maskThe query mask to apply to this query; can be used to filter out certain objects; see SceneQuery for details.

Reimplemented in Ogre::PCZSceneManager, Ogre::BspSceneManager, and Ogre::OctreeSceneManager.

◆ createIntersectionQuery()

virtual IntersectionSceneQuery* Ogre::SceneManager::createIntersectionQuery ( uint32  mask = 0xFFFFFFFF)
virtual

Creates an IntersectionSceneQuery for this scene manager.

Remarks
This method creates a new instance of a query object for locating intersecting objects. See SceneQuery and IntersectionSceneQuery for full details.
The instance returned from this method must be destroyed by calling SceneManager::destroyQuery when it is no longer required.
Parameters
maskThe query mask to apply to this query; can be used to filter out certain objects; see SceneQuery for details.

Reimplemented in Ogre::PCZSceneManager, Ogre::BspSceneManager, and Ogre::OctreeSceneManager.

◆ destroyQuery()

void Ogre::SceneManager::destroyQuery ( SceneQuery query)

Destroys a scene query of any type.

◆ _suppressShadows()

void Ogre::SceneManager::_suppressShadows ( bool  suppress)

Indicates to the SceneManager whether it should suppress the active shadow rendering technique until told otherwise.

Remarks
This is a temporary alternative to setShadowTechnique to suppress the rendering of shadows and forcing all processing down the standard rendering path. This is intended for internal use only.
Parameters
suppressIf true, no shadow rendering will occur until this method is called again with a parameter of false.

◆ _areShadowsSuppressed()

bool Ogre::SceneManager::_areShadowsSuppressed ( void  ) const
inline

Are shadows suppressed?

See also
_suppressShadows

◆ setShadowTechnique()

void Ogre::SceneManager::setShadowTechnique ( ShadowTechnique  technique)

Sets the general shadow technique to be used in this scene.

Remarks

There are multiple ways to generate shadows in a scene, and each has strengths and weaknesses.
  • Stencil-based approaches can be used to draw very long, extreme shadows without loss of precision and the 'additive' version can correctly show the shadowing of complex effects like bump mapping because they physically exclude the light from those areas. However, the edges are very sharp and stencils cannot handle transparency, and they involve a fair amount of CPU work in order to calculate the shadow volumes, especially when animated objects are involved.
  • Texture-based approaches are good for handling transparency (they can, for example, correctly shadow a mesh which uses alpha to represent holes), and they require little CPU overhead, and can happily shadow geometry which is deformed by a vertex program, unlike stencil shadows. However, they have a fixed precision which can introduce 'jaggies' at long range and have fillrate issues of their own.
We support 2 kinds of stencil shadows, and 2 kinds of texture-based shadows, and one simple decal approach. The 2 stencil approaches differ in the amount of multipass work that is required - the modulative approach simply 'darkens' areas in shadow after the main render, which is the least expensive, whilst the additive approach has to perform a render per light and adds the cumulative effect, which is more expensive but more accurate. The texture based shadows both work in roughly the same way, the only difference is that the shadowmap approach is slightly more accurate, but requires a more recent graphics card.
Note that because mixing many shadow techniques can cause problems, only one technique is supported at once. Also, you should call this method at the start of the scene setup.
Parameters
techniqueThe shadowing technique to use for the scene.

◆ getShadowTechnique()

ShadowTechnique Ogre::SceneManager::getShadowTechnique ( void  ) const
inline

Gets the current shadow technique.

◆ setShowDebugShadows()

void Ogre::SceneManager::setShowDebugShadows ( bool  debug)
inline

Enables / disables the rendering of debug information for shadows.

◆ getShowDebugShadows()

bool Ogre::SceneManager::getShowDebugShadows ( void  ) const
inline

Are debug shadows shown?

◆ setShadowColour()

void Ogre::SceneManager::setShadowColour ( const ColourValue colour)
inline

Set the colour used to modulate areas in shadow.

Remarks
This is only applicable for shadow techniques which involve darkening the area in shadow, as opposed to masking out the light. This colour provided is used as a modulative value to darken the areas.

◆ getShadowColour()

const ColourValue& Ogre::SceneManager::getShadowColour ( void  ) const

Get the colour used to modulate areas in shadow.

Remarks
This is only applicable for shadow techniques which involve darkening the area in shadow, as opposed to masking out the light. This colour provided is used as a modulative value to darken the areas.

◆ setShadowDirectionalLightExtrusionDistance()

void Ogre::SceneManager::setShadowDirectionalLightExtrusionDistance ( Real  dist)

Sets the distance a shadow volume is extruded for a directional light.

Remarks
Although directional lights are essentially infinite, there are many reasons to limit the shadow extrusion distance to a finite number, not least of which is compatibility with older cards (which do not support infinite positions), and shadow caster elimination.
The default value is 10,000 world units. This does not apply to point lights or spotlights, since they extrude up to their attenuation range.

◆ getShadowDirectionalLightExtrusionDistance()

Real Ogre::SceneManager::getShadowDirectionalLightExtrusionDistance ( void  ) const

Gets the distance a shadow volume is extruded for a directional light.

◆ setShadowFarDistance()

void Ogre::SceneManager::setShadowFarDistance ( Real  distance)

Sets the default maximum distance away from the camera that shadows will be visible.

You have to call this function before you create lights or the default distance of zero will be used.

Remarks
Shadow techniques can be expensive, therefore it is a good idea to limit them to being rendered close to the camera if possible, and to skip the expense of rendering shadows for distance objects. This method allows you to set the distance at which shadows will no longer be rendered.
Note
Each shadow technique can interpret this subtely differently. For example, one technique may use this to eliminate casters, another might use it to attenuate the shadows themselves. You should tweak this value to suit your chosen shadow technique and scene setup.

◆ getShadowFarDistance()

Real Ogre::SceneManager::getShadowFarDistance ( void  ) const
inline

Gets the default maximum distance away from the camera that shadows will be visible.

◆ getShadowFarDistanceSquared()

Real Ogre::SceneManager::getShadowFarDistanceSquared ( void  ) const
inline

◆ setShadowIndexBufferSize()

void Ogre::SceneManager::setShadowIndexBufferSize ( size_t  size)

Sets the maximum size of the index buffer used to render shadow primitives.

Remarks
This method allows you to tweak the size of the index buffer used to render shadow primitives (including stencil shadow volumes). The default size is 51,200 entries, which is 100k of GPU memory, or enough to render approximately 17,000 triangles. You can reduce this as long as you do not have any models / world geometry chunks which could require more than the amount you set.
The maximum number of triangles required to render a single shadow volume (including light and dark caps when needed) will be 3x the number of edges on the light silhouette, plus the number of light-facing triangles. On average, half the triangles will be facing toward the light, but the number of triangles in the silhouette entirely depends on the mesh - angular meshes will have a higher silhouette tris/mesh tris ratio than a smooth mesh. You can estimate the requirements for your particular mesh by rendering it alone in a scene with shadows enabled and a single light - rotate it or the light and make a note of how high the triangle count goes (remembering to subtract the mesh triangle count)
Parameters
sizeThe number of indexes; divide this by 3 to determine the number of triangles.

◆ getShadowIndexBufferSize()

size_t Ogre::SceneManager::getShadowIndexBufferSize ( void  ) const
inline

Get the size of the shadow index buffer.

◆ getShadowCameraSetup()

const ShadowCameraSetupPtr& Ogre::SceneManager::getShadowCameraSetup ( ) const

Get the shadow camera setup in use for all lights which don't have their own shadow camera setup.

See also
ShadowCameraSetup

◆ setShadowUseInfiniteFarPlane()

void Ogre::SceneManager::setShadowUseInfiniteFarPlane ( bool  enable)
inline

Sets whether we should use an inifinite camera far plane when rendering stencil shadows.

Remarks
Stencil shadow coherency is very reliant on the shadow volume not being clipped by the far plane. If this clipping happens, you get a kind of 'negative' shadow effect. The best way to achieve coherency is to move the far plane of the camera out to infinity, thus preventing the far plane from clipping the shadow volumes. When combined with vertex program extrusion of the volume to infinity, which Ogre does when available, this results in very robust shadow volumes. For this reason, when you enable stencil shadows, Ogre automatically changes your camera settings to project to infinity if the card supports it. You can disable this behaviour if you like by calling this method; although you can never enable infinite projection if the card does not support it.
If you disable infinite projection, or it is not available, you need to be far more careful with your light attenuation / directional light extrusion distances to avoid clipping artefacts at the far plane.
Note
Recent cards will generally support infinite far plane projection. However, we have found some cases where they do not, especially on Direct3D. There is no standard capability we can check to validate this, so we use some heuristics based on experience:
  • OpenGL always seems to support it no matter what the card
  • Direct3D on non-vertex program capable systems (including vertex program capable cards on Direct3D7) does not support it
  • Direct3D on GeForce3 and GeForce4 Ti does not seem to support infinite projection
Therefore in the RenderSystem implementation, we may veto the use of an infinite far plane based on these heuristics.

◆ isShadowTechniqueStencilBased()

bool Ogre::SceneManager::isShadowTechniqueStencilBased ( void  ) const
inline

Is there a stencil shadow based shadowing technique in use?

References Ogre::SHADOWDETAILTYPE_STENCIL.

◆ isShadowTechniqueTextureBased()

bool Ogre::SceneManager::isShadowTechniqueTextureBased ( void  ) const
inline

Is there a texture shadow based shadowing technique in use?

References Ogre::SHADOWDETAILTYPE_TEXTURE.

◆ isShadowTechniqueModulative()

bool Ogre::SceneManager::isShadowTechniqueModulative ( void  ) const
inline

Is there a modulative shadowing technique in use?

References Ogre::SHADOWDETAILTYPE_MODULATIVE.

◆ isShadowTechniqueAdditive()

bool Ogre::SceneManager::isShadowTechniqueAdditive ( void  ) const
inline

Is there an additive shadowing technique in use?

References Ogre::SHADOWDETAILTYPE_ADDITIVE.

◆ isShadowTechniqueIntegrated()

bool Ogre::SceneManager::isShadowTechniqueIntegrated ( void  ) const
inline

Is the shadow technique integrated into primary materials?

References Ogre::SHADOWDETAILTYPE_INTEGRATED.

◆ isShadowTechniqueInUse()

bool Ogre::SceneManager::isShadowTechniqueInUse ( void  ) const
inline

Is there any shadowing technique in use?

References Ogre::SHADOWTYPE_NONE.

◆ setShadowUseLightClipPlanes()

void Ogre::SceneManager::setShadowUseLightClipPlanes ( bool  enabled)
inline

Sets whether when using a built-in additive shadow mode, user clip planes should be used to restrict light rendering.

◆ getShadowUseLightClipPlanes()

bool Ogre::SceneManager::getShadowUseLightClipPlanes ( ) const
inline

Gets whether when using a built-in additive shadow mode, user clip planes should be used to restrict light rendering.

◆ prepareShadowTextures()

virtual void Ogre::SceneManager::prepareShadowTextures ( Camera cam,
Viewport vp,
const LightList lightList = 0 
)
virtual

Method for preparing shadow textures ready for use in a regular render Do not call manually unless before frame start or rendering is paused If lightList is not supplied, will render all lights in frustum.

Reimplemented in Ogre::PCZSceneManager.

◆ setShadowTextureSize()

void Ogre::SceneManager::setShadowTextureSize ( unsigned short  size)
inline

Set the size of the texture used for all texture-based shadows.

Remarks
The larger the shadow texture, the better the detail on texture based shadows, but obviously this takes more memory. The default size is 512. Sizes must be a power of 2.
Note
This is the simple form, see setShadowTextureConfig for the more complex form.

◆ setShadowTextureConfig() [1/2]

void Ogre::SceneManager::setShadowTextureConfig ( size_t  shadowIndex,
uint16  width,
uint16  height,
PixelFormat  format,
uint16  fsaa = 0,
uint16  depthBufferPoolId = 1 
)
inline

Set the detailed configuration for a shadow texture.

Parameters
shadowIndexThe index of the texture to configure, must be < the number of shadow textures setting
widthThe width of the texture
heightThe height of the texture
formatThe pixel format of the texture
fsaaThe level of multisampling to use. Ignored if the device does not support it.
depthBufferPoolIdThe pool # it should query the depth buffers from

◆ setShadowTextureConfig() [2/2]

void Ogre::SceneManager::setShadowTextureConfig ( size_t  shadowIndex,
const ShadowTextureConfig config 
)
inline

Set the detailed configuration for a shadow texture.

Parameters
shadowIndexThe index of the texture to configure, must be < the number of shadow textures setting
configConfiguration structure

◆ getShadowTextureConfigList()

const ShadowTextureConfigList& Ogre::SceneManager::getShadowTextureConfigList ( ) const
inline

Get the current shadow texture settings.

◆ getShadowTextureConfigIterator()

ConstShadowTextureConfigIterator Ogre::SceneManager::getShadowTextureConfigIterator ( ) const
Deprecated:
use getShadowTextureConfigList

◆ setShadowTexturePixelFormat()

void Ogre::SceneManager::setShadowTexturePixelFormat ( PixelFormat  fmt)
inline

Set the pixel format of the textures used for texture-based shadows.

Remarks
By default, a colour texture is used (PF_X8R8G8B8) for texture shadows, but if you want to use more advanced texture shadow types you can alter this. If you do, you will have to also call setShadowTextureCasterMaterial and setShadowTextureReceiverMaterial to provide shader-based materials to use these customised shadow texture formats.
Note
This is the simple form, see setShadowTextureConfig for the more complex form.

◆ setShadowTextureFSAA()

void Ogre::SceneManager::setShadowTextureFSAA ( unsigned short  fsaa)
inline

Set the level of multisample AA of the textures used for texture-based shadows.

Remarks
By default, the level of multisample AA is zero.
Note
This is the simple form, see setShadowTextureConfig for the more complex form.

◆ setShadowTextureCount()

void Ogre::SceneManager::setShadowTextureCount ( size_t  count)
inline

Set the number of textures allocated for texture-based shadows.

Remarks
The default number of textures assigned to deal with texture based shadows is 1; however this means you can only have one light casting shadows at the same time. You can increase this number in order to make this more flexible, but be aware of the texture memory it will use.

◆ getShadowTextureCount()

size_t Ogre::SceneManager::getShadowTextureCount ( void  ) const
inline
Deprecated:
use getShadowTextureConfigList

◆ setShadowTextureCountPerLightType()

void Ogre::SceneManager::setShadowTextureCountPerLightType ( Light::LightTypes  type,
size_t  count 
)
inline

Set the number of shadow textures a light type uses.

Remarks
The default for all light types is 1. This means that each light uses only 1 shadow texture. Call this if you need more than 1 shadow texture per light, E.G. PSSM.
Note
This feature only works with the Integrated shadow technique. Also remember to increase the total number of shadow textures you request appropriately (e.g. via setShadowTextureCount)!!

◆ getShadowTextureCountPerLightType()

size_t Ogre::SceneManager::getShadowTextureCountPerLightType ( Light::LightTypes  type) const
inline

Get the number of shadow textures is assigned for the given light type.

◆ setShadowTextureSettings()

void Ogre::SceneManager::setShadowTextureSettings ( uint16  size,
uint16  count,
PixelFormat  fmt = PF_X8R8G8B8,
uint16  fsaa = 0,
uint16  depthBufferPoolId = 1 
)
inline

Sets the size and count of textures used in texture-based shadows.

See also
setShadowTextureSize and setShadowTextureCount for details, this method just allows you to change both at once, which can save on reallocation if the textures have already been created.
Note
This is the simple form, see setShadowTextureConfig for the more complex form.

◆ getShadowTexture()

const TexturePtr& Ogre::SceneManager::getShadowTexture ( size_t  shadowIndex)
inline

Get a reference to the shadow texture currently in use at the given index.

Note
If you change shadow settings, this reference may no longer be correct, so be sure not to hold the returned reference over texture shadow configuration changes.

◆ setShadowDirLightTextureOffset()

void Ogre::SceneManager::setShadowDirLightTextureOffset ( Real  offset)
inline

Sets the proportional distance which a texture shadow which is generated from a directional light will be offset into the camera view to make best use of texture space.

When generating a shadow texture from a directional light, an approximation is used since it is not possible to render the entire scene to one texture. The texture is projected onto an area centred on the camera, and is the shadow far distance * 2 in length (it is square). This wastes a lot of texture space outside the frustum though, so this offset allows you to move the texture in front of the camera more. However, be aware that this can cause a little shadow 'jittering' during rotation, and that if you move it too far then you'll start to get artefacts close to the camera. The value is represented as a proportion of the shadow far distance, and the default is 0.6.

◆ getShadowDirLightTextureOffset()

Real Ogre::SceneManager::getShadowDirLightTextureOffset ( void  ) const
inline

Gets the proportional distance which a texture shadow which is generated from a directional light will be offset into the camera view to make best use of texture space.

◆ setShadowTextureFadeStart()

void Ogre::SceneManager::setShadowTextureFadeStart ( Real  fadeStart)
inline

Sets the proportional distance at which texture shadows begin to fade out.

Remarks
To hide the edges where texture shadows end (in directional lights) Ogre will fade out the shadow in the distance. This value is a proportional distance of the entire shadow visibility distance at which the shadow begins to fade out. The default is 0.7

◆ setShadowTextureFadeEnd()

void Ogre::SceneManager::setShadowTextureFadeEnd ( Real  fadeEnd)
inline

Sets the proportional distance at which texture shadows finish to fading out.

Remarks
To hide the edges where texture shadows end (in directional lights) Ogre will fade out the shadow in the distance. This value is a proportional distance of the entire shadow visibility distance at which the shadow is completely invisible. The default is 0.9.

◆ setShadowTextureSelfShadow()

void Ogre::SceneManager::setShadowTextureSelfShadow ( bool  selfShadow)

Sets whether or not texture shadows should attempt to self-shadow.

Remarks
The default implementation of texture shadows uses a fixed-function colour texture projection approach for maximum compatibility, and as such cannot support self-shadowing. However, if you decide to implement a more complex shadowing technique using the setShadowTextureCasterMaterial and setShadowTextureReceiverMaterial there is a possibility you may be able to support self-shadowing (e.g by implementing a shader-based shadow map). In this case you might want to enable this option.
Parameters
selfShadowWhether to attempt self-shadowing with texture shadows

◆ getShadowTextureSelfShadow()

bool Ogre::SceneManager::getShadowTextureSelfShadow ( void  ) const
inline

Gets whether or not texture shadows attempt to self-shadow.

◆ setShadowTextureCasterMaterial()

void Ogre::SceneManager::setShadowTextureCasterMaterial ( const MaterialPtr mat)
inline

Sets the default material to use for rendering shadow casters.

Remarks
By default shadow casters are rendered into the shadow texture using an automatically generated fixed-function pass. This allows basic projective texture shadows, but it's possible to use more advanced shadow techniques by overriding the caster and receiver materials, for example providing vertex and fragment programs to implement shadow maps.
You can rely on the ambient light in the scene being set to the requested texture shadow colour, if that's useful.
Note
Individual objects may also override the vertex program in your default material if their materials include shadow_caster_vertex_program_ref, shadow_receiver_vertex_program_ref shadow_caster_material entries, so if you use both make sure they are compatible.
Only a single pass is allowed in your material, although multiple techniques may be used for hardware fallback.

◆ setShadowTextureReceiverMaterial()

void Ogre::SceneManager::setShadowTextureReceiverMaterial ( const MaterialPtr mat)
inline

Sets the default material to use for rendering shadow receivers.

Remarks
By default shadow receivers are rendered as a post-pass using basic modulation. This allows basic projective texture shadows, but it's possible to use more advanced shadow techniques by overriding the caster and receiver materials, for example providing vertex and fragment programs to implement shadow maps.
You can rely on texture unit 0 containing the shadow texture, and for the unit to be set to use projective texturing from the light (only useful if you're using fixed-function, which is unlikely; otherwise you should rely on the texture_viewproj_matrix auto binding)
Note
Individual objects may also override the vertex program in your default material if their materials include shadow_caster_vertex_program_ref shadow_receiver_vertex_program_ref shadow_receiver_material entries, so if you use both make sure they are compatible.
Only a single pass is allowed in your material, although multiple techniques may be used for hardware fallback.

◆ setShadowCasterRenderBackFaces()

void Ogre::SceneManager::setShadowCasterRenderBackFaces ( bool  bf)
inline

Sets whether or not shadow casters should be rendered into shadow textures using their back faces rather than their front faces.

Remarks
Rendering back faces rather than front faces into a shadow texture can help minimise depth comparison issues, if you're using depth shadowmapping. You will probably still need some biasing but you won't need as much. For solid objects the result is the same anyway, if you have objects with holes you may want to turn this option off. The default is to enable this option.

◆ getShadowCasterRenderBackFaces()

bool Ogre::SceneManager::getShadowCasterRenderBackFaces ( ) const
inline

Gets whether or not shadow casters should be rendered into shadow textures using their back faces rather than their front faces.

◆ setShadowCameraSetup()

void Ogre::SceneManager::setShadowCameraSetup ( const ShadowCameraSetupPtr shadowSetup)

Set the shadow camera setup to use for all lights which don't have their own shadow camera setup.

See also
ShadowCameraSetup

◆ _setActiveCompositorChain()

void Ogre::SceneManager::_setActiveCompositorChain ( CompositorChain chain)
inline

Sets the active compositor chain of the current scene being rendered.

Note
CompositorChain does this automatically, no need to call manually.

◆ setLateMaterialResolving()

void Ogre::SceneManager::setLateMaterialResolving ( bool  isLate)
inline

Sets whether to use late material resolving or not.

If set, materials will be resolved from the materials at the pass-setting stage and not at the render queue building stage. This is useful when the active material scheme during the render queue building stage is different from the one during the rendering stage.

◆ isLateMaterialResolving()

bool Ogre::SceneManager::isLateMaterialResolving ( ) const
inline

Gets whether using late material resolving or not.

See also
setLateMaterialResolving

◆ _getActiveCompositorChain()

CompositorChain* Ogre::SceneManager::_getActiveCompositorChain ( ) const
inline

Gets the active compositor chain of the current scene being rendered.

◆ addListener()

void Ogre::SceneManager::addListener ( Listener s)

Add a listener which will get called back on scene manager events.

◆ removeListener()

void Ogre::SceneManager::removeListener ( Listener s)

Remove a listener.

◆ createStaticGeometry()

StaticGeometry* Ogre::SceneManager::createStaticGeometry ( const String name)

Creates a StaticGeometry instance suitable for use with this SceneManager.

Remarks
StaticGeometry is a way of batching up geometry into a more efficient form at the expense of being able to move it. Please read the StaticGeometry class documentation for full information.
Parameters
nameThe name to give the new object
Returns
The new StaticGeometry instance

◆ getStaticGeometry()

StaticGeometry* Ogre::SceneManager::getStaticGeometry ( const String name) const

Retrieve a previously created StaticGeometry instance.

Note
Throws an exception if the named instance does not exist

◆ hasStaticGeometry()

bool Ogre::SceneManager::hasStaticGeometry ( const String name) const

Returns whether a static geometry instance with the given name exists.

◆ destroyStaticGeometry() [1/2]

void Ogre::SceneManager::destroyStaticGeometry ( StaticGeometry geom)

Remove & destroy a StaticGeometry instance.

◆ destroyStaticGeometry() [2/2]

void Ogre::SceneManager::destroyStaticGeometry ( const String name)

Remove & destroy a StaticGeometry instance.

◆ destroyAllStaticGeometry()

void Ogre::SceneManager::destroyAllStaticGeometry ( void  )

Remove & destroy all StaticGeometry instances.

◆ createInstanceManager()

InstanceManager* Ogre::SceneManager::createInstanceManager ( const String customName,
const String meshName,
const String groupName,
InstanceManager::InstancingTechnique  technique,
size_t  numInstancesPerBatch,
uint16  flags = 0,
unsigned short  subMeshIdx = 0 
)

Creates an InstanceManager interface to create & manipulate instanced entities You need to call this function at least once before start calling createInstancedEntity to build up an instance based on the given mesh.

Remarks
Instancing is a way of batching up geometry into a much more efficient form, but with some limitations, and still be able to move & animate it. Please see InstanceManager class documentation for full information.
Parameters
customNameCustom name for referencing. Must be unique
meshNameThe mesh name the instances will be based upon
groupNameThe resource name where the mesh lives
techniqueTechnique to use, which may be shader based, or hardware based.
numInstancesPerBatchSuggested number of instances per batch. The actual number may end up being lower if the technique doesn't support having so many. It can't be zero
flagsFlags to pass to the InstanceManager see InstanceManagerFlags
subMeshIdxInstanceManager only supports using one submesh from the base mesh. This parameter says which submesh to pick (must be <= Mesh::getNumSubMeshes())
Returns
The new InstanceManager instance

◆ getInstanceManager()

InstanceManager* Ogre::SceneManager::getInstanceManager ( const String managerName) const

Retrieves an existing InstanceManager by it's name.

Note
Throws an exception if the named InstanceManager does not exist

◆ hasInstanceManager()

bool Ogre::SceneManager::hasInstanceManager ( const String managerName) const

Returns whether an InstanceManager with the given name exists.

◆ destroyInstanceManager() [1/2]

void Ogre::SceneManager::destroyInstanceManager ( const String name)

Destroys an InstanceManager if it was created with createInstanceManager()

Remarks
Be sure you don't have any InstancedEntity referenced somewhere which was created with this manager, since it will become a dangling pointer.
Parameters
nameName of the manager to remove

◆ destroyInstanceManager() [2/2]

void Ogre::SceneManager::destroyInstanceManager ( InstanceManager instanceManager)

◆ destroyAllInstanceManagers()

void Ogre::SceneManager::destroyAllInstanceManagers ( void  )

◆ getNumInstancesPerBatch()

size_t Ogre::SceneManager::getNumInstancesPerBatch ( const String meshName,
const String groupName,
const String materialName,
InstanceManager::InstancingTechnique  technique,
size_t  numInstancesPerBatch,
uint16  flags = 0,
unsigned short  subMeshIdx = 0 
)
See also
InstanceManager::getMaxOrBestNumInstancesPerBatch
Remarks
If you've already created an InstanceManager, you can call it's getMaxOrBestNumInstancesPerBatch() function directly. Another (not recommended) way to know if the technique is unsupported is by creating an InstanceManager and use createInstancedEntity, which will return null pointer. The input parameter "numInstancesPerBatch" is a suggested value when using IM_VTFBESTFIT flag (in that case it should be non-zero)
Returns
The ideal (or maximum, depending on flags) number of instances per batch for the given technique. Zero if technique is unsupported or errors were spotted

◆ createInstancedEntity()

InstancedEntity* Ogre::SceneManager::createInstancedEntity ( const String materialName,
const String managerName 
)

Creates an InstancedEntity based on an existing InstanceManager.

  • Return value may be null if the InstanceManger technique isn't supported
  • Try to keep the number of entities with different materials to a minimum

Alternatively you can call InstanceManager::createInstancedEntity using the returned pointer from createInstanceManager()

See also
InstanceBatch
Parameters
materialNameMaterial name
managerNameName of the instance manager
Returns
An InstancedEntity ready to be attached to a SceneNode

◆ destroyInstancedEntity()

void Ogre::SceneManager::destroyInstancedEntity ( InstancedEntity instancedEntity)

Removes an InstancedEntity,.

See also
SceneManager::createInstancedEntity &
InstanceBatch::removeInstancedEntity
Parameters
instancedEntityInstance to remove

◆ _addDirtyInstanceManager()

void Ogre::SceneManager::_addDirtyInstanceManager ( InstanceManager dirtyManager)

Called by an InstanceManager when it has at least one InstanceBatch that needs their bounds to be updated for proper culling.

Parameters
dirtyManagerThe manager with dirty batches to update

◆ createMovableObject() [1/2]

MovableObject* Ogre::SceneManager::createMovableObject ( const String name,
const String typeName,
const NameValuePairList params = 0 
)

Create a movable object of the type specified.

Remarks
This is the generalised form of MovableObject creation where you can create a MovableObject of any specialised type generically, including any new types registered using plugins.
Parameters
nameThe name to give the object. Must be unique within type.
typeNameThe type of object to create
paramsOptional name/value pair list to give extra parameters to the created object.

◆ createMovableObject() [2/2]

MovableObject* Ogre::SceneManager::createMovableObject ( const String typeName,
const NameValuePairList params = 0 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ destroyMovableObject() [1/2]

void Ogre::SceneManager::destroyMovableObject ( const String name,
const String typeName 
)

Destroys a MovableObject with the name specified, of the type specified.

Remarks
The MovableObject will automatically detach itself from any nodes on destruction.

◆ destroyMovableObject() [2/2]

void Ogre::SceneManager::destroyMovableObject ( MovableObject m)

Destroys a MovableObject.

Remarks
The MovableObject will automatically detach itself from any nodes on destruction.

◆ destroyAllMovableObjectsByType()

void Ogre::SceneManager::destroyAllMovableObjectsByType ( const String typeName)

Destroy all MovableObjects of a given type.

◆ destroyAllMovableObjects()

void Ogre::SceneManager::destroyAllMovableObjects ( void  )

Destroy all MovableObjects.

◆ getMovableObject()

MovableObject* Ogre::SceneManager::getMovableObject ( const String name,
const String typeName 
) const

Get a reference to a previously created MovableObject.

Note
Throws an exception if the named instance does not exist

◆ hasMovableObject()

bool Ogre::SceneManager::hasMovableObject ( const String name,
const String typeName 
) const

Returns whether a movable object instance with the given name exists.

◆ getMovableObjects()

const MovableObjectMap& Ogre::SceneManager::getMovableObjects ( const String typeName)

Get all MovableObect instances of a given type.

Note
The iterator returned from this method is not thread safe, do not use this if you are creating or deleting objects of this type in another thread.

◆ getMovableObjectIterator()

MovableObjectIterator Ogre::SceneManager::getMovableObjectIterator ( const String typeName)
Deprecated:
use getMovableObjects

◆ injectMovableObject()

void Ogre::SceneManager::injectMovableObject ( MovableObject m)

Inject a MovableObject instance created externally.

Remarks
This method 'injects' a MovableObject instance created externally into the MovableObject instance registry held in the SceneManager. You might want to use this if you have a MovableObject which you don't want to register a factory for; for example a MovableObject which cannot be generally constructed by clients.
Note
It is important that the MovableObject has a unique name for the type, and that its getMovableType() method returns a proper type name.

◆ extractMovableObject() [1/2]

void Ogre::SceneManager::extractMovableObject ( const String name,
const String typeName 
)

Extract a previously injected MovableObject.

Remarks
Essentially this does the same as destroyMovableObject, but only removes the instance from the internal lists, it does not attempt to destroy it.

◆ extractMovableObject() [2/2]

void Ogre::SceneManager::extractMovableObject ( MovableObject m)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ extractAllMovableObjectsByType()

void Ogre::SceneManager::extractAllMovableObjectsByType ( const String typeName)

Extract all injected MovableObjects of a given type.

Remarks
Essentially this does the same as destroyAllMovableObjectsByType, but only removes the instances from the internal lists, it does not attempt to destroy them.

◆ setVisibilityMask()

void Ogre::SceneManager::setVisibilityMask ( uint32  vmask)
inline

Sets a mask which is bitwise 'and'ed with objects own visibility masks to determine if the object is visible.

Remarks
Note that this is combined with any per-viewport visibility mask through an 'and' operation.
See also
Viewport::setVisibilityMask

◆ getVisibilityMask()

uint32 Ogre::SceneManager::getVisibilityMask ( void  )
inline

Gets a mask which is bitwise 'and'ed with objects own visibility masks to determine if the object is visible.

◆ _getCombinedVisibilityMask()

uint32 Ogre::SceneManager::_getCombinedVisibilityMask ( void  ) const

Internal method for getting the combination between the global visibility mask and the per-viewport visibility mask.

◆ setFindVisibleObjects()

void Ogre::SceneManager::setFindVisibleObjects ( bool  find)
inline

Sets whether the SceneManager should search for visible objects, or whether they are being manually handled.

Remarks
This is an advanced function, you should not use this unless you know what you are doing.

◆ getFindVisibleObjects()

bool Ogre::SceneManager::getFindVisibleObjects ( void  )
inline

Gets whether the SceneManager should search for visible objects, or whether they are being manually handled.

◆ setNormaliseNormalsOnScale()

void Ogre::SceneManager::setNormaliseNormalsOnScale ( bool  n)
inline

Set whether to automatically normalise normals on objects whenever they are scaled.

Remarks
Scaling can distort normals so the default behaviour is to compensate for this, but it has a cost. If you would prefer to manually manage this, set this option to 'false' and use Pass::setNormaliseNormals only when needed.

◆ getNormaliseNormalsOnScale()

bool Ogre::SceneManager::getNormaliseNormalsOnScale ( ) const
inline

Get whether to automatically normalise normals on objects whenever they are scaled.

◆ setFlipCullingOnNegativeScale()

void Ogre::SceneManager::setFlipCullingOnNegativeScale ( bool  n)
inline

Set whether to automatically flip the culling mode on objects whenever they are negatively scaled.

Remarks
Negativelyl scaling an object has the effect of flipping the triangles, so the culling mode should probably be inverted to deal with this. If you would prefer to manually manage this, set this option to 'false' and use different materials with Pass::setCullingMode set manually as needed.

◆ getFlipCullingOnNegativeScale()

bool Ogre::SceneManager::getFlipCullingOnNegativeScale ( ) const
inline

Get whether to automatically flip the culling mode on objects whenever they are negatively scaled.

◆ _injectRenderWithPass()

void Ogre::SceneManager::_injectRenderWithPass ( Pass pass,
Renderable rend,
bool  shadowDerivation = true,
bool  doLightIteration = false,
const LightList manualLightList = 0 
)

Render something as if it came from the current queue.

Parameters
rendThe renderable to issue to the pipeline
passThe pass which is being used
doLightIterationIf true, this method will issue the renderable to the pipeline possibly multiple times, if the pass indicates it should be done once per light
manualLightListOnly applicable if doLightIteration is false, this method allows you to pass in a previously determined set of lights which will be used for a single render of this object.
shadowDerivationIf false, disables the derivation of shadow passes from original passes

◆ _suppressRenderStateChanges()

void Ogre::SceneManager::_suppressRenderStateChanges ( bool  suppress)

Indicates to the SceneManager whether it should suppress changing the RenderSystem states when rendering objects.

Remarks
This method allows you to tell the SceneManager not to change any RenderSystem state until you tell it to. This method is only intended for advanced use, don't use it if you're unsure of the effect. The only RenderSystems calls made are to set the world matrix for each object (note - view an projection matrices are NOT SET - they are under your control) and to render the object; it is up to the caller to do everything else, including enabling any vertex / fragment programs and updating their parameter state, and binding parameters to the RenderSystem.
Note
Calling this implicitly disables shadow processing since no shadows can be rendered without changing state.
Parameters
suppressIf true, no RenderSystem state changes will be issued until this method is called again with a parameter of false.

◆ _areRenderStateChangesSuppressed()

bool Ogre::SceneManager::_areRenderStateChangesSuppressed ( void  ) const
inline

Are render state changes suppressed?

See also
_suppressRenderStateChanges

◆ _setPass()

const Pass* Ogre::SceneManager::_setPass ( const Pass pass,
bool  evenIfSuppressed = false,
bool  shadowDerivation = true 
)

Internal method for setting up the renderstate for a rendering pass.

Parameters
passThe Pass details to set.
evenIfSuppressedSets the pass details even if render state changes are suppressed; if you are using this to manually set state when render state changes are suppressed, you should set this to true.
shadowDerivationIf false, disables the derivation of shadow passes from original passes
Returns
A Pass object that was used instead of the one passed in, can happen when rendering shadow passes

◆ _markGpuParamsDirty()

void Ogre::SceneManager::_markGpuParamsDirty ( uint16  mask)

Method to allow you to mark gpu parameters as dirty, causing them to be updated according to the mask that you set when updateGpuProgramParameters is next called.

Only really useful if you're controlling parameter state in inner rendering loop callbacks.

Parameters
maskSome combination of GpuParamVariability which is bitwise OR'ed with the current dirty state.

◆ _renderQueueGroupObjects()

void Ogre::SceneManager::_renderQueueGroupObjects ( RenderQueueGroup group,
QueuedRenderableCollection::OrganisationMode  om 
)

Render the objects in a given queue group.

Remarks
You should only call this from a RenderQueueInvocation implementation

◆ setQueuedRenderableVisitor()

void Ogre::SceneManager::setQueuedRenderableVisitor ( SceneMgrQueuedRenderableVisitor visitor)

Advanced method for supplying an alternative visitor, used for parsing the render queues and sending the results to the renderer.

Remarks
You can use this method to insert your own implementation of the QueuedRenderableVisitor interface, which receives calls as the queued renderables are parsed in a given order (determined by RenderQueueInvocationSequence) and are sent to the renderer. If you provide your own implementation of this visitor, you are responsible for either calling the rendersystem, or passing the calls on to the base class implementation.
Note
Ownership is not taken of this pointer, you are still required to delete it yourself once you're finished.
Parameters
visitorYour implementation of SceneMgrQueuedRenderableVisitor. If you pass 0, the default implementation will be used.

◆ getQueuedRenderableVisitor()

SceneMgrQueuedRenderableVisitor* Ogre::SceneManager::getQueuedRenderableVisitor ( void  ) const

Gets the current visitor object which processes queued renderables.

◆ getDestinationRenderSystem()

RenderSystem* Ogre::SceneManager::getDestinationRenderSystem ( )

Get the rendersystem subclass to which the output of this Scene Manager gets sent.

◆ getCurrentViewport()

Viewport* Ogre::SceneManager::getCurrentViewport ( void  ) const
inline

Gets the current viewport being rendered (advanced use only, only valid during viewport update.

◆ getVisibleObjectsBoundsInfo()

const VisibleObjectsBoundsInfo& Ogre::SceneManager::getVisibleObjectsBoundsInfo ( const Camera cam) const

Returns a visibility boundary box for a specific camera.

◆ getShadowCasterBoundsInfo()

const VisibleObjectsBoundsInfo& Ogre::SceneManager::getShadowCasterBoundsInfo ( const Light light,
size_t  iteration = 0 
) const

Returns the shadow caster AAB for a specific light-camera combination.

◆ addLodListener()

void Ogre::SceneManager::addLodListener ( LodListener listener)

Add a level of detail listener.

◆ removeLodListener()

void Ogre::SceneManager::removeLodListener ( LodListener listener)

Remove a level of detail listener.

Remarks
Do not call from inside an LodListener callback method.

◆ _notifyMovableObjectLodChanged()

void Ogre::SceneManager::_notifyMovableObjectLodChanged ( MovableObjectLodChangedEvent evt)

Notify that a movable object LOD change event has occurred.

◆ _notifyEntityMeshLodChanged()

void Ogre::SceneManager::_notifyEntityMeshLodChanged ( EntityMeshLodChangedEvent evt)

Notify that an entity mesh LOD change event has occurred.

◆ _notifyEntityMaterialLodChanged()

void Ogre::SceneManager::_notifyEntityMaterialLodChanged ( EntityMaterialLodChangedEvent evt)

Notify that an entity material LOD change event has occurred.

◆ _handleLodEvents()

void Ogre::SceneManager::_handleLodEvents ( )

Handle LOD events.

◆ _getCurrentRenderStage()

IlluminationRenderStage Ogre::SceneManager::_getCurrentRenderStage ( )
inline

◆ _getAutoParamDataSource()

const AutoParamDataSource* Ogre::SceneManager::_getAutoParamDataSource ( )
inline

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