OGRE  1.9.0
OgreSceneManager.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2This source file is a part of OGRE
3(Object-oriented Graphics Rendering Engine)
4
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8Permission is hereby granted, free of charge, to any person obtaining a copy
9of this software and associated documentation files (the "Software"), to deal
10in the Software without restriction, including without limitation the rights
11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12copies of the Software, and to permit persons to whom the Software is
13furnished to do so, subject to the following conditions:
14
15The above copyright notice and this permission notice shall be included in
16all copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24THE SOFTWARE
25
26You may alternatively use this source under the terms of a specific version of
27the OGRE Unrestricted License provided you have obtained such a license from
28Torus Knot Software Ltd.
29-------------------------------------------------------------------------*/
30#ifndef __SceneManager_H__
31#define __SceneManager_H__
32
33// Precompiler options
34#include "OgrePrerequisites.h"
35
36#include "OgreString.h"
37#include "OgreSceneNode.h"
38#include "OgrePlane.h"
39#include "OgreQuaternion.h"
40#include "OgreColourValue.h"
41#include "OgreCommon.h"
42#include "OgreSceneQuery.h"
44#include "OgreAnimationState.h"
45#include "OgreRenderQueue.h"
47#include "OgreRectangle2D.h"
48#include "OgrePixelFormat.h"
50#include "OgreTexture.h"
53#include "OgreCamera.h"
55#include "OgreLodListener.h"
56#include "OgreInstanceManager.h"
57#include "OgreRenderSystem.h"
58#include "OgreHeaderPrefix.h"
59#include "OgreNameGenerator.h"
60
61namespace Ogre {
70 struct ViewPoint
71 {
74 };
75
76 // Forward declarations
81 class CompositorChain;
82
87 {
100
102 void reset();
103 void merge(const AxisAlignedBox& boxBounds, const Sphere& sphereBounds,
104 const Camera* cam, bool receiver=true);
109 const Sphere& sphereBounds, const Camera* cam);
110
111
112 };
113
144 {
145 public:
163 {
164 _OgreExport bool operator()(const Material* x, const Material* y) const;
165 };
168 {
169 _OgreExport bool operator()(const Light* a, const Light* b) const;
170 };
171
174 {
180 IRS_RENDER_RECEIVER_PASS
181 };
182
188 {
192 SCRQM_EXCLUDE
193 };
194
196 {
203 };
204
206 {
212 };
213
215 {
217 };
218
223 {
224 public:
226 virtual ~Listener() {}
227
234 virtual void preUpdateSceneGraph(SceneManager* source, Camera* camera)
235 { (void)source; (void)camera; }
236
243 virtual void postUpdateSceneGraph(SceneManager* source, Camera* camera)
244 { (void)source; (void)camera; }
245
255 virtual void preFindVisibleObjects(SceneManager* source,
257 { (void)source; (void)irs; (void)v; }
258
271 { (void)source; (void)irs; (void)v; }
272
287 virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
288 { (void)numberOfShadowTextures; }
289
304 Camera* camera, size_t iteration)
305 { (void)light; (void)camera; (void)iteration; }
306
321 Frustum* frustum)
322 { (void)light; (void)frustum; }
323
346 virtual bool sortLightsAffectingFrustum(LightList& lightList)
347 { (void)lightList; return false; }
348
351 { (void)source; }
352 };
353
358 {
359 protected:
362 public:
364 :transparentShadowCastersMode(false) {}
367 bool visit(const Pass* p);
369
380
381 };
384
385 protected:
386
390 virtual SceneNode* createSceneNodeImpl(const String& name);
391
394
398
401
404
406
410
415
418
420
428
433
436
440
441 // Sky params
442 // Sky plane
444 Entity* mSkyDomeEntity[5];
446
450
451 // Sky plane
456 // Sky box
461 // Sky dome
466
467 // Fog
473
478
479 unsigned long mLastFrameNumber;
480 Matrix4 mTempXform[256];
483
487
488 protected:
489
499
503
505 size_t mShadowTextureCountPerType[3];
506
509
512 {
514 int type;
519
520 bool operator== (const LightInfo& rhs) const
521 {
522 return light == rhs.light && type == rhs.type &&
523 range == rhs.range && position == rhs.position && lightMask == rhs.lightMask &&
524 castsShadows == rhs.castsShadows;
525 }
526
527 bool operator!= (const LightInfo& rhs) const
528 {
529 return !(*this == rhs);
530 }
531 };
532
534
537 LightInfoList mTestLightInfos; // potentially new list
540
544 {
547 };
562 OGRE_MUTEX(mMovableObjectCollectionMapMutex);
563
568 virtual void initRenderQueue(void);
582 virtual const Pass* deriveShadowCasterPass(const Pass* pass);
591 virtual const Pass* deriveShadowReceiverPass(const Pass* pass);
592
599 virtual bool validatePassForRendering(const Pass* pass);
600
607 virtual bool validateRenderableForRendering(const Pass* pass, const Renderable* rend);
608
610 {
611 BP_FRONT = 0,
612 BP_BACK = 1,
613 BP_LEFT = 2,
614 BP_RIGHT = 3,
615 BP_UP = 4,
616 BP_DOWN = 5
617 };
618
619 /* Internal utility method for creating the planes of a skybox.
620 */
622 BoxPlane bp,
623 Real distance,
624 const Quaternion& orientation,
625 const String& groupName);
626
627 /* Internal utility method for creating the planes of a skydome.
628 */
630 BoxPlane bp,
631 Real curvature, Real tiling, Real distance,
632 const Quaternion& orientation,
633 int xsegments, int ysegments, int ySegmentsToKeep,
634 const String& groupName);
635
638
642 OGRE_MUTEX(mAnimationsListMutex);
644
645
648 virtual void useRenderableViewProjMode(const Renderable* pRend, bool fixedFunction);
649
652 virtual void resetViewProjMode(bool fixedFunction);
653
656
662 virtual void firePreRenderQueues();
664 virtual void firePostRenderQueues();
666 virtual bool fireRenderQueueStarted(uint8 id, const String& invocation);
668 virtual bool fireRenderQueueEnded(uint8 id, const String& invocation);
670 virtual void fireRenderSingleObject(Renderable* rend, const Pass* pass, const AutoParamDataSource* source,
671 const LightList* pLightList, bool suppressRenderStateChanges);
672
674 virtual void fireShadowTexturesUpdated(size_t numberOfShadowTextures);
676 virtual void fireShadowTexturesPreCaster(Light* light, Camera* camera, size_t iteration);
680 virtual void firePreUpdateSceneGraph(Camera* camera);
682 virtual void firePostUpdateSceneGraph(Camera* camera);
690 virtual void setViewport(Viewport *vp);
691
694
700 virtual void prepareRenderQueue(void);
701
702
718 virtual void renderSingleObject(Renderable* rend, const Pass* pass,
719 bool lightScissoringClipping, bool doLightIteration, const LightList* manualLightList = 0);
720
723 {
725 }
726
729
732
758 {
762 unsigned long clipPlanesValid;
763 LightClippingInfo() : scissorValid(false), clipPlanesValid(false) {}
764
765 };
769
772
782 {
783 _OgreExport bool operator()(const Light* l1, const Light* l2) const;
784 };
785
786
793 virtual void findLightsAffectingFrustum(const Camera* camera);
795 virtual void initShadowVolumeMaterials(void);
799 virtual void destroyShadowTextures(void);
800
804
807
808 public:
812 virtual void prepareShadowTextures(Camera* cam, Viewport* vp, const LightList* lightList = 0);
813
814 //A render context, used to store internal data for pausing/resuming rendering
816 {
822 };
823
831 virtual void _resumeRendering(RenderContext* context);
832
833 protected:
841 virtual void renderShadowVolumesToStencil(const Light* light, const Camera* cam,
842 bool calcScissor);
848 virtual void setShadowVolumeStencilState(bool secondpass, bool zfail, bool twosided);
851 Pass* pass, const LightList *manualLightList, unsigned long flags,
852 bool secondpass, bool zfail, bool twosided);
873
877
882
883
886
889 {
890 protected:
896 const Light* mLight;
898 public:
900 mCasterList(0), mIsLightInFrustum(false), mLightClipVolumeList(0),
901 mCamera(0) {}
902 // Prepare the listener for use with a set of parameters
903 void prepare(bool lightInFrustum,
904 const PlaneBoundedVolumeList* lightClipVolumes,
905 const Light* light, const Camera* cam, ShadowCasterList* casterList,
906 Real farDistSquared)
907 {
908 mCasterList = casterList;
909 mIsLightInFrustum = lightInFrustum;
910 mLightClipVolumeList = lightClipVolumes;
911 mCamera = cam;
912 mLight = light;
913 mFarDistSquared = farDistSquared;
914 }
917 };
918
920
928 const Camera* camera);
947
952 virtual void renderObjects(const QueuedRenderableCollection& objs,
953 QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping,
954 bool doLightIteration, const LightList* manualLightList = 0);
961 QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping,
962 bool doLightIteration, const LightList* manualLightList = 0);
963
970 bool suppressShadows, bool suppressRenderState);
971
973 virtual ClipResult buildAndSetScissor(const LightList& ll, const Camera* cam);
975 virtual void buildScissor(const Light* l, const Camera* cam, RealRect& rect);
976 virtual void resetScissor();
979 virtual void buildLightClip(const Light* l, PlaneList& planes);
980 virtual void resetLightClip();
982
987
992
995 unsigned short mLastLightLimit;
999
1000 virtual void useLights(const LightList& lights, unsigned short limit);
1001 virtual void setViewMatrix(const Matrix4& m);
1002 virtual void useLightsGpuProgram(const Pass* pass, const LightList* lights);
1003 virtual void bindGpuProgram(GpuProgram* prog);
1004 virtual void updateGpuProgramParameters(const Pass* p);
1005
1006
1007
1008
1009
1010
1011
1012
1016
1020
1024
1028
1029 public:
1032 SceneManager(const String& instanceName);
1033
1036 virtual ~SceneManager();
1037
1038
1064 OGRE_MUTEX(sceneGraphMutex);
1065
1067 const String& getName(void) const { return mName; }
1068
1075 virtual const String& getTypeName(void) const = 0;
1076
1084 virtual Camera* createCamera(const String& name);
1085
1089 virtual Camera* getCamera(const String& name) const;
1090
1093 virtual bool hasCamera(const String& name) const;
1094
1103 virtual void destroyCamera(Camera *cam);
1104
1110 virtual void destroyCamera(const String& name);
1111
1120 virtual void destroyAllCameras(void);
1121
1132 virtual Light* createLight(const String& name);
1133
1135 virtual Light* createLight();
1136
1140 virtual Light* getLight(const String& name) const;
1141
1144 virtual bool hasLight(const String& name) const;
1145
1149
1152 virtual const RealRect& getLightScissorRect(Light* l, const Camera* cam);
1153
1158 virtual void destroyLight(const String& name);
1159
1164 virtual void destroyLight(Light* light);
1167 virtual void destroyAllLights(void);
1168
1179 virtual void _notifyLightsDirty(void);
1180
1193 ulong _getLightsDirtyCounter(void) const { return mLightsDirtyCounter; }
1194
1201 virtual const LightList& _getLightsAffectingFrustum(void) const;
1202
1225 virtual void _populateLightList(const Vector3& position, Real radius, LightList& destList, uint32 lightMask = 0xFFFFFFFF);
1226
1255 virtual void _populateLightList(const SceneNode* sn, Real radius, LightList& destList, uint32 lightMask = 0xFFFFFFFF);
1256
1274
1289 virtual SceneNode* createSceneNode(const String& name);
1290
1297 virtual void destroySceneNode(const String& name);
1298
1305 virtual void destroySceneNode(SceneNode* sn);
1322
1330 virtual SceneNode* getSceneNode(const String& name) const;
1331
1334 virtual bool hasSceneNode(const String& name) const;
1335
1336
1344 virtual Entity* createEntity(const String& entityName, const String& meshName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME );
1345
1352 virtual Entity* createEntity(const String& entityName, const MeshPtr& pMesh );
1353
1359 virtual Entity* createEntity(const String& meshName);
1360
1365 virtual Entity* createEntity(const MeshPtr& pMesh);
1366
1376 PT_SPHERE
1378
1385 virtual Entity* createEntity(const String& entityName, PrefabType ptype);
1386
1394 virtual Entity* getEntity(const String& name) const;
1397 virtual bool hasEntity(const String& name) const;
1398
1407 virtual void destroyEntity(Entity* ent);
1408
1417 virtual void destroyEntity(const String& name);
1418
1428 virtual void destroyAllEntities(void);
1429
1443 virtual ManualObject* getManualObject(const String& name) const;
1446 virtual bool hasManualObject(const String& name) const;
1447
1453 virtual void destroyManualObject(const String& name);
1456 virtual void destroyAllManualObjects(void);
1470 virtual BillboardChain* getBillboardChain(const String& name) const;
1473 virtual bool hasBillboardChain(const String& name) const;
1474
1480 virtual void destroyBillboardChain(const String& name);
1483 virtual void destroyAllBillboardChains(void);
1489 virtual RibbonTrail* createRibbonTrail(const String& name);
1497 virtual RibbonTrail* getRibbonTrail(const String& name) const;
1500 virtual bool hasRibbonTrail(const String& name) const;
1501
1507 virtual void destroyRibbonTrail(const String& name);
1510 virtual void destroyAllRibbonTrails(void);
1511
1533 const String& templateName);
1554 size_t quota = 500,
1555 const String& resourceGroup = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
1556
1574 virtual ParticleSystem* createParticleSystem(size_t quota = 500,
1575 const String& resourceGroup = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
1579 virtual ParticleSystem* getParticleSystem(const String& name) const;
1582 virtual bool hasParticleSystem(const String& name) const;
1583
1589 virtual void destroyParticleSystem(const String& name);
1592 virtual void destroyAllParticleSystems(void);
1593
1599 virtual void clearScene(void);
1600
1613 void setAmbientLight(const ColourValue& colour);
1614
1617 const ColourValue& getAmbientLight(void) const;
1618
1634 virtual void prepareWorldGeometry(const String& filename);
1635
1654 const String& typeName = StringUtil::BLANK);
1655
1668 virtual void setWorldGeometry(const String& filename);
1669
1685 virtual void setWorldGeometry(DataStreamPtr& stream,
1686 const String& typeName = StringUtil::BLANK);
1687
1700 virtual size_t estimateWorldGeometry(const String& filename)
1701 { (void)filename; return 0; }
1702
1715 virtual size_t estimateWorldGeometry(DataStreamPtr& stream,
1716 const String& typeName = StringUtil::BLANK)
1717 { (void)stream; (void)typeName; return 0; }
1718
1733 virtual ViewPoint getSuggestedViewpoint(bool random = false);
1734
1748 virtual bool setOption( const String& strKey, const void* pValue )
1749 { (void)strKey; (void)pValue; return false; }
1750
1764 virtual bool getOption( const String& strKey, void* pDestValue )
1765 { (void)strKey; (void)pDestValue; return false; }
1766
1776 virtual bool hasOption( const String& strKey ) const
1777 { (void)strKey; return false; }
1778
1793 virtual bool getOptionValues( const String& strKey, StringVector& refValueList )
1794 { (void)strKey; (void)refValueList; return false; }
1795
1802 virtual bool getOptionKeys( StringVector& refKeys )
1803 { (void)refKeys; return false; }
1804
1813 virtual void _updateSceneGraph(Camera* cam);
1814
1826 virtual void _findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters);
1827
1832 virtual void _applySceneAnimations(void);
1833
1836 virtual void _renderVisibleObjects(void);
1837
1851 virtual void _renderScene(Camera* camera, Viewport* vp, bool includeOverlays);
1852
1857
1858
1859
1869
1923 virtual void setSkyPlane(
1924 bool enable,
1925 const Plane& plane, const String& materialName, Real scale = 1000,
1926 Real tiling = 10, bool drawFirst = true, Real bow = 0,
1927 int xsegments = 1, int ysegments = 1,
1928 const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
1972 virtual void _setSkyPlane(
1973 bool enable,
1974 const Plane& plane, const String& materialName, Real scale = 1000,
1975 Real tiling = 10, uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY, Real bow = 0,
1976 int xsegments = 1, int ysegments = 1,
1977 const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
1978
1980 virtual void setSkyPlaneEnabled(bool enable) { mSkyPlaneEnabled = enable; }
1981
1983 virtual bool isSkyPlaneEnabled(void) const { return mSkyPlaneEnabled; }
1984
1986 virtual SceneNode* getSkyPlaneNode(void) const { return mSkyPlaneNode; }
1987
1989 virtual const SkyPlaneGenParameters& getSkyPlaneGenParameters(void) const { return mSkyPlaneGenParameters; }
1990
2032 virtual void setSkyBox(
2033 bool enable, const String& materialName, Real distance = 5000,
2034 bool drawFirst = true, const Quaternion& orientation = Quaternion::IDENTITY,
2035 const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
2036
2069 virtual void _setSkyBox(
2070 bool enable, const String& materialName, Real distance = 5000,
2071 uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY, const Quaternion& orientation = Quaternion::IDENTITY,
2072 const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
2073
2075 virtual void setSkyBoxEnabled(bool enable) { mSkyBoxEnabled = enable; }
2076
2078 virtual bool isSkyBoxEnabled(void) const { return mSkyBoxEnabled; }
2079
2081 virtual SceneNode* getSkyBoxNode(void) const { return mSkyBoxNode; }
2082
2084 virtual const SkyBoxGenParameters& getSkyBoxGenParameters(void) const { return mSkyBoxGenParameters; }
2085
2141 virtual void setSkyDome(
2142 bool enable, const String& materialName, Real curvature = 10,
2143 Real tiling = 8, Real distance = 4000, bool drawFirst = true,
2144 const Quaternion& orientation = Quaternion::IDENTITY,
2145 int xsegments = 16, int ysegments = 16, int ysegments_keep = -1,
2146 const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
2147
2194 virtual void _setSkyDome(
2195 bool enable, const String& materialName, Real curvature = 10,
2196 Real tiling = 8, Real distance = 4000, uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY,
2197 const Quaternion& orientation = Quaternion::IDENTITY,
2198 int xsegments = 16, int ysegments = 16, int ysegments_keep = -1,
2199 const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
2200
2202 virtual void setSkyDomeEnabled(bool enable) { mSkyDomeEnabled = enable; }
2203
2205 virtual bool isSkyDomeEnabled(void) const { return mSkyDomeEnabled; }
2206
2208 virtual SceneNode* getSkyDomeNode(void) const { return mSkyDomeNode; }
2209
2211 virtual const SkyDomeGenParameters& getSkyDomeGenParameters(void) const { return mSkyDomeGenParameters; }
2212
2238 FogMode mode = FOG_NONE, const ColourValue& colour = ColourValue::White,
2239 Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0);
2240
2243 virtual FogMode getFogMode(void) const;
2244
2247 virtual const ColourValue& getFogColour(void) const;
2248
2251 virtual Real getFogStart(void) const;
2252
2255 virtual Real getFogEnd(void) const;
2256
2259 virtual Real getFogDensity(void) const;
2260
2261
2279 virtual BillboardSet* createBillboardSet(const String& name, unsigned int poolSize = 20);
2280
2287 virtual BillboardSet* createBillboardSet(unsigned int poolSize = 20);
2291 virtual BillboardSet* getBillboardSet(const String& name) const;
2294 virtual bool hasBillboardSet(const String& name) const;
2295
2303
2310 virtual void destroyBillboardSet(const String& name);
2311
2321 virtual void destroyAllBillboardSets(void);
2322
2330 virtual void setDisplaySceneNodes(bool display);
2332 virtual bool getDisplaySceneNodes(void) const {return mDisplayNodes;}
2333
2354 virtual Animation* createAnimation(const String& name, Real length);
2355
2359 virtual Animation* getAnimation(const String& name) const;
2362 virtual bool hasAnimation(const String& name) const;
2363
2369 virtual void destroyAnimation(const String& name);
2370
2372 virtual void destroyAllAnimations(void);
2373
2401 virtual AnimationState* createAnimationState(const String& animName);
2402
2406 virtual AnimationState* getAnimationState(const String& animName) const;
2409 virtual bool hasAnimationState(const String& name) const;
2410
2416 virtual void destroyAnimationState(const String& name);
2417
2419 virtual void destroyAllAnimationStates(void);
2420
2444 virtual void manualRender(RenderOperation* rend, Pass* pass, Viewport* vp,
2445 const Matrix4& worldMatrix, const Matrix4& viewMatrix, const Matrix4& projMatrix,
2446 bool doBeginEndFrame = false) ;
2447
2467 virtual void manualRender(Renderable* rend, const Pass* pass, Viewport* vp,
2468 const Matrix4& viewMatrix, const Matrix4& projMatrix, bool doBeginEndFrame = false, bool lightScissoringClipping = true,
2469 bool doLightIteration = true, const LightList* manualLightList = 0);
2470
2482
2487
2490
2496
2535
2563
2565 virtual void showBoundingBoxes(bool bShow);
2566
2568 virtual bool getShowBoundingBoxes() const;
2569
2571 virtual void _notifyAutotrackingSceneNode(SceneNode* node, bool autoTrack);
2572
2573
2586 virtual AxisAlignedBoxSceneQuery*
2587 createAABBQuery(const AxisAlignedBox& box, uint32 mask = 0xFFFFFFFF);
2600 virtual SphereSceneQuery*
2601 createSphereQuery(const Sphere& sphere, uint32 mask = 0xFFFFFFFF);
2616
2617
2630 virtual RaySceneQuery*
2631 createRayQuery(const Ray& ray, uint32 mask = 0xFFFFFFFF);
2632 //PyramidSceneQuery* createPyramidQuery(const Pyramid& p, unsigned long mask = 0xFFFFFFFF);
2644 virtual IntersectionSceneQuery*
2646
2648 virtual void destroyQuery(SceneQuery* query);
2649
2652
2656 return CameraIterator(mCameras.begin(), mCameras.end());
2657 }
2660 const CameraList& getCameras() const { return mCameras; }
2663 return AnimationIterator(mAnimationsList.begin(), mAnimationsList.end());
2664 }
2667 const AnimationList& getAnimations() const { return mAnimationsList; }
2670 return mAnimationStates.getAnimationStateIterator();
2671 }
2672
2705 virtual void setShadowTechnique(ShadowTechnique technique);
2706
2708 virtual ShadowTechnique getShadowTechnique(void) const { return mShadowTechnique; }
2709
2711 virtual void setShowDebugShadows(bool debug) { mDebugShadows = debug; }
2713 virtual bool getShowDebugShadows(void ) const { return mDebugShadows; }
2714
2721 virtual void setShadowColour(const ColourValue& colour);
2728 virtual const ColourValue& getShadowColour(void) const;
2760 virtual void setShadowFarDistance(Real distance);
2764 virtual Real getShadowFarDistance(void) const
2765 { return mDefaultShadowFarDist; }
2767 { return mDefaultShadowFarDistSquared; }
2768
2794 virtual void setShadowIndexBufferSize(size_t size);
2796 virtual size_t getShadowIndexBufferSize(void) const
2797 { return mShadowIndexBufferSize; }
2806 virtual void setShadowTextureSize(unsigned short size);
2807
2817 virtual void setShadowTextureConfig(size_t shadowIndex, unsigned short width,
2818 unsigned short height, PixelFormat format, unsigned short fsaa = 0, uint16 depthBufferPoolId=1);
2824 virtual void setShadowTextureConfig(size_t shadowIndex,
2825 const ShadowTextureConfig& config);
2826
2829
2848 virtual void setShadowTextureFSAA(unsigned short fsaa);
2849
2857 virtual void setShadowTextureCount(size_t count);
2859 size_t getShadowTextureCount(void) const {return mShadowTextureConfigList.size(); }
2860
2871 { mShadowTextureCountPerType[type] = count; }
2874 {return mShadowTextureCountPerType[type]; }
2875
2883 virtual void setShadowTextureSettings(unsigned short size, unsigned short count,
2884 PixelFormat fmt = PF_X8R8G8B8, unsigned short fsaa = 0, uint16 depthBufferPoolId=1);
2885
2892 virtual const TexturePtr& getShadowTexture(size_t shadowIndex);
2893
2908 virtual void setShadowDirLightTextureOffset(Real offset) { mShadowTextureOffset = offset;}
2912 virtual Real getShadowDirLightTextureOffset(void) const { return mShadowTextureOffset; }
2920 virtual void setShadowTextureFadeStart(Real fadeStart)
2921 { mShadowTextureFadeStart = fadeStart; }
2929 virtual void setShadowTextureFadeEnd(Real fadeEnd)
2930 { mShadowTextureFadeEnd = fadeEnd; }
2931
2944 virtual void setShadowTextureSelfShadow(bool selfShadow);
2945
2947 virtual bool getShadowTextureSelfShadow(void) const
2948 { return mShadowTextureSelfShadow; }
2969 virtual void setShadowTextureCasterMaterial(const String& name);
2991 virtual void setShadowTextureReceiverMaterial(const String& name);
2992
3003 virtual void setShadowCasterRenderBackFaces(bool bf) { mShadowCasterRenderBackFaces = bf; }
3004
3008 virtual bool getShadowCasterRenderBackFaces() const { return mShadowCasterRenderBackFaces; }
3009
3014 virtual void setShadowCameraSetup(const ShadowCameraSetupPtr& shadowSetup);
3015
3021
3058 virtual void setShadowUseInfiniteFarPlane(bool enable) {
3059 mShadowUseInfiniteFarPlane = enable; }
3060
3062 virtual bool isShadowTechniqueStencilBased(void) const
3063 { return (mShadowTechnique & SHADOWDETAILTYPE_STENCIL) != 0; }
3065 virtual bool isShadowTechniqueTextureBased(void) const
3066 { return (mShadowTechnique & SHADOWDETAILTYPE_TEXTURE) != 0; }
3068 virtual bool isShadowTechniqueModulative(void) const
3069 { return (mShadowTechnique & SHADOWDETAILTYPE_MODULATIVE) != 0; }
3071 virtual bool isShadowTechniqueAdditive(void) const
3072 { return (mShadowTechnique & SHADOWDETAILTYPE_ADDITIVE) != 0; }
3074 virtual bool isShadowTechniqueIntegrated(void) const
3075 { return (mShadowTechnique & SHADOWDETAILTYPE_INTEGRATED) != 0; }
3077 virtual bool isShadowTechniqueInUse(void) const
3078 { return mShadowTechnique != SHADOWTYPE_NONE; }
3082 virtual void setShadowUseLightClipPlanes(bool enabled) { mShadowAdditiveLightClip = enabled; }
3086 virtual bool getShadowUseLightClipPlanes() const { return mShadowAdditiveLightClip; }
3087
3091 virtual void _setActiveCompositorChain(CompositorChain* chain) { mActiveCompositorChain = chain; }
3092
3098 virtual void setLateMaterialResolving(bool isLate) { mLateMaterialResolving = isLate; }
3099
3102 virtual bool isLateMaterialResolving() const { return mLateMaterialResolving; }
3103
3105 virtual CompositorChain* _getActiveCompositorChain() const { return mActiveCompositorChain; }
3106
3109 virtual void addListener(Listener* s);
3112 virtual void removeListener(Listener* s);
3113
3127 virtual StaticGeometry* getStaticGeometry(const String& name) const;
3129 virtual bool hasStaticGeometry(const String& name) const;
3133 virtual void destroyStaticGeometry(const String& name);
3135 virtual void destroyAllStaticGeometry(void);
3136
3148 virtual InstancedGeometry* getInstancedGeometry(const String& name) const;
3152 virtual void destroyInstancedGeometry(const String& name);
3155
3174 virtual InstanceManager* createInstanceManager( const String &customName, const String &meshName,
3175 const String &groupName,
3177 size_t numInstancesPerBatch, uint16 flags=0,
3178 unsigned short subMeshIdx=0 );
3179
3183 virtual InstanceManager* getInstanceManager( const String &managerName ) const;
3184
3186 virtual bool hasInstanceManager( const String &managerName ) const;
3187
3194 virtual void destroyInstanceManager( const String &name );
3195 virtual void destroyInstanceManager( InstanceManager *instanceManager );
3196
3197 virtual void destroyAllInstanceManagers(void);
3198
3211 virtual size_t getNumInstancesPerBatch( const String &meshName, const String &groupName,
3212 const String &materialName,
3214 size_t numInstancesPerBatch, uint16 flags=0,
3215 unsigned short subMeshIdx=0 );
3216
3228 virtual InstancedEntity* createInstancedEntity( const String &materialName,
3229 const String &managerName );
3230
3235 virtual void destroyInstancedEntity( InstancedEntity *instancedEntity );
3236
3242
3254 const String& typeName, const NameValuePairList* params = 0);
3264 virtual MovableObject* createMovableObject(const String& typeName, const NameValuePairList* params = 0);
3270 virtual void destroyMovableObject(const String& name, const String& typeName);
3278 virtual void destroyAllMovableObjectsByType(const String& typeName);
3280 virtual void destroyAllMovableObjects(void);
3284 virtual MovableObject* getMovableObject(const String& name, const String& typeName) const;
3286 virtual bool hasMovableObject(const String& name, const String& typeName) const;
3312 virtual void extractMovableObject(const String& name, const String& typeName);
3326 virtual void extractAllMovableObjectsByType(const String& typeName);
3327
3334 virtual void setVisibilityMask(uint32 vmask) { mVisibilityMask = vmask; }
3335
3339 virtual uint32 getVisibilityMask(void) { return mVisibilityMask; }
3340
3345
3352 virtual void setFindVisibleObjects(bool find) { mFindVisibleObjects = find; }
3353
3357 virtual bool getFindVisibleObjects(void) { return mFindVisibleObjects; }
3358
3367 virtual void setNormaliseNormalsOnScale(bool n) { mNormaliseNormalsOnScale = n; }
3368
3372 virtual bool getNormaliseNormalsOnScale() const { return mNormaliseNormalsOnScale; }
3373
3382 virtual void setFlipCullingOnNegativeScale(bool n) { mFlipCullingOnNegativeScale = n; }
3383
3387 virtual bool getFlipCullingOnNegativeScale() const { return mFlipCullingOnNegativeScale; }
3388
3394 virtual void _injectRenderWithPass(Pass *pass, Renderable *rend, bool shadowDerivation = true,
3395 bool doLightIteration = false, const LightList* manualLightList = 0);
3396
3415 virtual void _suppressRenderStateChanges(bool suppress);
3416
3420 virtual bool _areRenderStateChangesSuppressed(void) const
3421 { return mSuppressRenderStateChanges; }
3422
3435 virtual const Pass* _setPass(const Pass* pass,
3436 bool evenIfSuppressed = false, bool shadowDerivation = true);
3437
3445 virtual void _markGpuParamsDirty(uint16 mask);
3446
3447
3457 virtual void _suppressShadows(bool suppress);
3458
3462 virtual bool _areShadowsSuppressed(void) const
3463 { return mSuppressShadows; }
3464
3470
3487
3490
3491
3496
3499 Viewport* getCurrentViewport(void) const { return mCurrentViewport; }
3500
3503
3505 const VisibleObjectsBoundsInfo& getShadowCasterBoundsInfo(const Light* light, size_t iteration = 0) const;
3506
3521 virtual void setCameraRelativeRendering(bool rel) { mCameraRelativeRendering = rel; }
3522
3526 virtual bool getCameraRelativeRendering() const { return mCameraRelativeRendering; }
3527
3528
3531
3538
3541
3544
3547
3550
3552 };
3553
3557 {
3558 public:
3561
3564 };
3565
3568 {
3569 public:
3572
3575 };
3578 {
3579 public:
3582
3585 };
3588 {
3589 public:
3592
3595 };
3598 {
3599 public:
3602
3605 };
3606
3607
3610
3615 {
3620 ST_INTERIOR = 16
3622
3625 {
3634 };
3635
3636
3637
3640 {
3641 protected:
3643 mutable bool mMetaDataInit;
3645 virtual void initMetaData(void) const = 0;
3646 public:
3647 SceneManagerFactory() : mMetaDataInit(true) {}
3650 virtual const SceneManagerMetaData& getMetaData(void) const
3651 {
3652 if (mMetaDataInit)
3653 {
3654 initMetaData();
3655 mMetaDataInit = false;
3656 }
3657 return mMetaData;
3658 }
3663 virtual SceneManager* createInstance(const String& instanceName) = 0;
3665 virtual void destroyInstance(SceneManager* instance) = 0;
3666
3667 };
3668
3673} // Namespace
3674
3675#include "OgreHeaderSuffix.h"
3676
3677#endif
#define _OgreExport
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Class encapsulating a set of AnimationState objects.
AnimationStateIterator getAnimationStateIterator(void)
Get an iterator over all the animation states in this set.
Represents the state of an animation and the weight of its influence.
An animation sequence.
This utility class is used to hold the information used to generate the matrices and other informatio...
Specialises the SceneQuery class for querying within an axis aligned box.
A 3D box aligned with the x/y/z axes.
Allows the rendering of a chain of connected billboards.
A collection of billboards (faces which are always facing the given direction) with the same (default...
A viewpoint from which the scene will be rendered.
Definition OgreCamera.h:87
Class representing colour.
Chain of compositor effects applying to one viewport.
Concrete IteratorWrapper for const access to the underlying container.
Default implementation of AxisAlignedBoxSceneQuery.
DefaultAxisAlignedBoxSceneQuery(SceneManager *creator)
void execute(SceneQueryListener *listener)
See RayScenQuery.
Default implementation of IntersectionSceneQuery.
DefaultIntersectionSceneQuery(SceneManager *creator)
void execute(IntersectionSceneQueryListener *listener)
See IntersectionSceneQuery.
Default implementation of PlaneBoundedVolumeListSceneQuery.
DefaultPlaneBoundedVolumeListSceneQuery(SceneManager *creator)
void execute(SceneQueryListener *listener)
See SceneQuery.
Default implementation of RaySceneQuery.
DefaultRaySceneQuery(SceneManager *creator)
void execute(RaySceneQueryListener *listener)
See RayScenQuery.
Default implementation of SphereSceneQuery.
DefaultSphereSceneQuery(SceneManager *creator)
void execute(SceneQueryListener *listener)
See SceneQuery.
Defines an instance of a discrete, movable object based on a Mesh.
Definition OgreEntity.h:83
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
Definition OgreFrustum.h:86
Defines a program which runs on the GPU such as a vertex or fragment program.
Shared pointer implementation used to share index buffers.
This is the main starting point for the new instancing system.
Pre-transforms and batches up meshes for efficient use as instanced geometry in a scene.
Alternative listener class for dealing with IntersectionSceneQuery.
Separate SceneQuery class to query for pairs of objects which are possibly intersecting one another.
Representation of a dynamic light source in the scene.
Definition OgreLight.h:74
LightTypes
Defines the type of light.
Definition OgreLight.h:83
A interface class defining a listener which can be used to receive notifications of LOD events.
Class providing a much simplified interface to generating manual objects with custom geometry.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Class encapsulates rendering properties of an object.
Class encapsulating a standard 4x4 homogeneous matrix.
Definition OgreMatrix4.h:79
Abstract class defining a movable object in a scene.
Utility class to generate a sequentially numbered series of names.
Class defining particle system based special effects.
Class defining a single pass of a Technique (of a Material), i.e.
Definition OgrePass.h:81
Specialises the SceneQuery class for querying within a plane-bounded volume.
Defines a plane in 3D space.
Definition OgrePlane.h:62
Implementation of a Quaternion, i.e.
Lowest level collection of renderables.
OrganisationMode
Organisation modes required for this collection.
Visitor interface for items in a QueuedRenderableCollection.
Alternative listener class for dealing with RaySceneQuery.
Specialises the SceneQuery class for querying along a ray.
Representation of a ray in space, i.e.
Definition OgreRay.h:47
Allows the rendering of a simple 2D rectangle This class renders a simple 2D rectangle; this rectangl...
Abstract interface which classes must implement if they wish to receive events from the scene manager...
'New' rendering operation using vertex buffers.
A grouping level underneath RenderQueue which groups renderables to be issued at coarsely the same ti...
Class to hold a linear sequence of RenderQueueInvocation objects.
Abstract interface which classes must implement if they wish to receive events from the render queue.
Class to manage the scene object rendering queue.
Defines the functionality of a 3D API.
Abstract class defining the interface all renderable objects must implement.
Subclass of BillboardChain which automatically leaves a trail behind one or more Node instances.
Class which will create instances of a given SceneManager.
SceneManagerMetaData mMetaData
virtual void destroyInstance(SceneManager *instance)=0
Destroy an instance of a SceneManager.
virtual SceneManager * createInstance(const String &instanceName)=0
Create a new instance of a SceneManager.
virtual void initMetaData(void) const =0
Internal method to initialise the metadata, must be implemented.
virtual const SceneManagerMetaData & getMetaData(void) const
Get information about the SceneManager type created by this factory.
Class that allows listening in on the various stages of SceneManager processing, so that custom behav...
virtual void shadowTextureCasterPreViewProj(Light *light, Camera *camera, size_t iteration)
This event occurs just before the view & projection matrices are set for rendering into a shadow text...
virtual void preFindVisibleObjects(SceneManager *source, IlluminationRenderStage irs, Viewport *v)
Called prior to searching for visible objects in this SceneManager.
virtual bool sortLightsAffectingFrustum(LightList &lightList)
Hook to allow the listener to override the ordering of lights for the entire frustum.
virtual void sceneManagerDestroyed(SceneManager *source)
Event notifying the listener of the SceneManager's destruction.
virtual void shadowTextureReceiverPreViewProj(Light *light, Frustum *frustum)
This event occurs just before the view & projection matrices are set for re-rendering a shadow receiv...
virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
Event raised after all shadow textures have been rendered into for all queues / targets but before an...
virtual void preUpdateSceneGraph(SceneManager *source, Camera *camera)
Called prior to updating the scene graph in this SceneManager.
virtual void postFindVisibleObjects(SceneManager *source, IlluminationRenderStage irs, Viewport *v)
Called after searching for visible objects in this SceneManager.
virtual void postUpdateSceneGraph(SceneManager *source, Camera *camera)
Called after updating the scene graph in this SceneManager.
Inner helper class to implement the visitor pattern for rendering objects in a queue.
void visit(Renderable *r)
Visit method called once per Renderable on a grouped collection.
void visit(RenderablePass *rp)
Called when visiting a RenderablePass, i.e.
SceneManager * targetSceneMgr
Target SM to send renderables to.
bool transparentShadowCastersMode
Are we in transparent shadow caster mode?
const LightList * manualLightList
Manual light list.
const Pass * mUsedPass
Pass that was actually used at the grouping level.
Inner class to use as callback for shadow caster scene query.
void prepare(bool lightInFrustum, const PlaneBoundedVolumeList *lightClipVolumes, const Light *light, const Camera *cam, ShadowCasterList *casterList, Real farDistSquared)
bool queryResult(SceneQuery::WorldFragment *fragment)
Called when a WorldFragment is returned by a query.
bool queryResult(MovableObject *object)
Called when a MovableObject is returned by a query.
Manages the organisation and rendering of a 'scene' i.e.
virtual void setWorldGeometry(DataStreamPtr &stream, const String &typeName=StringUtil::BLANK)
Sets the source of the 'world' geometry, i.e.
virtual AnimationState * getAnimationState(const String &animName) const
Retrieves animation state as previously created using createAnimationState.
virtual void initShadowVolumeMaterials(void)
Internal method for setting up materials for shadows.
virtual void renderVisibleObjectsDefaultSequence(void)
Internal method for rendering all objects using the default queue sequence.
virtual void destroyAllAnimations(void)
Removes all animations created using this SceneManager.
static uint32 USER_TYPE_MASK_LIMIT
User type mask limit.
bool mSuppressShadows
Suppress shadows?
IlluminationRenderStage _getCurrentRenderStage()
CameraIterator getCameraIterator(void)
Returns a specialised MapIterator over all cameras in the scene.
virtual void buildScissor(const Light *l, const Camera *cam, RealRect &rect)
Update a scissor rectangle from a single light.
virtual void setFindVisibleObjects(bool find)
Sets whether the SceneManager should search for visible objects, or whether they are being manually h...
vector< MovableObjectLodChangedEvent >::type MovableObjectLodChangedEventList
List of movable object LOD changed events.
virtual Entity * createEntity(const String &entityName, const MeshPtr &pMesh)
Create an Entity (instance of a discrete mesh).
virtual void renderTextureShadowCasterQueueGroupObjects(RenderQueueGroup *group, QueuedRenderableCollection::OrganisationMode om)
Render a group rendering only shadow casters.
virtual bool getNormaliseNormalsOnScale() const
Get whether to automatically normalise normals on objects whenever they are scaled.
virtual PlaneBoundedVolumeListSceneQuery * createPlaneBoundedVolumeQuery(const PlaneBoundedVolumeList &volumes, uint32 mask=0xFFFFFFFF)
Creates a PlaneBoundedVolumeListSceneQuery for this scene manager.
bool mDisplayNodes
Flag indicating whether SceneNodes will be rendered as a set of 3 axes.
virtual bool hasManualObject(const String &name) const
Returns whether a manual object with the given name exists.
virtual BillboardChain * getBillboardChain(const String &name) const
Retrieves a pointer to the named BillboardChain.
String mShadowTextureCustomCasterFragmentProgram
vector< Listener * >::type ListenerList
virtual void prepareRenderQueue(void)
Internal method for preparing the render queue for use with each render.
virtual void destroyQuery(SceneQuery *query)
Destroys a scene query of any type.
StaticGeometryList mStaticGeometryList
SceneManager(const String &instanceName)
Constructor.
virtual MovableObject * getMovableObject(const String &name, const String &typeName) const
Get a reference to a previously created MovableObject.
virtual void setShadowFarDistance(Real distance)
Sets the default maximum distance away from the camera that shadows will be visible.
Pass * mShadowTextureCustomCasterPass
virtual void setShadowTechnique(ShadowTechnique technique)
Sets the general shadow technique to be used in this scene.
virtual bool getDisplaySceneNodes(void) const
Returns true if all scene nodes axis are to be displayed.
String mName
Instance name.
virtual void setShadowTextureConfig(size_t shadowIndex, const ShadowTextureConfig &config)
Set the detailed configuration for a shadow texture.
ColourValue mAmbientLight
Current ambient light, cached for RenderSystem.
virtual const RealRect & getLightScissorRect(Light *l, const Camera *cam)
Retrieve a scissor rectangle for a given light and camera.
virtual void setSpecialCaseRenderQueueMode(SpecialCaseRenderQueueMode mode)
Sets the way the special case render queue list is processed.
virtual SceneNode * createSceneNodeImpl(void)
Subclasses can override this to ensure their specialised SceneNode is used.
String mShadowTextureCustomCasterVertexProgram
virtual size_t estimateWorldGeometry(const String &filename)
Estimate the number of loading stages required to load the named world geometry.
virtual Real getFogDensity(void) const
Returns the fog density for the scene.
virtual void destroyAllRibbonTrails(void)
Removes & destroys all RibbonTrails from the SceneManager.
virtual bool hasMovableObject(const String &name, const String &typeName) const
Returns whether a movable object instance with the given name exists.
virtual void destroyBillboardChain(const String &name)
Removes & destroys a BillboardChain from the SceneManager.
ManualObject * mSkyBoxObj
virtual 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.
virtual bool hasStaticGeometry(const String &name) const
Returns whether a static geometry instance with the given name exists.
virtual void manualRender(RenderOperation *rend, Pass *pass, Viewport *vp, const Matrix4 &worldMatrix, const Matrix4 &viewMatrix, const Matrix4 &projMatrix, bool doBeginEndFrame=false)
Manual rendering method, for advanced users only.
virtual 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::DEFAULT_RESOURCE_GROUP_NAME)
Enables / disables a 'sky plane' i.e.
virtual SphereSceneQuery * createSphereQuery(const Sphere &sphere, uint32 mask=0xFFFFFFFF)
Creates a SphereSceneQuery for this scene manager.
virtual void destroyInstancedGeometry(InstancedGeometry *geom)
Remove & destroy a InstancedGeometry instance.
virtual void removeRenderQueueListener(RenderQueueListener *delListener)
Removes a listener previously added with addRenderQueueListener.
virtual void destroyAllEntities(void)
Removes & destroys all Entities.
vector< size_t >::type mShadowTextureIndexLightList
Array defining shadow texture index in light list.
virtual BillboardChain * createBillboardChain(const String &name)
Create a BillboardChain, an object which you can use to render a linked chain of billboards.
virtual void extractAllMovableObjectsByType(const String &typeName)
Extract all injected MovableObjects of a given type.
AxisAlignedBoxSceneQuery * mShadowCasterAABBQuery
virtual Entity * createEntity(const String &meshName)
Create an Entity (instance of a discrete mesh) with an autogenerated name.
virtual 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::DEFAULT_RESOURCE_GROUP_NAME)
Enables / disables a 'sky box' i.e.
virtual bool getShadowTextureSelfShadow(void) const
Gets whether or not texture shadows attempt to self-shadow.
virtual BillboardSet * createBillboardSet(const String &name, unsigned int poolSize=20)
Creates a new BillboardSet for use with this scene manager.
virtual SceneNode * getSkyDomeNode(void) const
Get the sky dome node, if enabled.
AnimationStateSet mAnimationStates
virtual void setSkyPlaneEnabled(bool enable)
Enables / disables a 'sky plane'.
virtual const TexturePtr & getShadowTexture(size_t shadowIndex)
Get a reference to the shadow texture currently in use at the given index.
virtual void destroyAnimationState(const String &name)
Destroys an AnimationState.
MapIterator< CameraList > CameraIterator
virtual void setShadowTextureFadeEnd(Real fadeEnd)
Sets the proportional distance at which texture shadows finish to fading out.
AutoTrackingSceneNodes mAutoTrackingSceneNodes
virtual void _updateSceneGraph(Camera *cam)
Internal method for updating the scene graph ie the tree of SceneNode instances managed by this class...
virtual void setShadowTextureSettings(unsigned short size, unsigned short count, PixelFormat fmt=PF_X8R8G8B8, unsigned short fsaa=0, uint16 depthBufferPoolId=1)
Sets the size and count of textures used in texture-based shadows.
void removeLodListener(LodListener *listener)
Remove a level of detail listener.
virtual RibbonTrail * getRibbonTrail(const String &name) const
Retrieves a pointer to the named RibbonTrail.
virtual void useLights(const LightList &lights, unsigned short limit)
void _notifyEntityMaterialLodChanged(EntityMaterialLodChangedEvent &evt)
Notify that an entity material LOD change event has occurred.
LodListenerSet mLodListeners
virtual void _resumeRendering(RenderContext *context)
Resume rendering of the frame.
virtual SceneNode * createSceneNodeImpl(const String &name)
Subclasses can override this to ensure their specialised SceneNode is used.
vector< EntityMaterialLodChangedEvent >::type EntityMaterialLodChangedEventList
List of entity material LOD changed events.
virtual void updateGpuProgramParameters(const Pass *p)
virtual void _renderScene(Camera *camera, Viewport *vp, bool includeOverlays)
Prompts the class to send its contents to the renderer.
virtual bool getShadowUseLightClipPlanes() const
Gets whether when using a built-in additive shadow mode, user clip planes should be used to restrict ...
virtual void removeRenderObjectListener(RenderObjectListener *delListener)
Removes a listener previously added with addRenderObjectListener.
virtual void destroyInstancedEntity(InstancedEntity *instancedEntity)
Removes an InstancedEntity,.
virtual void setFlipCullingOnNegativeScale(bool n)
Set whether to automatically flip the culling mode on objects whenever they are negatively scaled.
void addLodListener(LodListener *listener)
Add a level of detail listener.
virtual void destroyAllInstanceManagers(void)
vector< ShadowCaster * >::type ShadowCasterList
size_t getShadowTextureCount(void) const
Get the number of the textures allocated for texture based shadows.
virtual void destroyAllBillboardChains(void)
Removes & destroys all BillboardChains from the SceneManager.
virtual void checkCachedLightClippingInfo()
bool mShadowTextureSelfShadow
As a proportion e.g. 0.9.
map< String, MovableObject * >::type MovableObjectMap
map< String, Camera * >::type CameraList
virtual bool getOption(const String &strKey, void *pDestValue)
Method for getting the value of an implementation-specific Scene Manager option.
bool mSuppressRenderStateChanges
Suppress render state changes?
virtual const String & getTypeName(void) const =0
Retrieve the type name of this scene manager.
Real mShadowTextureFadeStart
Proportion of texture offset in view direction e.g. 0.4.
virtual void renderTextureShadowReceiverQueueGroupObjects(RenderQueueGroup *group, QueuedRenderableCollection::OrganisationMode om)
Render a group rendering only shadow receivers.
virtual const PlaneList & getLightClippingPlanes(Light *l)
Retrieve a set of clipping planes for a given light.
virtual ParticleSystem * createParticleSystem(const String &name, const String &templateName)
Creates a particle system based on a template.
virtual void destroyMovableObject(MovableObject *m)
Destroys a MovableObject.
Quaternion mSkyDomeOrientation
virtual void setShadowIndexBufferSize(size_t size)
Sets the maximum size of the index buffer used to render shadow primitives.
virtual bool setOption(const String &strKey, const void *pValue)
Method for setting a specific option of the Scene Manager.
ShadowCasterSceneQueryListener * mShadowCasterQueryListener
static uint32 STATICGEOMETRY_TYPE_MASK
Query type mask which will be used for StaticGeometry.
CullingMode mPassCullingMode
virtual bool isShadowTechniqueStencilBased(void) const
Is there a stencil shadow based shadowing technique in use?
virtual ClipResult buildAndSetLightClip(const LightList &ll)
Build a set of user clip planes from a single non-directional light.
virtual void fireShadowTexturesPreReceiver(Light *light, Frustum *f)
Internal method for firing the pre receiver texture shadows event.
AnimationStateIterator getAnimationStateIterator(void)
Returns a specialised MapIterator over all animation states in the scene.
MapIterator< AnimationList > AnimationIterator
set< LodListener * >::type LodListenerSet
Set of registered LOD listeners.
virtual RenderQueue * getRenderQueue(void)
Retrieves the internal render queue, for advanced users only.
virtual void setWorldGeometryRenderQueue(uint8 qid)
Sets the render queue that the world geometry (if any) this SceneManager renders will be associated w...
virtual bool getFindVisibleObjects(void)
Gets whether the SceneManager should search for visible objects, or whether they are being manually h...
virtual void destroyEntity(const String &name)
Removes & destroys an Entity from the SceneManager by name.
virtual Animation * getAnimation(const String &name) const
Looks up an Animation object previously created with createAnimation.
virtual InstanceManager * 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 ...
virtual BillboardChain * createBillboardChain()
Create a BillboardChain, an object which you can use to render a linked chain of billboards,...
virtual void destroyCamera(const String &name)
Removes a camera from the scene.
MapIterator< MovableObjectMap > MovableObjectIterator
virtual void fireSceneManagerDestroyed()
Internal method for firing destruction event.
virtual StaticGeometry * createStaticGeometry(const String &name)
Creates a StaticGeometry instance suitable for use with this SceneManager.
virtual void fireRenderSingleObject(Renderable *rend, const Pass *pass, const AutoParamDataSource *source, const LightList *pLightList, bool suppressRenderStateChanges)
Internal method for firing when rendering a single object.
static uint32 ENTITY_TYPE_MASK
Query type mask which will be used for entities.
set< SceneNode * >::type AutoTrackingSceneNodes
Autotracking scene nodes.
map< String, InstancedGeometry * >::type InstancedGeometryList
virtual void firePreRenderQueues()
Internal method for firing the queue start event.
virtual void removeListener(Listener *s)
Remove a listener.
virtual bool hasParticleSystem(const String &name) const
Returns whether a particle system with the given name exists.
virtual const SkyPlaneGenParameters & getSkyPlaneGenParameters(void) const
Get the parameters used to construct the SkyPlane, if any.
virtual void setDisplaySceneNodes(bool display)
Tells the SceneManager whether it should render the SceneNodes which make up the scene as well as the...
virtual const ColourValue & getShadowColour(void) const
Get the colour used to modulate areas in shadow.
MovableObjectLodChangedEventList mMovableObjectLodChangedEvents
SceneNode * mSceneRoot
Root scene node.
virtual void showBoundingBoxes(bool bShow)
Allows all bounding boxes of scene nodes to be displayed.
const VisibleObjectsBoundsInfo & getVisibleObjectsBoundsInfo(const Camera *cam) const
Returns a visibility boundary box for a specific camera.
virtual bool fireRenderQueueEnded(uint8 id, const String &invocation)
Internal method for firing the queue end event, returns true if queue is to be repeated.
virtual bool hasCamera(const String &name) const
Returns whether a camera with the given name exists.
virtual Real getShadowDirectionalLightExtrusionDistance(void) const
Gets the distance a shadow volume is extruded for a directional light.
SpecialCaseRenderQueueList mSpecialCaseQueueList
virtual Entity * createEntity(const String &entityName, PrefabType ptype)
Create an Entity (instance of a discrete mesh) from a range of prefab shapes.
virtual void setViewport(Viewport *vp)
Internal method for setting the destination viewport for the next render.
map< String, StaticGeometry * >::type StaticGeometryList
virtual bool fireRenderQueueStarted(uint8 id, const String &invocation)
Internal method for firing the queue start event, returns true if queue is to be skipped.
virtual void setNormaliseNormalsOnScale(bool n)
Set whether to automatically normalise normals on objects whenever they are scaled.
virtual 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.
virtual void renderSingleObject(Renderable *rend, const Pass *pass, bool lightScissoringClipping, bool doLightIteration, const LightList *manualLightList=0)
Internal utility method for rendering a single object.
virtual bool isShadowTechniqueInUse(void) const
Is there any shadowing technique in use?
virtual void setSkyDomeEnabled(bool enable)
Enables / disables a 'sky dome'.
IlluminationRenderStage
Describes the stage of rendering when performing complex illumination.
@ IRS_RENDER_TO_TEXTURE
Render to texture stage, used for texture based shadows.
@ IRS_NONE
No special illumination stage.
virtual void setCameraRelativeRendering(bool rel)
Set whether to use camera-relative co-ordinates when rendering, ie to always place the camera at the ...
virtual ManualObject * createManualObject(const String &name)
Create a ManualObject, an object which you populate with geometry manually through a GL immediate-mod...
virtual void destroyInstanceManager(InstanceManager *instanceManager)
RenderQueue * mRenderQueue
Queue of objects for rendering.
virtual bool getCameraRelativeRendering() const
Get whether to use camera-relative co-ordinates when rendering, ie to always place the camera at the ...
virtual InstanceManager * getInstanceManager(const String &managerName) const
Retrieves an existing InstanceManager by it's name.
virtual void destroyInstancedGeometry(const String &name)
Remove & destroy a InstancedGeometry instance.
virtual void destroyStaticGeometry(StaticGeometry *geom)
Remove & destroy a StaticGeometry instance.
virtual bool hasLight(const String &name) const
Returns whether a light with the given name exists.
virtual SceneNode * getSkyBoxNode(void) const
Get the skybox node, if enabled.
virtual bool hasBillboardSet(const String &name) const
Returns whether a billboardset with the given name exists.
virtual void removeSpecialCaseRenderQueue(uint8 qid)
Removes an item to the 'special case' render queue list.
virtual ManualObject * getManualObject(const String &name) const
Retrieves a pointer to the named ManualObject.
virtual void destroyBillboardSet(const String &name)
Removes & destroys an BillboardSet from the SceneManager by name.
ulong _getLightsDirtyCounter(void) const
Advance method to gets the lights dirty counter.
virtual void useLightsGpuProgram(const Pass *pass, const LightList *lights)
virtual void _applySceneAnimations(void)
Internal method for applying animations to scene nodes.
SceneMgrQueuedRenderableVisitor * mActiveQueuedRenderableVisitor
The active renderable visitor class - subclasses could override this.
Pass * mShadowReceiverPass
A pass designed to let us render shadow receivers for texture shadows.
virtual void prepareWorldGeometry(DataStreamPtr &stream, const String &typeName=StringUtil::BLANK)
Sets the source of the 'world' geometry, i.e.
ShadowTextureCameraList mShadowTextureCameras
InstancedGeometryList mInstancedGeometryList
map< constCamera *, VisibleObjectsBoundsInfo >::type CamVisibleObjectsMap
Visible objects bounding box list.
virtual SceneNode * createSceneNode(void)
Creates an instance of a SceneNode.
virtual const SkyDomeGenParameters & getSkyDomeGenParameters(void) const
Get the parameters used to generate the current SkyDome, if any.
map< String, SceneNode * >::type SceneNodeList
InstanceManagerMap mInstanceManagerMap
virtual void prepareWorldGeometry(const String &filename)
Sets the source of the 'world' geometry, i.e.
virtual void renderVisibleObjectsCustomSequence(RenderQueueInvocationSequence *s)
Internal method for rendering all objects using a custom queue sequence.
virtual ParticleSystem * getParticleSystem(const String &name) const
Retrieves a pointer to the named ParticleSystem.
virtual void resetViewProjMode(bool fixedFunction)
Internal method used by _renderSingleObject to deal with renderables which override the camera's own ...
ShadowCamLightMapping mShadowCamLightMapping
virtual void destroyAllBillboardSets(void)
Removes & destroys all BillboardSets.
virtual AutoParamDataSource * createAutoParamDataSource(void) const
Internal method for creating the AutoParamDataSource instance.
virtual void _suppressShadows(bool suppress)
Indicates to the SceneManager whether it should suppress the active shadow rendering technique until ...
HardwareIndexBufferSharedPtr mShadowIndexBuffer
MovableObjectCollection * getMovableObjectCollection(const String &typeName)
Gets the movable object collection for the given type name.
AutoParamDataSource * mAutoParamDataSource
Utility class for calculating automatic parameters for gpu programs.
virtual void firePreFindVisibleObjects(Viewport *v)
Internal method for firing find visible objects event.
virtual MovableObject * createMovableObject(const String &name, const String &typeName, const NameValuePairList *params=0)
Create a movable object of the type specified.
virtual bool isLateMaterialResolving() const
Gets whether using late material resolving or not.
LightList mLightsAffectingFrustum
virtual void destroyAllStaticGeometry(void)
Remove & destroy all StaticGeometry instances.
virtual bool validatePassForRendering(const Pass *pass)
Internal method to validate whether a Pass should be allowed to render.
virtual MeshPtr createSkydomePlane(BoxPlane bp, Real curvature, Real tiling, Real distance, const Quaternion &orientation, int xsegments, int ysegments, int ySegmentsToKeep, const String &groupName)
virtual const Pass * deriveShadowCasterPass(const Pass *pass)
Internal method for turning a regular pass into a shadow caster pass.
virtual void _setActiveCompositorChain(CompositorChain *chain)
Sets the active compositor chain of the current scene being rendered.
vector< LightInfo >::type LightInfoList
virtual void _suppressRenderStateChanges(bool suppress)
Indicates to the SceneManager whether it should suppress changing the RenderSystem states when render...
GpuProgramParametersSharedPtr mShadowTextureCustomReceiverFPParams
TexturePtr mNullShadowTexture
virtual void renderModulativeTextureShadowedQueueGroupObjects(RenderQueueGroup *group, QueuedRenderableCollection::OrganisationMode om)
Render a group with the added complexity of modulative texture shadows.
virtual bool hasAnimation(const String &name) const
Returns whether an animation with the given name exists.
SkyDomeGenParameters mSkyDomeGenParameters
virtual AnimationState * createAnimationState(const String &animName)
Create an AnimationState object for managing application of animations.
SpecialCaseRenderQueueMode
Enumeration of the possible modes allowed for processing the special case render queue list.
@ SCRQM_INCLUDE
Render only the queues in the special case list.
virtual void renderShadowVolumesToStencil(const Light *light, const Camera *cam, bool calcScissor)
Internal method for rendering all the objects for a given light into the stencil buffer.
virtual void addListener(Listener *s)
Add a listener which will get called back on scene manager events.
SkyPlaneGenParameters mSkyPlaneGenParameters
virtual ~SceneManager()
Default destructor.
virtual bool hasOption(const String &strKey) const
Method for verifying whether the scene manager has an implementation-specific option.
virtual void extractMovableObject(const String &name, const String &typeName)
Extract a previously injected MovableObject.
virtual bool hasSceneNode(const String &name) const
Returns whether a scene node with the given name exists.
virtual void destroyRibbonTrail(const String &name)
Removes & destroys a RibbonTrail from the SceneManager.
virtual const LightList & _getLightsAffectingFrustum(void) const
Get the list of lights which could be affecting the frustum.
vector< RenderQueueListener * >::type RenderQueueListenerList
virtual Camera * getCamera(const String &name) const
Retrieves a pointer to the named camera.
void setShadowTextureCountPerLightType(Light::LightTypes type, size_t count)
Set the number of shadow textures a light type uses.
virtual Real getShadowDirLightTextureOffset(void) const
Gets the proportional distance which a texture shadow which is generated from a directional light wil...
virtual ShadowTechnique getShadowTechnique(void) const
Gets the current shadow technique.
virtual void firePostFindVisibleObjects(Viewport *v)
Internal method for firing find visible objects event.
virtual void destroyAllLights(void)
Removes and destroys all lights in the scene.
InstanceManagerVec mDirtyInstanceManagers
void _handleLodEvents()
Handle LOD events.
virtual RaySceneQuery * createRayQuery(const Ray &ray, uint32 mask=0xFFFFFFFF)
Creates a RaySceneQuery for this scene manager.
LightInfoList mTestLightInfos
virtual void setShadowTextureFadeStart(Real fadeStart)
Sets the proportional distance at which texture shadows begin to fade out.
virtual void initRenderQueue(void)
Internal method for initialising the render queue.
virtual Light * createLight()
Creates a light with a generated name.
virtual void destroyManualObject(ManualObject *obj)
Removes & destroys a ManualObject from the SceneManager.
ShadowTextureConfigList mShadowTextureConfigList
virtual void setShadowVolumeStencilState(bool secondpass, bool zfail, bool twosided)
Internal utility method for setting stencil state for rendering shadow volumes.
virtual void setShadowTextureConfig(size_t shadowIndex, unsigned short width, unsigned short height, PixelFormat format, unsigned short fsaa=0, uint16 depthBufferPoolId=1)
Set the detailed configuration for a shadow texture.
virtual void renderBasicQueueGroupObjects(RenderQueueGroup *pGroup, QueuedRenderableCollection::OrganisationMode om)
Render a group in the ordinary way.
virtual const ColourValue & getFogColour(void) const
Returns the fog colour for the scene.
virtual Entity * getEntity(const String &name) const
Retrieves a pointer to the named Entity.
virtual void updateRenderQueueSplitOptions(void)
Update the state of the global render queue splitting based on a shadow option change.
virtual void destroyAnimation(const String &name)
Destroys an Animation.
ShadowTechnique mShadowTechnique
virtual void renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup *group, QueuedRenderableCollection::OrganisationMode om)
Render a group with the added complexity of additive stencil shadows.
virtual void setShadowTextureCount(size_t count)
Set the number of textures allocated for texture-based shadows.
virtual IntersectionSceneQuery * createIntersectionQuery(uint32 mask=0xFFFFFFFF)
Creates an IntersectionSceneQuery for this scene manager.
void setAmbientLight(const ColourValue &colour)
Sets the ambient light level to be used for the scene.
virtual bool getOptionKeys(StringVector &refKeys)
Method for getting all the implementation-specific options of the scene manager.
AnimationList mAnimationsList
virtual 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::DEFAULT_RESOURCE_GROUP_NAME)
Enables / disables a 'sky plane' i.e.
virtual void addSpecialCaseRenderQueue(uint8 qid)
Adds an item to the 'special case' render queue list.
virtual void destroySceneNode(const String &name)
Destroys a SceneNode with a given name.
virtual 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)
virtual bool validateRenderableForRendering(const Pass *pass, const Renderable *rend)
Internal method to validate whether a Renderable should be allowed to render.
RenderSystem * mDestRenderSystem
The rendering system to send the scene to.
virtual BillboardSet * getBillboardSet(const String &name) const
Retrieves a pointer to the named BillboardSet.
virtual Light * createLight(const String &name)
Creates a light for use in the scene.
virtual bool isShadowTechniqueAdditive(void) const
Is there an additive shadowing technique in use?
virtual void _populateLightList(const SceneNode *sn, Real radius, LightList &destList, uint32 lightMask=0xFFFFFFFF)
Populates a light list with an ordered set of the lights which are closest to the position of the Sce...
virtual void setShadowUseLightClipPlanes(bool enabled)
Sets whether when using a built-in additive shadow mode, user clip planes should be used to restrict ...
virtual void firePostUpdateSceneGraph(Camera *camera)
Internal method for firing post update scene graph event.
map< Light *, LightClippingInfo >::type LightClippingInfoMap
virtual CompositorChain * _getActiveCompositorChain() const
Gets the active compositor chain of the current scene being rendered.
virtual void _queueSkiesForRendering(Camera *cam)
Internal method for queueing the sky objects with the params as previously set through setSkyBox,...
virtual FogMode getFogMode(void) const
Returns the fog mode for the scene.
virtual void destroyBillboardSet(BillboardSet *set)
Removes & destroys an BillboardSet from the SceneManager.
virtual void setLateMaterialResolving(bool isLate)
Sets whether to use late material resolving or not.
OGRE_MUTEX(mAnimationsListMutex)
virtual void extractMovableObject(MovableObject *m)
Extract a previously injected MovableObject.
virtual void bindGpuProgram(GpuProgram *prog)
virtual void setShadowTexturePixelFormat(PixelFormat fmt)
Set the pixel format of the textures used for texture-based shadows.
EntityMaterialLodChangedEventList mEntityMaterialLodChangedEvents
virtual void setShadowDirLightTextureOffset(Real offset)
Sets the proportional distance which a texture shadow which is generated from a directional light wil...
virtual void destroyInstanceManager(const String &name)
Destroys an InstanceManager if it was created with createInstanceManager()
MovableObjectCollectionMap mMovableObjectCollectionMap
virtual void destroyAllMovableObjectsByType(const String &typeName)
Destroy all MovableObjects of a given type.
virtual MeshPtr createSkyboxPlane(BoxPlane bp, Real distance, const Quaternion &orientation, const String &groupName)
virtual BillboardSet * createBillboardSet(unsigned int poolSize=20)
Creates a new BillboardSet for use with this scene manager, with a generated name.
const AnimationList & getAnimations() const
Returns a const version of the animation list.
OGRE_MUTEX(mMovableObjectCollectionMapMutex)
Mutex over the collection of MovableObject types.
void _addDirtyInstanceManager(InstanceManager *dirtyManager)
Called by an InstanceManager when it has at least one InstanceBatch that needs their bounds to be upd...
const String & getName(void) const
Return the instance name of this SceneManager.
virtual bool isShadowTechniqueIntegrated(void) const
Is the shadow technique integrated into primary materials?
virtual void setShadowTextureSelfShadow(bool selfShadow)
Sets whether or not texture shadows should attempt to self-shadow.
Pass * mShadowTextureCustomReceiverPass
Real mShadowTextureFadeEnd
As a proportion e.g. 0.6.
virtual void manualRender(Renderable *rend, const Pass *pass, Viewport *vp, const Matrix4 &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.
virtual void renderAdditiveTextureShadowedQueueGroupObjects(RenderQueueGroup *group, QueuedRenderableCollection::OrganisationMode om)
Render a group with additive texture shadows.
virtual void ensureShadowTexturesCreated()
Internal method for creating shadow textures (texture-based shadows)
const VisibleObjectsBoundsInfo & getShadowCasterBoundsInfo(const Light *light, size_t iteration=0) const
Returns the shadow caster AAB for a specific light-camera combination.
RenderSystem * getDestinationRenderSystem()
Get the rendersystem subclass to which the output of this Scene Manager gets sent.
RenderObjectListenerList mRenderObjectListeners
CompositorChain * mActiveCompositorChain
virtual void renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup *group, QueuedRenderableCollection::OrganisationMode om)
Render a group with the added complexity of modulative stencil shadows.
virtual size_t getShadowIndexBufferSize(void) const
Get the size of the shadow index buffer.
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 be...
uint32 _getCombinedVisibilityMask(void) const
Internal method for getting the combination between the global visibility mask and the per-viewport v...
virtual void destroyBillboardChain(BillboardChain *obj)
Removes & destroys a BillboardChain from the SceneManager.
virtual void destroyAllParticleSystems(void)
Removes & destroys all ParticleSystems from the SceneManager.
Quaternion mSkyBoxOrientation
Camera * mCameraInProgress
Camera in progress.
virtual Camera * createCamera(const String &name)
Creates a camera to be managed by this scene manager.
OGRE_MUTEX(sceneGraphMutex)
Mutex to protect the scene graph from simultaneous access from multiple threads.
virtual const Pass * _setPass(const Pass *pass, bool evenIfSuppressed=false, bool shadowDerivation=true)
Internal method for setting up the renderstate for a rendering pass.
virtual void findLightsAffectingFrustum(const Camera *camera)
Internal method for locating a list of lights which could be affecting the frustum.
virtual bool hasRibbonTrail(const String &name) const
Returns whether a ribbon trail with the given name exists.
LightClippingInfoMap mLightClippingInfoMap
virtual void destroyAllCameras(void)
Removes (and destroys) all cameras from the scene.
virtual void setShadowDirectionalLightExtrusionDistance(Real dist)
Sets the distance a shadow volume is extruded for a directional light.
virtual Real getShadowFarDistance(void) const
Gets the default maximum distance away from the camera that shadows will be visible.
virtual void setShadowTextureCasterMaterial(const String &name)
Sets the default material to use for rendering shadow casters.
virtual Entity * createEntity(PrefabType ptype)
Create an Entity (instance of a discrete mesh) from a range of prefab shapes, generating the name.
vector< RenderObjectListener * >::type RenderObjectListenerList
Texture * mCurrentShadowTexture
GpuProgramParametersSharedPtr mInfiniteExtrusionParams
unsigned long mLastFrameNumber
virtual void setShadowUseInfiniteFarPlane(bool enable)
Sets whether we should use an inifinite camera far plane when rendering stencil shadows.
void updateDirtyInstanceManagers(void)
Updates all instance managaers with dirty instance batches.
virtual void _renderVisibleObjects(void)
Sends visible objects found in _findVisibleObjects to the rendering engine.
virtual Real getFogEnd(void) const
Returns the fog end distance for the scene.
virtual void clearScene(void)
Empties the entire scene, inluding all SceneNodes, Entities, Lights, BillboardSets etc.
virtual bool getShowBoundingBoxes() const
Returns if all bounding boxes of scene nodes are to be displayed.
virtual void destroyAllAnimationStates(void)
Removes all animation states created using this SceneManager.
virtual void destroySceneNode(SceneNode *sn)
Destroys a SceneNode.
SceneNodeList mSceneNodes
Central list of SceneNodes - for easy memory management.
map< constCamera *, constLight * >::type ShadowCamLightMapping
ShadowCamera to light mapping.
virtual bool _areShadowsSuppressed(void) const
Are shadows suppressed?
virtual 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::DEFAULT_RESOURCE_GROUP_NAME)
Enables / disables a 'sky dome' i.e.
virtual bool getShowDebugShadows(void) const
Are debug shadows shown?
CameraList mCameras
Central list of cameras - for easy memory management and lookup.
map< String, InstanceManager * >::type InstanceManagerMap
virtual const SkyBoxGenParameters & getSkyBoxGenParameters(void) const
Get the parameters used to generate the current SkyBox, if any.
vector< Camera * >::type ShadowTextureCameraList
void renderShadowVolumeObjects(ShadowCaster::ShadowRenderableListIterator iShadowRenderables, Pass *pass, const LightList *manualLightList, unsigned long flags, bool secondpass, bool zfail, bool twosided)
Render a set of shadow renderables.
virtual bool isShadowTechniqueModulative(void) const
Is there a modulative shadowing technique in use?
Pass * mShadowCasterPlainBlackPass
A pass designed to let us render shadow colour on white for texture shadows.
virtual Real getShadowFarDistanceSquared(void) const
virtual void _notifyAutotrackingSceneNode(SceneNode *node, bool autoTrack)
Internal method for notifying the manager that a SceneNode is autotracking.
virtual void destroyEntity(Entity *ent)
Removes & destroys an Entity from the SceneManager.
virtual void setShadowCasterRenderBackFaces(bool bf)
Sets whether or not shadow casters should be rendered into shadow textures using their back faces rat...
virtual void _setDestinationRenderSystem(RenderSystem *sys)
Notifies the scene manager of its destination render system.
AnimationIterator getAnimationIterator(void)
Returns a specialised MapIterator over all animations in the scene.
virtual void destroyAllManualObjects(void)
Removes & destroys all ManualObjects from the SceneManager.
NameGenerator mMovableNameGenerator
PrefabType
Prefab shapes available without loading a model.
virtual void updateRenderQueueGroupSplitOptions(RenderQueueGroup *group, bool suppressShadows, bool suppressRenderState)
Update the state of the render queue group splitting based on a shadow option change.
virtual void setViewMatrix(const Matrix4 &m)
vector< InstanceManager * >::type InstanceManagerVec
String mShadowTextureCustomReceiverFragmentProgram
virtual void addRenderObjectListener(RenderObjectListener *newListener)
Registers a new Render Object Listener which will be notified when rendering an object.
map< String, MovableObjectCollection * >::type MovableObjectCollectionMap
virtual bool hasBillboardChain(const String &name) const
Returns whether a billboard chain with the given name exists.
const CameraList & getCameras() const
Returns a const version of the camera list.
void setFog(FogMode mode=FOG_NONE, const ColourValue &colour=ColourValue::White, Real expDensity=0.001, Real linearStart=0.0, Real linearEnd=1.0)
Sets the fogging mode applied to the scene.
virtual ManualObject * createManualObject()
Create a ManualObject, an object which you populate with geometry manually through a GL immediate-mod...
virtual ClipResult buildAndSetScissor(const LightList &ll, const Camera *cam)
Set up a scissor rectangle from a group of lights.
GpuProgramParametersSharedPtr mFiniteExtrusionParams
virtual void buildLightClip(const Light *l, PlaneList &planes)
map< String, Animation * >::type AnimationList
Storage of animations, lookup by name.
CamVisibleObjectsMap mCamVisibleObjectsMap
virtual SceneNode * getSkyPlaneNode(void) const
Get the sky plane node, if enabled.
virtual void destroyParticleSystem(const String &name)
Removes & destroys a ParticleSystem from the SceneManager.
virtual Entity * createEntity(const String &entityName, const String &meshName, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
Create an Entity (instance of a discrete mesh).
virtual uint32 getVisibilityMask(void)
Gets a mask which is bitwise 'and'ed with objects own visibility masks to determine if the object is ...
virtual void _findVisibleObjects(Camera *cam, VisibleObjectsBoundsInfo *visibleBounds, bool onlyShadowCasters)
Internal method which parses the scene to find visible objects to render.
uint16 mGpuParamsDirty
Gpu params that need rebinding (mask of GpuParamVariability)
virtual void destroyParticleSystem(ParticleSystem *obj)
Removes & destroys a ParticleSystem from the SceneManager.
virtual bool isRenderQueueToBeProcessed(uint8 qid)
Returns whether or not the named queue will be rendered based on the current 'special case' render qu...
virtual void destroyAllInstancedGeometry(void)
Remove & destroy all InstancedGeometry instances.
virtual InstancedGeometry * getInstancedGeometry(const String &name) const
Retrieve a previously created InstancedGeometry instance.
virtual Animation * createAnimation(const String &name, Real length)
Creates an animation which can be used to animate scene nodes.
const ColourValue & getAmbientLight(void) const
Returns the ambient light level to be used for the scene.
InstanceManagerVec mDirtyInstanceMgrsTmp
virtual bool isSkyDomeEnabled(void) const
Return whether a skydome is enabled.
static uint32 FX_TYPE_MASK
Query type mask which will be used for effects like billboardsets / particle systems.
uint32 mLastLightHash
Last light sets.
SpecialCaseRenderQueueMode mSpecialCaseQueueMode
virtual bool isShadowTechniqueTextureBased(void) const
Is there a texture shadow based shadowing technique in use?
set< uint8 >::type SpecialCaseRenderQueueList
vector< EntityMeshLodChangedEvent >::type EntityMeshLodChangedEventList
List of entity mesh LOD changed events.
virtual void setShadowTextureSize(unsigned short size)
Set the size of the texture used for all texture-based shadows.
GpuProgramParametersSharedPtr mShadowTextureCustomCasterFPParams
virtual void _markGpuParamsDirty(uint16 mask)
Method to allow you to mark gpu parameters as dirty, causing them to be updated according to the mask...
virtual void resetLightClip()
unsigned long mLightClippingInfoMapFrameNumber
virtual bool getFlipCullingOnNegativeScale() const
Get whether to automatically flip the culling mode on objects whenever they are negatively scaled.
virtual bool hasInstanceManager(const String &managerName) const
Returns whether an InstanceManager with the given name exists.
virtual void destroyMovableObject(const String &name, const String &typeName)
Destroys a MovableObject with the name specified, of the type specified.
virtual void destroyCamera(Camera *cam)
Removes a camera from the scene.
String mShadowTextureCustomReceiverVertexProgram
virtual void setWorldGeometry(const String &filename)
Sets the source of the 'world' geometry, i.e.
virtual void destroyLight(Light *light)
Removes the light from the scene and destroys it based on a pointer.
virtual bool isSkyPlaneEnabled(void) const
Return whether a key plane is enabled.
virtual void firePostRenderQueues()
Internal method for firing the queue end event.
virtual void clearSpecialCaseRenderQueues(void)
Clears the 'special case' render queue list.
void _notifyEntityMeshLodChanged(EntityMeshLodChangedEvent &evt)
Notify that an entity mesh LOD change event has occurred.
RenderQueueListenerList mRenderQueueListeners
virtual void fireShadowTexturesPreCaster(Light *light, Camera *camera, size_t iteration)
Internal method for firing the pre caster texture shadows event.
Viewport * mCurrentViewport
Current Viewport.
virtual void destroyManualObject(const String &name)
Removes & destroys a ManualObject from the SceneManager.
virtual RenderContext * _pauseRendering()
Pause rendering of the frame.
virtual StaticGeometry * getStaticGeometry(const String &name) const
Retrieve a previously created StaticGeometry instance.
virtual RibbonTrail * createRibbonTrail()
Create a RibbonTrail, an object which you can use to render a linked chain of billboards which follow...
virtual void setShadowTextureFSAA(unsigned short fsaa)
Set the level of multisample AA of the textures used for texture-based shadows.
unsigned short mLastLightLimit
virtual void fireShadowTexturesUpdated(size_t numberOfShadowTextures)
Internal method for firing the texture shadows updated event.
virtual InstancedEntity * createInstancedEntity(const String &materialName, const String &managerName)
Creates an InstancedEntity based on an existing InstanceManager (.
virtual void setShadowColour(const ColourValue &colour)
Set the colour used to modulate areas in shadow.
virtual void setSkyBoxEnabled(bool enable)
Enables / disables a 'sky box'.
LightInfoList mCachedLightInfos
static uint32 WORLD_GEOMETRY_TYPE_MASK
Query type mask which will be used for world geometry.
virtual void setShadowCameraSetup(const ShadowCameraSetupPtr &shadowSetup)
Set the shadow camera setup to use for all lights which don't have their own shadow camera setup.
bool mCameraRelativeRendering
Whether to use camera-relative rendering.
GpuProgramParametersSharedPtr mShadowTextureCustomCasterVPParams
virtual Real getFogStart(void) const
Returns the fog start distance for the scene.
virtual ParticleSystem * createParticleSystem(const String &name, size_t quota=500, const String &resourceGroup=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
Create a blank particle system.
Rectangle2D * mFullScreenQuad
virtual ViewPoint getSuggestedViewpoint(bool random=false)
Asks the SceneManager to provide a suggested viewpoint from which the scene should be viewed.
virtual 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::DEFAULT_RESOURCE_GROUP_NAME)
Enables / disables a 'sky dome' i.e.
EntityMeshLodChangedEventList mEntityMeshLodChangedEvents
virtual void setShadowTextureReceiverMaterial(const String &name)
Sets the default material to use for rendering shadow receivers.
static uint32 FRUSTUM_TYPE_MASK
Query type mask which will be used for frusta and cameras.
virtual InstancedGeometry * createInstancedGeometry(const String &name)
Creates a InstancedGeometry instance suitable for use with this SceneManager.
GpuProgramParametersSharedPtr mShadowTextureCustomReceiverVPParams
virtual bool getOptionValues(const String &strKey, StringVector &refValueList)
Method for getting all possible values for a specific option.
virtual void setShowDebugShadows(bool debug)
Enables / disables the rendering of debug information for shadows.
virtual AxisAlignedBoxSceneQuery * createAABBQuery(const AxisAlignedBox &box, uint32 mask=0xFFFFFFFF)
Creates an AxisAlignedBoxSceneQuery for this scene manager.
void _notifyMovableObjectLodChanged(MovableObjectLodChangedEvent &evt)
Notify that a movable object LOD change event has occurred.
virtual SceneNode * getRootSceneNode(void)
Gets the SceneNode at the root of the scene hierarchy.
virtual void destroyStaticGeometry(const String &name)
Remove & destroy a StaticGeometry instance.
virtual void renderTransparentShadowCasterObjects(const QueuedRenderableCollection &objs, QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping, bool doLightIteration, const LightList *manualLightList=0)
Render those objects in the transparent pass list which have shadow casting forced on.
virtual void addRenderQueueListener(RenderQueueListener *newListener)
Registers a new RenderQueueListener which will be notified when render queues are processed.
ShadowCasterList mShadowCasterList
virtual void _renderQueueGroupObjects(RenderQueueGroup *group, QueuedRenderableCollection::OrganisationMode om)
Render the objects in a given queue group.
virtual void resetScissor()
virtual bool isSkyBoxEnabled(void) const
Return whether a skybox is enabled.
virtual void renderObjects(const QueuedRenderableCollection &objs, QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping, bool doLightIteration, const LightList *manualLightList=0)
Render a set of objects, see renderSingleObject for param definitions.
static uint32 LIGHT_TYPE_MASK
Query type mask which will be used for lights.
virtual const ShadowCameraSetupPtr & getShadowCameraSetup() const
Get the shadow camera setup in use for all lights which don't have their own shadow camera setup.
virtual void _notifyLightsDirty(void)
Advance method to increase the lights dirty counter due lights changed.
ConstShadowTextureConfigIterator getShadowTextureConfigIterator() const
Get an iterator over the current shadow texture settings.
bool mShowBoundingBoxes
Flag that indicates if all of the scene node's bounding boxes should be shown as a wireframe.
virtual SceneNode * getSceneNode(const String &name) const
Retrieves a named SceneNode from the scene graph.
virtual SpecialCaseRenderQueueMode getSpecialCaseRenderQueueMode(void)
Gets the way the special case render queue list is processed.
ShadowCameraSetupPtr mDefaultShadowCameraSetup
default shadow camera setup
SceneMgrQueuedRenderableVisitor mDefaultQueuedRenderableVisitor
Storage for default renderable visitor.
virtual MovableObject * createMovableObject(const String &typeName, const NameValuePairList *params=0)
Create a movable object of the type specified without a name.
virtual const ShadowCasterList & findShadowCastersForLight(const Light *light, const Camera *camera)
Internal method for locating a list of shadow casters which could be affecting the frustum for a give...
virtual void destroyShadowTextures(void)
Internal method for destroying shadow textures (texture-based shadows)
ShadowTextureList mShadowTextures
virtual size_t estimateWorldGeometry(DataStreamPtr &stream, const String &typeName=StringUtil::BLANK)
Estimate the number of loading stages required to load the named world geometry.
virtual void setVisibilityMask(uint32 vmask)
Sets a mask which is bitwise 'and'ed with objects own visibility masks to determine if the object is ...
virtual bool getShadowCasterRenderBackFaces() const
Gets whether or not shadow casters should be rendered into shadow textures using their back faces rat...
virtual void destroyLight(const String &name)
Removes the named light from the scene and destroys it.
virtual uint8 getWorldGeometryRenderQueue(void)
Gets the render queue that the world geometry (if any) this SceneManager renders will be associated w...
SphereSceneQuery * mShadowCasterSphereQuery
virtual void injectMovableObject(MovableObject *m)
Inject a MovableObject instance created externally.
virtual MovableObjectIterator getMovableObjectIterator(const String &typeName)
Get an iterator over all MovableObect instances of a given type.
virtual Entity * createEntity(const MeshPtr &pMesh)
Create an Entity (instance of a discrete mesh) with an autogenerated name.
uint32 mVisibilityMask
Visibility mask used to show / hide objects.
virtual void useRenderableViewProjMode(const Renderable *pRend, bool fixedFunction)
Internal method used by _renderSingleObject to deal with renderables which override the camera's own ...
virtual void setSkyBox(bool enable, const String &materialName, Real distance=5000, bool drawFirst=true, const Quaternion &orientation=Quaternion::IDENTITY, const String &groupName=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
Enables / disables a 'sky box' i.e.
void setQueuedRenderableVisitor(SceneMgrQueuedRenderableVisitor *visitor)
Advanced method for supplying an alternative visitor, used for parsing the render queues and sending ...
virtual SceneNode * createSceneNode(const String &name)
Creates an instance of a SceneNode with a given name.
Viewport * getCurrentViewport(void) const
Gets the current viewport being rendered (advanced use only, only valid during viewport update.
size_t getShadowTextureCountPerLightType(Light::LightTypes type) const
Get the number of shadow textures is assigned for the given light type.
const MovableObjectCollection * getMovableObjectCollection(const String &typeName) const
Gets the movable object collection for the given type name.
virtual bool _areRenderStateChangesSuppressed(void) const
Are render state changes suppressed?
virtual void destroyAllMovableObjects(void)
Destroy all MovableObjects.
virtual void destroyRibbonTrail(RibbonTrail *obj)
Removes & destroys a RibbonTrail from the SceneManager.
virtual const Pass * deriveShadowReceiverPass(const Pass *pass)
Internal method for turning a regular pass into a shadow receiver pass.
virtual bool hasEntity(const String &name) const
Returns whether an entity with the given name exists.
virtual ParticleSystem * createParticleSystem(size_t quota=500, const String &resourceGroup=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
Create a blank particle system with a generated name.
SceneMgrQueuedRenderableVisitor * getQueuedRenderableVisitor(void) const
Gets the current visitor object which processes queued renderables.
SkyBoxGenParameters mSkyBoxGenParameters
virtual RibbonTrail * createRibbonTrail(const String &name)
Create a RibbonTrail, an object which you can use to render a linked chain of billboards which follow...
IlluminationRenderStage mIlluminationStage
LightList mShadowTextureCurrentCasterLightList
virtual void firePreUpdateSceneGraph(Camera *camera)
Internal method for firing pre update scene graph event.
virtual bool hasAnimationState(const String &name) const
Returns whether an animation state with the given name exists.
virtual Light * getLight(const String &name) const
Returns a pointer to the named Light which has previously been added to the scene.
Class representing a node in the scene graph.
This optional class allows you to receive per-result callbacks from SceneQuery executions instead of ...
A class for performing queries on a scene.
Specialises the SceneQuery class for querying within a sphere.
A sphere primitive, mostly used for bounds checking.
Definition OgreSphere.h:52
Pre-transforms and batches up meshes for efficient use as static geometry in a scene.
Abstract class representing a Texture resource.
Standard 3-dimensional vector.
Definition OgreVector3.h:52
Concrete IteratorWrapper for nonconst access to the underlying container.
An abstraction of a viewport, i.e.
vector< String >::type StringVector
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition OgreCommon.h:550
ClipResult
Generic result of clipping.
Definition OgreCommon.h:741
ShadowTechnique
An enumeration of broad shadow techniques.
Definition OgreCommon.h:191
FogMode
Fog modes.
Definition OgreCommon.h:122
CullingMode
Hardware culling modes based on vertex winding.
Definition OgreCommon.h:136
@ SHADOWDETAILTYPE_TEXTURE
Mask for texture shadows (not for direct use, use SHADOWTYPE_ enum instead)
Definition OgreCommon.h:208
@ SHADOWDETAILTYPE_ADDITIVE
Mask for additive shadows (not for direct use, use SHADOWTYPE_ enum instead)
Definition OgreCommon.h:196
@ SHADOWDETAILTYPE_MODULATIVE
Mask for modulative shadows (not for direct use, use SHADOWTYPE_ enum instead)
Definition OgreCommon.h:199
@ SHADOWDETAILTYPE_STENCIL
Mask for stencil shadows (not for direct use, use SHADOWTYPE_ enum instead)
Definition OgreCommon.h:205
@ SHADOWDETAILTYPE_INTEGRATED
Mask for integrated shadows (not for direct use, use SHADOWTYPE_ enum instead)
Definition OgreCommon.h:202
@ SHADOWTYPE_NONE
No shadows.
Definition OgreCommon.h:193
PixelFormat
The pixel format used for images, textures, and render surfaces.
vector< PlaneBoundedVolume >::type PlaneBoundedVolumeList
vector< Plane >::type PlaneList
Definition OgrePlane.h:160
#define OGRE_NEW
vector< ShadowTextureConfig >::type ShadowTextureConfigList
SceneType
Classification of a scene to allow a decision of what type of SceenManager to provide back to the app...
vector< TexturePtr >::type ShadowTextureList
uint16 SceneTypeMask
Bitmask containing scene types.
@ ST_EXTERIOR_REAL_FAR
unsigned char uint8
unsigned long ulong
float Real
Software floating point type.
unsigned short uint16
unsigned int uint32
_StringBase String
Struct containing information about a material LOD change event for entities.
Struct containing information about a mesh LOD change event for entities.
Struct containing information about a LOD change event for movable objects.
Struct associating a single Pass with a single Renderable.
Structure containing information about a scene manager.
SceneTypeMask sceneTypeMask
A mask describing which sorts of scenes this manager can handle.
bool worldGeometrySupported
Flag indicating whether world geometry is supported.
String description
A text description of the scene manager.
String typeName
A globally unique string identifying the scene manager type.
Struct for caching light clipping information for re-use in a frame.
Cached light information, used to tracking light's changes.
int type
Just a pointer for comparison, the light might destroyed for some reason.
uint32 lightMask
Sets to zero if directional light.
Vector3 position
Sets to zero if directional light.
Real range
Use int instead of Light::LightTypes to avoid header file dependence.
Simple structure to hold MovableObject map and a mutex to go with it.
RenderSystem::RenderSystemContext * rsContext
Comparator for sorting lights relative to a point.
_OgreExport bool operator()(const Light *a, const Light *b) const
Default sorting routine which sorts lights which cast shadows to the front of a list,...
_OgreExport bool operator()(const Light *l1, const Light *l2) const
Comparator for material map, for sorting materials into render order (e.g.
_OgreExport bool operator()(const Material *x, const Material *y) const
Represents part of the world geometry that is a result of a SceneQuery.
Structure containing the configuration for one shadow texture.
Structure for holding a position & orientation pair.
Quaternion orientation
Structure collecting together information about the visible objects that have been discovered in a sc...
void merge(const AxisAlignedBox &boxBounds, const Sphere &sphereBounds, const Camera *cam, bool receiver=true)
Real maxDistance
The farthest a visible objects is from the camera.
void mergeNonRenderedButInFrustum(const AxisAlignedBox &boxBounds, const Sphere &sphereBounds, const Camera *cam)
Merge an object that is not being rendered because it's not a shadow caster, but is a shadow receiver...
AxisAlignedBox receiverAabb
The axis-aligned bounds of the visible shadow receiver objects.
Real maxDistanceInFrustum
The farthest object in the frustum regardless of visibility / shadow caster flags.
AxisAlignedBox aabb
The axis-aligned bounds of the visible objects.
Real minDistance
The closest a visible object is to the camera.
Real minDistanceInFrustum
The closest a object in the frustum regardless of visibility / shadow caster flags.
std::map< K, V, P, A > type
std::set< T, P, A > type
std::vector< T, A > type