OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreSceneManager.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2 This source file is a part of OGRE
3 (Object-oriented Graphics Rendering Engine)
4 
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14 
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17 
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 THE SOFTWARE
25 
26 You may alternatively use this source under the terms of a specific version of
27 the OGRE Unrestricted License provided you have obtained such a license from
28 Torus Knot Software Ltd.
29 -------------------------------------------------------------------------*/
30 #ifndef __SceneManager_H__
31 #define __SceneManager_H__
32 
33 // Precompiler options
34 #include "OgrePrerequisites.h"
35 
36 #include "OgrePlane.h"
37 #include "OgreQuaternion.h"
38 #include "OgreColourValue.h"
39 #include "OgreCommon.h"
40 #include "OgreSceneQuery.h"
42 #include "OgreAnimationState.h"
43 #include "OgreRenderQueue.h"
47 #include "OgreInstanceManager.h"
48 #include "OgreRenderSystem.h"
49 #include "OgreLodListener.h"
53 #include "Threading/OgreThreads.h"
54 #include "OgreHeaderPrefix.h"
55 
56 namespace Ogre {
65  struct ViewPoint
66  {
69  };
70 
127  {
130  };
131 
133 
134  // Forward declarations
136  class DefaultRaySceneQuery;
139  class Rectangle2D;
140  class LodListener;
144  class CompositorChain;
145  class CompositorShadowNode;
146  class UniformScalableTask;
147 
150  {
162  Camera const *camera;
165 
167  firstRq( 0 ), lastRq( 0 ), objectMemManager( 0 ), camera( 0 ), lodCamera( 0 )
168  {
169  }
170  CullFrustumRequest( uint8 _firstRq, uint8 _lastRq,
171  const ObjectMemoryManagerVec *_objectMemManager,
172  const Camera *_camera, const Camera *_lodCamera ) :
173  firstRq( _firstRq ), lastRq( _lastRq ),
174  objectMemManager( _objectMemManager ), camera( _camera ),
175  lodCamera( _lodCamera )
176  {
177  }
178  };
179 
181  {
183 
186  {
187  }
188  UpdateLodRequest( uint8 _firstRq, uint8 _lastRq,
189  const ObjectMemoryManagerVec *_objectMemManager,
190  const Camera *_camera, const Camera *_lodCamera, Real _lodBias ) :
191  CullFrustumRequest( _firstRq, _lastRq, _objectMemManager, _camera, _lodCamera ),
192  lodBias( _lodBias )
193  {
194  }
195  };
196 
198  {
203 
205  numNodesPerThread( 0 ), numTotalNodes( 0 ) {}
206 
207  UpdateTransformRequest( const Transform &_t, size_t _numNodesPerThread, size_t _numTotalNodes ) :
208  t( _t ), numNodesPerThread( _numNodesPerThread ), numTotalNodes( _numTotalNodes )
209  {
210  }
211  };
212 
214  {
215  Frustum const *frustum;
219  InstanceBatchCullRequest( const Frustum *_frustum, const Camera *_lodCamera,
220  uint32 _combinedVisibilityFlags ) :
221  frustum( _frustum ), lodCamera( _lodCamera ),
222  combinedVisibilityFlags( _combinedVisibilityFlags )
223  {
224  }
225  };
226 
257  {
258  public:
269 
272  {
276  IRS_RENDER_TO_TEXTURE
277  };
278 
284  {
288  SCRQM_EXCLUDE
289  };
290 
292  {
299  };
300 
302  {
308  };
309 
311  {
313  };
314 
318  class Listener
319  {
320  public:
321  Listener() {}
322  virtual ~Listener() {}
323 
333  virtual void preFindVisibleObjects(SceneManager* source,
335  { (void)source; (void)irs; (void)v; }
336 
347  virtual void postFindVisibleObjects(SceneManager* source,
349  { (void)source; (void)irs; (void)v; }
350 
364  virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
365  { (void)numberOfShadowTextures; }
366 
380  virtual void shadowTextureCasterPreViewProj( const Light* light,
381  Camera* camera, size_t iteration)
382  { (void)light; (void)camera; (void)iteration; }
383 
406  virtual bool sortLightsAffectingFrustum(LightList& lightList)
407  { (void)lightList; return false; }
408 
410  virtual void sceneManagerDestroyed(SceneManager* source)
411  { (void)source; }
412  };
413 
418  {
419  protected:
421  const Pass* mUsedPass;
422  public:
424  :transparentShadowCastersMode(false) {}
426  void visit(Renderable* r);
427  bool visit(const Pass* p);
428  void visit(RenderablePass* rp);
429 
438 
439  };
442 
443  protected:
445  virtual SceneNode* createSceneNodeImpl( SceneNode *parent, SceneMemoryMgrTypes sceneType );
446 
450 
469 
477 
482 
485 
489 
492 
495 
498 
501 
508 
511 
514 
516 
525 
530 
532 
535 
538  {
545 
547  const Vector3 &_offset, const Vector3 &_localDirection ) :
548  source( _source ), target( _target ),
549  offset( _offset ), localDirection( _localDirection )
550  {
551  }
552  };
553 
556 
557  // Sky params
558  // Sky plane
560  Entity* mSkyDomeEntity[5];
562 
566 
567  // Sky plane
571  // Sky box
575  // Sky dome
579 
580  // Fog
586 
591 
592  unsigned long mLastFrameNumber;
593  OGRE_SIMD_ALIGNED_DECL( Matrix4, mTempXform[256] );
596 
600 
601  protected:
604 
607  {
609  int type;
613 
614  bool operator== (const LightInfo& rhs) const
615  {
616  return light == rhs.light && type == rhs.type &&
617  range == rhs.range && position == rhs.position && lightMask == rhs.lightMask;
618  }
619 
620  bool operator!= (const LightInfo& rhs) const
621  {
622  return !(*this == rhs);
623  }
624  };
625 
627 
631  {
633  OGRE_MUTEX(mutex);
634  };
641  MovableObjectCollection* getMovableObjectCollection(const String& typeName);
646  const MovableObjectCollection* getMovableObjectCollection(const String& typeName) const;
648  OGRE_MUTEX(mMovableObjectCollectionMapMutex);
649 
654  virtual void initRenderQueue(void);
666  virtual_l2 const Pass* deriveShadowCasterPass(const Pass* pass);
667 
674  virtual_l2 bool validatePassForRendering(const Pass* pass);
675 
676  enum BoxPlane
677  {
678  BP_FRONT = 0,
679  BP_BACK = 1,
680  BP_LEFT = 2,
681  BP_RIGHT = 3,
682  BP_UP = 4,
683  BP_DOWN = 5
684  };
685 
686  /* Internal utility method for creating the planes of a skybox.
687  */
688  virtual MeshPtr createSkyboxPlane(
689  BoxPlane bp,
690  Real distance,
691  const Quaternion& orientation,
692  const String& groupName);
693 
694  /* Internal utility method for creating the planes of a skydome.
695  */
696  virtual MeshPtr createSkydomePlane(
697  BoxPlane bp,
698  Real curvature, Real tiling, Real distance,
699  const Quaternion& orientation,
700  int xsegments, int ysegments, int ySegmentsToKeep,
701  const String& groupName);
702 
705 
709  OGRE_MUTEX(mAnimationsListMutex);
711 
712 
715  virtual void useRenderableViewProjMode(const Renderable* pRend, bool fixedFunction);
716 
719  virtual void resetViewProjMode(bool fixedFunction);
720 
723 
729  virtual void firePreRenderQueues();
731  virtual void firePostRenderQueues();
733  virtual bool fireRenderQueueStarted(uint8 id, const String& invocation);
735  virtual bool fireRenderQueueEnded(uint8 id, const String& invocation);
737  virtual void fireRenderSingleObject(Renderable* rend, const Pass* pass,
738  const AutoParamDataSource* source,
739  const LightList* pLightList,
740  bool suppressRenderStateChanges);
741 
743  virtual void fireShadowTexturesUpdated(size_t numberOfShadowTextures);
745  virtual void fireShadowTexturesPreCaster(const Light* light, Camera* camera, size_t iteration);
747  virtual void firePreFindVisibleObjects(Viewport* v);
749  virtual void firePostFindVisibleObjects(Viewport* v);
751  virtual void fireSceneManagerDestroyed();
753  virtual void setViewport(Viewport *vp);
754 
757 
759  virtual void renderVisibleObjectsDefaultSequence(void);
761  virtual void renderVisibleObjectsCustomSequence(RenderQueueInvocationSequence* s);
763  virtual void prepareRenderQueue(void);
764 
765 
781  virtual_l1 void renderSingleObject(Renderable* rend, const Pass* pass,
782  bool lightScissoringClipping, bool doLightIteration);
783 
786  {
787  return OGRE_NEW AutoParamDataSource();
788  }
789 
792 
793  CompositorChain* mActiveCompositorChain;
795 
805  {
809  unsigned long clipPlanesValid;
810  LightClippingInfo() : scissorValid(false), clipPlanesValid(false) {}
811 
812  };
816 
828  template<typename T>
829  void checkMovableObjectIntegrity( const typename vector<T*>::type &container,
830  const T *mo ) const;
831 
832 #ifdef OGRE_LEGACY_ANIMATIONS
833  void updateInstanceManagerAnimations(void);
835 #endif
836 
839  void updateInstanceManagersThread( size_t threadIdx );
840 
842  void updateInstanceManagers(void);
843 
855  virtual void highLevelCull();
856 
865  void propagateRelativeOrigin( SceneNode *sceneNode, const Vector3 &relativeOrigin );
866 
867  public:
868 
869  //A render context, used to store internal data for pausing/resuming rendering
871  {
875  CompositorChain* activeChain;
877  };
878 
880 
882  {
885 
886  CompositorTexture( IdString _name, const TextureVec *_textures ) :
887  name( _name ), textures( _textures ) {}
888 
889  bool operator == ( IdString right ) const
890  {
891  return name == right;
892  }
893  };
894 
898  virtual RenderContext* _pauseRendering();
902  virtual void _resumeRendering(RenderContext* context);
903 
904  protected:
915 
918 
922 
924  {
933  NUM_REQUESTS
934  };
935 
937 
938  volatile bool mExitWorkerThreads;
949 
957 
960 
968 
971 
975  virtual_l1 void renderBasicQueueGroupObjects(RenderQueueGroup* pGroup,
978  virtual_l1 void renderTextureShadowCasterQueueGroupObjects(RenderQueueGroup* group,
980 
982  virtual_l1 void renderObjects(const QueuedRenderableCollection& objs,
983  QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping,
984  bool doLightIteration);
990  virtual_l1 void renderTransparentShadowCasterObjects(const QueuedRenderableCollection& objs,
991  QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping,
992  bool doLightIteration);
993 
995  virtual ClipResult buildAndSetScissor(const LightList& ll, const Camera* cam);
997  virtual void buildScissor(const Light* l, const Camera* cam, RealRect& rect);
998  virtual void resetScissor();
1000  virtual ClipResult buildAndSetLightClip(const LightList& ll);
1001  virtual void buildLightClip(const Light* l, PlaneList& planes);
1002  virtual void resetLightClip();
1003  virtual void checkCachedLightClippingInfo();
1004 
1009 
1013 
1016  unsigned short mLastLightLimit;
1020 
1021  virtual void useLights(const LightList& lights, unsigned short limit);
1022  virtual void setViewMatrix(const Matrix4& m);
1023  virtual void useLightsGpuProgram(const Pass* pass, const LightList* lights);
1024  virtual void bindGpuProgram(GpuProgram* prog);
1025  virtual void updateGpuProgramParameters(const Pass* p);
1026 
1027 
1028 
1029 
1030 
1031 
1032 
1033 
1037 
1041 
1045 
1049 
1055  void updateAllAnimationsThread( size_t threadIdx );
1056  void updateAnimationTransforms( BySkeletonDef &bySkeletonDef, size_t threadIdx );
1057 
1065  void updateAllTransformsThread( const UpdateTransformRequest &request, size_t threadIdx );
1066 
1072  void updateAllBoundsThread( const ObjectMemoryManagerVec &objectMemManager, size_t threadIdx );
1073 
1079  void updateAllLodsThread( const UpdateLodRequest &request, size_t threadIdx );
1080 
1087  void instanceBatchCullFrustumThread( const InstanceBatchCullRequest &request, size_t threadIdx );
1088 
1098  void cullFrustum( const CullFrustumRequest &request, size_t threadIdx );
1099 
1106  void buildLightList();
1107 
1108  public:
1111  SceneManager(const String& instanceName, size_t numWorkerThreads,
1112  InstancingTheadedCullingMethod threadedCullingMethod);
1113 
1116  virtual ~SceneManager();
1117 
1118 
1144  OGRE_MUTEX(sceneGraphMutex);
1145 
1147  const String& getName(void) const { return mName; }
1148 
1155  virtual const String& getTypeName(void) const = 0;
1156 
1157  size_t getNumWorkerThreads() const { return mNumWorkerThreads; }
1158 
1173  virtual Camera* createCamera(const String& name, bool notShadowCaster=true, bool forCubemapping=false);
1174 
1181  virtual Camera* findCamera( IdString name ) const;
1182 
1189  virtual Camera* findCameraNoThrow( IdString name ) const;
1190 
1199  virtual void destroyCamera(Camera *cam);
1200 
1207  virtual void destroyAllCameras(void);
1208 
1219  virtual Light* createLight();
1220 
1222  void clearFrameData(void);
1223 
1224  const LightListInfo& getGlobalLightList(void) const { return mGlobalLightList; }
1225 
1228  virtual const PlaneList& getLightClippingPlanes(const Light* l);
1229 
1232  virtual const RealRect& getLightScissorRect(const Light* l, const Camera* cam);
1233 
1238  virtual void destroyLight(Light* light);
1241  virtual void destroyAllLights(void);
1242 
1248  virtual SceneNode* _createSceneNode( SceneNode *parent, SceneMemoryMgrTypes sceneType );
1249 
1269  virtual SceneNode* createSceneNode( SceneMemoryMgrTypes sceneType = SCENE_DYNAMIC );
1270 
1277  virtual void destroySceneNode(SceneNode* sn);
1278 
1297  SceneNode* getRootSceneNode( SceneMemoryMgrTypes sceneType = SCENE_DYNAMIC );
1298 
1305  virtual_l1 SceneNode* getSceneNode( IdType id );
1306  virtual_l1 const SceneNode* getSceneNode( IdType id ) const;
1307 
1311  virtual void registerSceneNodeListener( SceneNode *sceneNode );
1312 
1315  virtual void unregisterSceneNodeListener( SceneNode *sceneNode );
1316 
1324  { return mEntityMemoryManager[sceneType]; }
1325 
1331  virtual Entity* createEntity( const String& meshName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME,
1332  SceneMemoryMgrTypes sceneType = SCENE_DYNAMIC );
1333 
1338  virtual Entity* createEntity( const MeshPtr& pMesh, SceneMemoryMgrTypes sceneType = SCENE_DYNAMIC );
1339 
1346  enum PrefabType {
1349  PT_SPHERE
1350  };
1351 
1355  virtual Entity* createEntity( PrefabType ptype, SceneMemoryMgrTypes sceneType = SCENE_DYNAMIC );
1356 
1365  virtual void destroyEntity(Entity* ent);
1366 
1376  virtual void destroyAllEntities(void);
1377 
1386  void _addCompositorTexture( IdString name, const TextureVec *texs );
1387 
1389  size_t getNumCompositorTextures(void) const { return mCompositorTextures.size(); }
1390 
1392  void _removeCompositorTextures( size_t from );
1393 
1395  SkeletonInstance* createSkeletonInstance( const SkeletonDef *skeletonDef );
1397  void destroySkeletonInstance( SkeletonInstance *skeletonInstance );
1398 
1402  virtual ManualObject* createManualObject( SceneMemoryMgrTypes sceneType = SCENE_DYNAMIC );
1405  virtual void destroyManualObject(ManualObject* obj);
1408  virtual void destroyAllManualObjects(void);
1412  virtual BillboardChain* createBillboardChain();
1415  virtual void destroyBillboardChain(BillboardChain* obj);
1418  virtual void destroyAllBillboardChains(void);
1422  virtual RibbonTrail* createRibbonTrail();
1425  virtual void destroyRibbonTrail(RibbonTrail* obj);
1428  virtual void destroyAllRibbonTrails(void);
1429 
1448  virtual ParticleSystem* createParticleSystem( const String& templateName );
1466  virtual ParticleSystem* createParticleSystem( size_t quota = 500,
1468 
1471  virtual void destroyParticleSystem(ParticleSystem* obj);
1474  virtual void destroyAllParticleSystems(void);
1475 
1481  virtual void clearScene(void);
1482 
1495  void setAmbientLight(const ColourValue& colour);
1496 
1499  const ColourValue& getAmbientLight(void) const;
1500 
1516  virtual void prepareWorldGeometry(const String& filename);
1517 
1535  virtual void prepareWorldGeometry(DataStreamPtr& stream,
1536  const String& typeName = BLANKSTRING);
1537 
1550  virtual void setWorldGeometry(const String& filename);
1551 
1567  virtual void setWorldGeometry(DataStreamPtr& stream,
1568  const String& typeName = BLANKSTRING);
1569 
1582  virtual size_t estimateWorldGeometry(const String& filename)
1583  { (void)filename; return 0; }
1584 
1597  virtual size_t estimateWorldGeometry(DataStreamPtr& stream,
1598  const String& typeName = BLANKSTRING)
1599  { (void)stream; (void)typeName; return 0; }
1600 
1615  virtual ViewPoint getSuggestedViewpoint(bool random = false);
1616 
1630  virtual bool setOption( const String& strKey, const void* pValue )
1631  { (void)strKey; (void)pValue; return false; }
1632 
1646  virtual bool getOption( const String& strKey, void* pDestValue )
1647  { (void)strKey; (void)pDestValue; return false; }
1648 
1658  virtual bool hasOption( const String& strKey ) const
1659  { (void)strKey; return false; }
1660 
1675  virtual bool getOptionValues( const String& strKey, StringVector& refValueList )
1676  { (void)strKey; (void)refValueList; return false; }
1677 
1684  virtual bool getOptionKeys( StringVector& refKeys )
1685  { (void)refKeys; return false; }
1686 
1689 
1691  { return mInstancingThreadedCullingMethod; }
1692 
1698  void notifyStaticAabbDirty( MovableObject *movableObject );
1699 
1711  void notifyStaticDirty( Node *node );
1712 
1718  void updateAllAnimations();
1719 
1730  void updateAllTransforms();
1731 
1740  void updateAllBounds( const ObjectMemoryManagerVec &objectMemManager );
1741 
1744  void updateAllLods( const Camera *lodCamera, Real lodBias, uint8 firstRq, uint8 lastRq );
1745 
1748  void updateSceneGraph();
1749 
1754  virtual void _applySceneAnimations(void);
1755 
1758  virtual void _renderVisibleObjects(void);
1759 
1761  void _swapVisibleObjectsForShadowMapping();
1762 
1772  virtual void _cullPhase01(Camera* camera, const Camera *lodCamera,
1773  Viewport* vp, uint8 firstRq, uint8 lastRq );
1774 
1793  virtual void _renderPhase02( Camera* camera, const Camera* lodCamera, Viewport* vp,
1794  uint8 firstRq, uint8 lastRq, bool includeOverlays );
1795 
1799  virtual void _queueSkiesForRendering(Camera* cam);
1800 
1801 
1802 
1811  virtual void _setDestinationRenderSystem(RenderSystem* sys);
1812 
1813  void _setViewport( Viewport *vp ) { setViewport( vp ); }
1814 
1868  virtual void setSkyPlane(
1869  bool enable,
1870  const Plane& plane, const String& materialName, Real scale = 1000,
1871  Real tiling = 10, bool drawFirst = true, Real bow = 0,
1872  int xsegments = 1, int ysegments = 1,
1917  virtual void _setSkyPlane(
1918  bool enable,
1919  const Plane& plane, const String& materialName, Real scale = 1000,
1920  Real tiling = 10, uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY, Real bow = 0,
1921  int xsegments = 1, int ysegments = 1,
1923 
1925  virtual void setSkyPlaneEnabled(bool enable) { mSkyPlaneEnabled = enable; }
1926 
1928  virtual bool isSkyPlaneEnabled(void) const { return mSkyPlaneEnabled; }
1929 
1931  virtual SceneNode* getSkyPlaneNode(void) const { return mSkyPlaneNode; }
1932 
1934  virtual const SkyPlaneGenParameters& getSkyPlaneGenParameters(void) const { return mSkyPlaneGenParameters; }
1935 
1977  virtual void setSkyBox(
1978  bool enable, const String& materialName, Real distance = 5000,
1979  bool drawFirst = true, const Quaternion& orientation = Quaternion::IDENTITY,
1981 
2014  virtual void _setSkyBox(
2015  bool enable, const String& materialName, Real distance = 5000,
2016  uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY, const Quaternion& orientation = Quaternion::IDENTITY,
2018 
2020  virtual void setSkyBoxEnabled(bool enable) { mSkyBoxEnabled = enable; }
2021 
2023  virtual bool isSkyBoxEnabled(void) const { return mSkyBoxEnabled; }
2024 
2026  virtual SceneNode* getSkyBoxNode(void) const { return mSkyBoxNode; }
2027 
2029  virtual const SkyBoxGenParameters& getSkyBoxGenParameters(void) const { return mSkyBoxGenParameters; }
2030 
2086  virtual void setSkyDome(
2087  bool enable, const String& materialName, Real curvature = 10,
2088  Real tiling = 8, Real distance = 4000, bool drawFirst = true,
2089  const Quaternion& orientation = Quaternion::IDENTITY,
2090  int xsegments = 16, int ysegments = 16, int ysegments_keep = -1,
2092 
2139  virtual void _setSkyDome(
2140  bool enable, const String& materialName, Real curvature = 10,
2141  Real tiling = 8, Real distance = 4000, uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY,
2142  const Quaternion& orientation = Quaternion::IDENTITY,
2143  int xsegments = 16, int ysegments = 16, int ysegments_keep = -1,
2145 
2147  virtual void setSkyDomeEnabled(bool enable) { mSkyDomeEnabled = enable; }
2148 
2150  virtual bool isSkyDomeEnabled(void) const { return mSkyDomeEnabled; }
2151 
2153  virtual SceneNode* getSkyDomeNode(void) const { return mSkyDomeNode; }
2154 
2156  virtual const SkyDomeGenParameters& getSkyDomeGenParameters(void) const { return mSkyDomeGenParameters; }
2157 
2182  void setFog(
2183  FogMode mode = FOG_NONE, const ColourValue& colour = ColourValue::White,
2184  Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0);
2185 
2188  virtual FogMode getFogMode(void) const;
2189 
2192  virtual const ColourValue& getFogColour(void) const;
2193 
2196  virtual Real getFogStart(void) const;
2197 
2200  virtual Real getFogEnd(void) const;
2201 
2204  virtual Real getFogDensity(void) const;
2205 
2206 
2222  virtual BillboardSet* createBillboardSet(unsigned int poolSize = 20);
2223 
2230  virtual void destroyBillboardSet(BillboardSet* set);
2231 
2241  virtual void destroyAllBillboardSets(void);
2242 
2250  virtual void setDisplaySceneNodes(bool display);
2252  virtual bool getDisplaySceneNodes(void) const {return mDisplayNodes;}
2253 
2274  virtual Animation* createAnimation(const String& name, Real length);
2275 
2279  virtual Animation* getAnimation(const String& name) const;
2282  virtual bool hasAnimation(const String& name) const;
2283 
2289  virtual void destroyAnimation(const String& name);
2290 
2292  virtual void destroyAllAnimations(void);
2293 
2321  virtual AnimationState* createAnimationState(const String& animName);
2322 
2326  virtual AnimationState* getAnimationState(const String& animName) const;
2329  virtual bool hasAnimationState(const String& name) const;
2330 
2336  virtual void destroyAnimationState(const String& name);
2337 
2339  virtual void destroyAllAnimationStates(void);
2340 
2364  virtual void manualRender(RenderOperation* rend, Pass* pass, Viewport* vp,
2365  const Matrix4& worldMatrix, const Matrix4& viewMatrix, const Matrix4& projMatrix,
2366  bool doBeginEndFrame = false) ;
2367 
2387  virtual void manualRender(Renderable* rend, const Pass* pass, Viewport* vp,
2388  const Matrix4& viewMatrix, const Matrix4& projMatrix, bool doBeginEndFrame = false,
2389  bool lightScissoringClipping = true, bool doLightIteration = true);
2390 
2401  virtual RenderQueue* getRenderQueue(void);
2402 
2406  virtual void addRenderQueueListener(RenderQueueListener* newListener);
2407 
2409  virtual void removeRenderQueueListener(RenderQueueListener* delListener);
2410 
2413  virtual void addRenderObjectListener(RenderObjectListener* newListener);
2415  virtual void removeRenderObjectListener(RenderObjectListener* delListener);
2416 
2430  virtual void addSpecialCaseRenderQueue(uint8 qid);
2436  virtual void removeSpecialCaseRenderQueue(uint8 qid);
2440  virtual void clearSpecialCaseRenderQueues(void);
2445  virtual void setSpecialCaseRenderQueueMode(SpecialCaseRenderQueueMode mode);
2447  virtual SpecialCaseRenderQueueMode getSpecialCaseRenderQueueMode(void);
2454  virtual bool isRenderQueueToBeProcessed(uint8 qid);
2455 
2471  virtual void setWorldGeometryRenderQueue(uint8 qid);
2482  virtual uint8 getWorldGeometryRenderQueue(void);
2483 
2485  virtual void showBoundingBoxes(bool bShow);
2486 
2488  virtual bool getShowBoundingBoxes() const;
2489 
2491  virtual void _addAutotrackingSceneNode( SceneNode* source, SceneNode* target,
2492  const Vector3 &offset, const Vector3 &localDirection );
2493  virtual void _removeAutotrackingSceneNode( SceneNode* source );
2494 
2495 
2508  virtual AxisAlignedBoxSceneQuery*
2509  createAABBQuery(const AxisAlignedBox& box, uint32 mask = QUERY_ENTITY_DEFAULT_MASK);
2522  virtual SphereSceneQuery*
2523  createSphereQuery(const Sphere& sphere, uint32 mask = QUERY_ENTITY_DEFAULT_MASK);
2536  virtual PlaneBoundedVolumeListSceneQuery* createPlaneBoundedVolumeQuery(
2537  const PlaneBoundedVolumeList& volumes, uint32 mask = QUERY_ENTITY_DEFAULT_MASK);
2538 
2539 
2552  virtual RaySceneQuery* createRayQuery(const Ray& ray, uint32 mask = QUERY_ENTITY_DEFAULT_MASK);
2553  //PyramidSceneQuery* createPyramidQuery(const Pyramid& p, unsigned long mask = 0xFFFFFFFF);
2565  virtual IntersectionSceneQuery* createIntersectionQuery(uint32 mask = QUERY_ENTITY_DEFAULT_MASK);
2566 
2568  virtual void destroyQuery(SceneQuery* query);
2569 
2572 
2576  return CameraIterator(mCameras.begin(), mCameras.end());
2577  }
2580  const CameraList& getCameras() const { return mCameras; }
2583  return AnimationIterator(mAnimationsList.begin(), mAnimationsList.end());
2584  }
2587  const AnimationList& getAnimations() const { return mAnimationsList; }
2590  return mAnimationStates.getAnimationStateIterator();
2591  }
2592 
2599  virtual void setShadowColour(const ColourValue& colour);
2606  virtual const ColourValue& getShadowColour(void) const;
2618  virtual void setShadowDirectionalLightExtrusionDistance(Real dist);
2621  virtual Real getShadowDirectionalLightExtrusionDistance(void) const;
2638  virtual void setShadowFarDistance(Real distance);
2642  virtual Real getShadowFarDistance(void) const
2643  { return mDefaultShadowFarDist; }
2644  virtual Real getShadowFarDistanceSquared(void) const
2645  { return mDefaultShadowFarDistSquared; }
2646 
2661  virtual void setShadowDirLightTextureOffset(Real offset) { mShadowTextureOffset = offset;}
2665  virtual Real getShadowDirLightTextureOffset(void) const { return mShadowTextureOffset; }
2673  virtual void setShadowTextureFadeStart(Real fadeStart)
2674  { mShadowTextureFadeStart = fadeStart; }
2682  virtual void setShadowTextureFadeEnd(Real fadeEnd)
2683  { mShadowTextureFadeEnd = fadeEnd; }
2684 
2705  virtual void setShadowTextureCasterMaterial(const String& name);
2706 
2717  virtual void setShadowCasterRenderBackFaces(bool bf) { mShadowCasterRenderBackFaces = bf; }
2718 
2722  virtual bool getShadowCasterRenderBackFaces() const { return mShadowCasterRenderBackFaces; }
2723 
2724  void _setCurrentShadowNode( CompositorShadowNode *shadowNode );
2725 
2729  virtual void _setActiveCompositorChain(CompositorChain* chain) { mActiveCompositorChain = chain; }
2730 
2736  virtual void setLateMaterialResolving(bool isLate) { mLateMaterialResolving = isLate; }
2737 
2740  virtual bool isLateMaterialResolving() const { return mLateMaterialResolving; }
2741 
2743  virtual CompositorChain* _getActiveCompositorChain() const { return mActiveCompositorChain; }
2744 
2747  virtual void addListener(Listener* s);
2750  virtual void removeListener(Listener* s);
2751 
2761  virtual StaticGeometry* createStaticGeometry(const String& name);
2765  virtual StaticGeometry* getStaticGeometry(const String& name) const;
2767  virtual bool hasStaticGeometry(const String& name) const;
2769  virtual void destroyStaticGeometry(StaticGeometry* geom);
2771  virtual void destroyStaticGeometry(const String& name);
2773  virtual void destroyAllStaticGeometry(void);
2774 
2793  virtual InstanceManager* createInstanceManager( const String &customName, const String &meshName,
2794  const String &groupName,
2796  size_t numInstancesPerBatch, uint16 flags=0,
2797  unsigned short subMeshIdx=0 );
2798 
2802  virtual InstanceManager* getInstanceManager( IdString name ) const;
2803 
2805  virtual bool hasInstanceManager( IdString managerName ) const;
2806 
2813  virtual void destroyInstanceManager( IdString name );
2814  virtual void destroyInstanceManager( InstanceManager *instanceManager );
2815 
2816  virtual void destroyAllInstanceManagers(void);
2817 
2830  virtual size_t getNumInstancesPerBatch( const String &meshName, const String &groupName,
2831  const String &materialName,
2833  size_t numInstancesPerBatch, uint16 flags=0,
2834  unsigned short subMeshIdx=0 );
2835 
2847  virtual InstancedEntity* createInstancedEntity( const String &materialName,
2848  const String &managerName );
2849 
2854  virtual void destroyInstancedEntity( InstancedEntity *instancedEntity );
2855 
2866  virtual MovableObject* createMovableObject(const String& typeName,
2867  ObjectMemoryManager *objectMemMgr,
2868  const NameValuePairList* params = 0);
2872  virtual bool hasMovableObject( MovableObject *m );
2878  virtual void destroyMovableObject( MovableObject *m, const String& typeName );
2884  virtual void destroyMovableObject(MovableObject* m);
2886  virtual void destroyAllMovableObjectsByType(const String& typeName);
2888  virtual void destroyAllMovableObjects(void);
2895  virtual MovableObjectIterator getMovableObjectIterator(const String& typeName);
2907  virtual void injectMovableObject(MovableObject* m);
2914  virtual void extractMovableObject(MovableObject* m);
2921  virtual void extractAllMovableObjectsByType(const String& typeName);
2922 
2930  { mVisibilityMask = vmask & VisibilityFlags::RESERVED_VISIBILITY_FLAGS; }
2931 
2935  virtual_l2 uint32 getVisibilityMask(void) const { return mVisibilityMask; }
2936 
2940  uint32 _getCombinedVisibilityMask(void) const;
2941 
2948  virtual void setFindVisibleObjects(bool find) { mFindVisibleObjects = find; }
2949 
2953  virtual bool getFindVisibleObjects(void) { return mFindVisibleObjects; }
2954 
2963  virtual void setNormaliseNormalsOnScale(bool n) { mNormaliseNormalsOnScale = n; }
2964 
2968  virtual bool getNormaliseNormalsOnScale() const { return mNormaliseNormalsOnScale; }
2969 
2978  virtual void setFlipCullingOnNegativeScale(bool n) { mFlipCullingOnNegativeScale = n; }
2979 
2983  virtual bool getFlipCullingOnNegativeScale() const { return mFlipCullingOnNegativeScale; }
2984 
2993  virtual void _injectRenderWithPass( Pass *pass, Renderable *rend, Camera *activeCamera=0,
2994  bool shadowDerivation = true,
2995  bool doLightIteration = false );
2996 
3015  virtual void _suppressRenderStateChanges(bool suppress);
3016 
3020  virtual bool _areRenderStateChangesSuppressed(void) const
3021  { return mSuppressRenderStateChanges; }
3022 
3035  virtual const Pass* _setPass(const Pass* pass,
3036  bool evenIfSuppressed = false, bool shadowDerivation = true);
3037 
3045  virtual void _markGpuParamsDirty(uint16 mask);
3046 
3050  virtual void _renderQueueGroupObjects(RenderQueueGroup* group,
3052 
3068  void setQueuedRenderableVisitor(SceneMgrQueuedRenderableVisitor* visitor);
3069 
3071  SceneMgrQueuedRenderableVisitor* getQueuedRenderableVisitor(void) const;
3072 
3073 
3077  RenderSystem *getDestinationRenderSystem();
3078 
3081  Viewport* getCurrentViewport(void) const { return mCurrentViewport; }
3082 
3085  Camera* getCameraInProgress(void) const { return mCameraInProgress; }
3086 
3087  AxisAlignedBox _calculateCurrentCastersBox( uint32 viewportVisibilityMask,
3088  uint8 firstRq, uint8 lastRq ) const;
3089 
3094  const AxisAlignedBox& getCurrentCastersBox(void) const;
3095 
3100  void getMinMaxDepthRange( const Frustum *shadowMapCamera, Real &outMin, Real &outMax ) const;
3101 
3102 
3134  virtual void setRelativeOrigin( const Vector3 &relativeOrigin, bool bPermanent );
3135 
3137  Vector3 getRelativeOrigin(void) const;
3138 
3139  //Derived from ArrayMemoryManager::RebaseListener
3140  /*virtual void buildDiffList( ArrayMemoryManager::ManagerType managerType, uint16 level,
3141  const MemoryPoolVec &basePtrs,
3142  ArrayMemoryManager::PtrdiffVec &outDiffsList );
3143  virtual void applyRebase( ArrayMemoryManager::ManagerType managerType, uint16 level,
3144  const MemoryPoolVec &newBasePtrs,
3145  const ArrayMemoryManager::PtrdiffVec &diffsList );
3146  virtual void performCleanup( ArrayMemoryManager::ManagerType managerType, uint16 level,
3147  const MemoryPoolVec &basePtrs, size_t const *elementsMemSizes,
3148  size_t startInstance, size_t diffInstances );*/
3149 
3150 
3152  void addLodListener(LodListener *listener);
3153 
3159  void removeLodListener(LodListener *listener);
3160 
3162  void _notifyMovableObjectLodChanged(MovableObjectLodChangedEvent& evt);
3163 
3165  void _notifyEntityMeshLodChanged(EntityMeshLodChangedEvent& evt);
3166 
3168  void _notifyEntityMaterialLodChanged(EntityMaterialLodChangedEvent& evt);
3169 
3171  void _handleLodEvents();
3172 
3173  void _setCurrentRenderStage( IlluminationRenderStage stage ) { mIlluminationStage = stage; }
3174  IlluminationRenderStage _getCurrentRenderStage() const {return mIlluminationStage;}
3175 
3176  protected:
3181  void fireCullFrustumThreads( const CullFrustumRequest &request );
3182  void fireCullFrustumInstanceBatchThreads( const InstanceBatchCullRequest &request );
3183  void startWorkerThreads();
3184  void stopWorkerThreads();
3185 
3186  public:
3187 
3201  void executeUserScalableTask( UniformScalableTask *task, bool bBlock );
3202 
3207  void waitForPendingUserScalableTask();
3208 
3212  unsigned long _updateWorkerThread( ThreadHandle *threadHandle );
3213  };
3214 
3217  public IntersectionSceneQuery
3218  {
3219  public:
3222 
3224  void execute(IntersectionSceneQueryListener* listener);
3225  };
3226 
3229  {
3230  public:
3233 
3235  virtual void execute(RaySceneQueryListener* listener);
3236  bool execute( ObjectData objData, size_t numNodes, RaySceneQueryListener* listener );
3237  };
3240  {
3241  public:
3244 
3246  virtual void execute(SceneQueryListener* listener);
3247  bool execute( ObjectData objData, size_t numNodes, SceneQueryListener* listener );
3248  };
3251  {
3252  public:
3255 
3257  void execute(SceneQueryListener* listener);
3258  };
3261  {
3262  public:
3265 
3267  virtual void execute(SceneQueryListener* listener);
3268  bool execute( ObjectData objData, size_t numNodes, SceneQueryListener* listener );
3269  };
3270 
3271 
3274 
3279  {
3285  };
3286 
3289  {
3298  };
3299 
3300 
3301 
3304  {
3305  protected:
3307  mutable bool mMetaDataInit;
3309  virtual void initMetaData(void) const = 0;
3310  public:
3311  SceneManagerFactory() : mMetaDataInit(true) {}
3314  virtual const SceneManagerMetaData& getMetaData(void) const
3315  {
3316  if (mMetaDataInit)
3317  {
3318  initMetaData();
3319  mMetaDataInit = false;
3320  }
3321  return mMetaData;
3322  }
3327  virtual SceneManager* createInstance(const String& instanceName, size_t numWorkerThreads,
3328  InstancingTheadedCullingMethod threadedCullingMethod) = 0;
3330  virtual void destroyInstance(SceneManager* instance) = 0;
3331 
3332  };
3333 
3338 } // Namespace
3339 
3340 #include "OgreHeaderSuffix.h"
3341 
3342 #endif
Representation of a ray in space, i.e.
Definition: OgreRay.h:45
Class encapsulating a set of AnimationState objects.
Viewport * getCurrentViewport(void) const
Gets the current viewport being rendered (advanced use only, only valid during viewport update...
SceneNode * mSkyPlaneNode
LightListInfo mGlobalLightList
Updated every frame, has enough memory to hold all lights.
unsigned char uint8
Definition: OgrePlatform.h:422
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:82
Represents the transform of a single object, arranged in SoA (Structure of Arrays) ...
virtual void setShadowTextureFadeStart(Real fadeStart)
Sets the proportional distance at which texture shadows begin to fade out.
SceneType
Classification of a scene to allow a decision of what type of SceenManager to provide back to the app...
virtual bool getOptionValues(const String &strKey, StringVector &refValueList)
Method for getting all possible values for a specific option.
Camera const * lodCamera
Camera whose frustum we're to cull against. Must be const (read only for all threads).
virtual void setNormaliseNormalsOnScale(bool n)
Set whether to automatically normalise normals on objects whenever they are scaled.
static uint32 QUERY_ENTITY_DEFAULT_MASK
Default query mask for entities.
Class defining particle system based special effects.
vector< ThreadHandlePtr >::type ThreadHandleVec
Definition: OgreThreads.h:121
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:79
virtual void _setActiveCompositorChain(CompositorChain *chain)
Sets the active compositor chain of the current scene being rendered.
const Pass * mUsedPass
Pass that was actually used at the grouping level.
ObjectMemoryManager & _getEntityMemoryManager(SceneMemoryMgrTypes sceneType)
Retrieves the main entity memory manager.
CullFrustumRequest mCurrentCullFrustumRequest
Represents the transform of a single object, arranged in SoA (Structure of Arrays) ...
Definition: OgreTransform.h:37
SceneNodeList mSceneNodesWithListeners
float Real
Software floating point type.
MovableObjectLodChangedEventList mMovableObjectLodChangedEvents
bool mStaticEntitiesDirty
Whether mEntityMemoryManager[SCENE_STATIC] is dirty (assume all render queues, you shouldn't be doing...
GpuProgramParametersSharedPtr mFiniteExtrusionParams
size_t getNumWorkerThreads() const
unsigned int uint32
Definition: OgrePlatform.h:420
virtual void preFindVisibleObjects(SceneManager *source, IlluminationRenderStage irs, Viewport *v)
Called prior to searching for visible objects in this SceneManager.
SceneMgrQueuedRenderableVisitor mDefaultQueuedRenderableVisitor
Storage for default renderable visitor.
virtual void sceneManagerDestroyed(SceneManager *source)
Event notifying the listener of the SceneManager's destruction.
#define _OgreExport
Definition: OgrePlatform.h:255
MapIterator< AnimationList > AnimationIterator
vector< ObjectMemoryManager * >::type ObjectMemoryManagerVec
size_t numNodesPerThread
Number of nodes to process for each thread. Must be multiple of ARRAY_PACKED_REALS.
bool transparentShadowCastersMode
Are we in transparent shadow caster mode?
Struct associating a single Pass with a single Renderable.
std::vector< T, A > type
SkeletonAnimManager mSkeletonAnimationManager
void _setViewport(Viewport *vp)
GpuProgramParametersSharedPtr mShadowTextureCustomCasterFPParams
String typeName
A globally unique string identifying the scene manager type.
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:580
Pre-transforms and batches up meshes for efficient use as static geometry in a scene.
Defines a plane in 3D space.
Definition: OgrePlane.h:61
FogMode
Fog modes.
Definition: OgreCommon.h:152
#define OGRE_MUTEX(name)
vector< InstanceManager * >::type InstanceManagerVec
UpdateLodRequest(uint8 _firstRq, uint8 _lastRq, const ObjectMemoryManagerVec *_objectMemManager, const Camera *_camera, const Camera *_lodCamera, Real _lodBias)
Abstract interface which classes must implement if they wish to receive events from the scene manager...
VisibleObjectsPerThreadArray mTmpVisibleObjects
mVisibleObjects.
A grouping level underneath RenderQueue which groups renderables to be issued at coarsely the same ti...
Real mShadowTextureFadeStart
Proportion of texture offset in view direction e.g. 0.4.
uint16 mGpuParamsDirty
Gpu params that need rebinding (mask of GpuParamVariability)
uint32 mLastLightHash
Last light sets.
Class providing a much simplified interface to generating manual objects with custom geometry...
Vector3 offset
Tracking offset for fine tuning.
virtual_l2 void setVisibilityMask(uint32 vmask)
Sets a mask which is bitwise 'and'ed with objects own visibility masks to determine if the object is ...
Viewport * mCurrentViewport
Current Viewport.
StaticGeometryList mStaticGeometryList
SkyDomeGenParameters mSkyDomeGenParameters
Class representing colour.
FrustumVec mVisibleCameras
vector< CompositorTexture >::type CompositorTextureVec
static const ColourValue White
SceneTypeMask sceneTypeMask
A mask describing which sorts of scenes this manager can handle.
PrefabType
Prefab shapes available without loading a model.
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
Definition: OgreFrustum.h:84
vector< Camera * >::type CameraList
A class for performing queries on a scene.
Manages the organisation and rendering of a 'scene' i.e.
vector< ObjectMemoryManager * >::type ObjectMemoryManagerVec
NodeMemoryManagerVec mNodeMemoryManagerUpdateList
Filled and cleared every frame in HighLevelCull()
Render only the queues in the special case list.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
vector< LightInfo >::type LightInfoList
Defines a program which runs on the GPU such as a vertex or fragment program.
UpdateTransformRequest(const Transform &_t, size_t _numNodesPerThread, size_t _numTotalNodes)
Camera const * camera
Camera whose frustum we're to cull against. Must be const (read only for all threads).
static String DEFAULT_RESOURCE_GROUP_NAME
Default resource group name.
unsigned long mLastFrameNumber
virtual SceneNode * getSkyPlaneNode(void) const
Get the sky plane node, if enabled.
Struct for caching light clipping information for re-use in a frame.
IlluminationRenderStage mIlluminationStage
AnimationList mAnimationsList
#define OGRE_SIMD_ALIGNED_DECL(type, var)
virtual bool getShadowCasterRenderBackFaces() const
Gets whether or not shadow casters should be rendered into shadow textures using their back faces rat...
const LightListInfo & getGlobalLightList(void) const
#define virtual_l2
Definition: OgrePlatform.h:379
bool worldGeometrySupported
Flag indicating whether world geometry is supported.
Specialises the SceneQuery class for querying within a sphere.
InstancingTheadedCullingMethod
There are two Instancing techniques that perform culling of their own: HW Basic HW VTF Frustum cullin...
Simple structure to hold MovableObject map and a mutex to go with it.
SkyBoxGenParameters mSkyBoxGenParameters
uint32 lightMask
Sets to zero if directional light.
A 3D box aligned with the x/y/z axes.
InstanceBatchCullRequest(const Frustum *_frustum, const Camera *_lodCamera, uint32 _combinedVisibilityFlags)
OrganisationMode
Organisation modes required for this collection.
VisibleObjectsPerThreadArray & _getTmpVisibleObjectsList()
mTmpVisibleObjects
Represents the state of an animation and the weight of its influence.
RenderQueue * mRenderQueue
Queue of objects for rendering.
First queue (after backgrounds), used for skyboxes if rendered first.
static uint32 QUERY_STATICGEOMETRY_DEFAULT_MASK
Default query mask for StaticGeometry.
ThreadHandleVec mWorkerThreads
virtual Real getShadowFarDistanceSquared(void) const
vector< Listener * >::type ListenerList
static uint32 QUERY_FRUSTUM_DEFAULT_MASK
Default query mask for frusta and cameras.
virtual bool isSkyDomeEnabled(void) const
Return whether a skydome is enabled.
virtual bool sortLightsAffectingFrustum(LightList &lightList)
Hook to allow the listener to override the ordering of lights for the entire frustum.
virtual bool isLateMaterialResolving() const
Gets whether using late material resolving or not.
IlluminationRenderStage
Describes the stage of rendering when performing complex illumination.
Class that allows listening in on the various stages of SceneManager processing, so that custom behav...
virtual bool setOption(const String &strKey, const void *pValue)
Method for setting a specific option of the Scene Manager.
All variables are read-only for the worker threads.
SceneManagerMetaData mMetaData
int type
Just a pointer for comparison, the light might destroyed for some reason.
Wrap-around class that contains multiple ArrayMemoryManager, one per render queue.
SpecialCaseRenderQueueMode mSpecialCaseQueueMode
virtual void setShadowTextureFadeEnd(Real fadeEnd)
Sets the proportional distance at which texture shadows finish to fading out.
AnimationIterator getAnimationIterator(void)
Returns a specialised MapIterator over all animations in the scene.
Default implementation of SphereSceneQuery.
GpuProgramParametersSharedPtr mInfiniteExtrusionParams
volatile bool mExitWorkerThreads
Abstract class defining a movable object in a scene.
Class representing a node in the scene graph.
Definition: OgreSceneNode.h:53
vector< EntityMaterialLodChangedEvent >::type EntityMaterialLodChangedEventList
List of entity material LOD changed events.
const String BLANKSTRING
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreCommon.h:574
MovableObjectCollectionMap mMovableObjectCollectionMap
SkyPlaneGenParameters mSkyPlaneGenParameters
Inner helper class to implement the visitor pattern for rendering objects in a queue.
FrustumVec mCubeMapCameras
Pass * mShadowCasterPlainBlackPass
A pass designed to let us render shadow colour on white for texture shadows.
bool mSuppressRenderStateChanges
Suppress render state changes?
virtual SceneNode * getSkyDomeNode(void) const
Get the sky dome node, if enabled.
ObjectMemoryManager mLightMemoryManager
Class defining a single pass of a Technique (of a Material), i.e.
Definition: OgrePass.h:78
CullingMode
Hardware culling modes based on vertex winding.
Definition: OgreCommon.h:166
Abstract class defining the interface all renderable objects must implement.
Holds all lights in SoA after being culled over all frustums.
Definition: OgreCommon.h:555
Implementation of a Quaternion, i.e.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
No fog. Duh.
Definition: OgreCommon.h:155
vector< PlaneBoundedVolume >::type PlaneBoundedVolumeList
A collection of billboards (faces which are always facing the given direction) with the same (default...
Allows the rendering of a chain of connected billboards.
_OgreExport const uint32 RESERVED_VISIBILITY_FLAGS
When this is bit is clear, the obj is not rendered at all.
vector< NodeMemoryManager * >::type NodeMemoryManagerVec
virtual bool isSkyPlaneEnabled(void) const
Return whether a key plane is enabled.
Class to hold a linear sequence of RenderQueueInvocation objects.
virtual bool getNormaliseNormalsOnScale() const
Get whether to automatically normalise normals on objects whenever they are scaled.
This is how the Skeleton system works in 2.0: There is one BoneMemoryManager per skeleton.
AnimationStateSet mAnimationStates
Shared pointer implementation used to share index buffers.
virtual const SkyPlaneGenParameters & getSkyPlaneGenParameters(void) const
Get the parameters used to construct the SkyPlane, if any.
Representation of a dynamic light source in the scene.
Definition: OgreLight.h:70
Default implementation of IntersectionSceneQuery.
virtual const SkyBoxGenParameters & getSkyBoxGenParameters(void) const
Get the parameters used to generate the current SkyBox, if any.
map< String, Animation * >::type AnimationList
Storage of animations, lookup by name.
Lowest level collection of renderables.
Allows the rendering of a simple 2D rectangle This class renders a simple 2D rectangle; this rectangl...
vector< Plane >::type PlaneList
Definition: OgrePlane.h:160
Struct containing information about a material LOD change event for entities.
vector< AutoTrackingSceneNode >::type AutoTrackingSceneNodeVec
String mName
Instance name.
ListenerList mListeners
AutoParamDataSource * mAutoParamDataSource
Utility class for calculating automatic parameters for gpu programs.
virtual bool getDisplaySceneNodes(void) const
Returns true if all scene nodes axis are to be displayed.
static uint32 QUERY_LIGHT_DEFAULT_MASK
Default query mask for lights.
#define virtual_l1
Definition: OgrePlatform.h:374
static const Quaternion IDENTITY
vector< Frustum * >::type FrustumVec
A barrier is a synchronization mechanism where multiple threads wait until all of them have reached t...
Definition: OgreBarrier.h:62
GpuProgramParametersSharedPtr mShadowTextureCustomCasterVPParams
No special illumination stage.
map< Light const *, LightClippingInfo >::type LightClippingInfoMap
AutoTrackingSceneNodeVec mAutoTrackingSceneNodes
Quaternion mSkyDomeOrientation
IlluminationRenderStage _getCurrentRenderStage() const
RenderSystem::RenderSystemContext * rsContext
virtual Real getShadowDirLightTextureOffset(void) const
Gets the proportional distance which a texture shadow which is generated from a directional light wil...
VectorIterator< MovableObjectVec > MovableObjectIterator
virtual bool getOptionKeys(StringVector &refKeys)
Method for getting all the implementation-specific options of the scene manager.
Real mShadowTextureFadeEnd
As a proportion e.g. 0.6.
SpecialCaseRenderQueueMode
Enumeration of the possible modes allowed for processing the special case render queue list...
CullingMode mPassCullingMode
Alternative listener class for dealing with RaySceneQuery.
ManualObject * mSkyBoxObj
vector< SkeletonAnimManager * >::type SkeletonAnimManagerVec
virtual size_t estimateWorldGeometry(DataStreamPtr &stream, const String &typeName=BLANKSTRING)
Estimate the number of loading stages required to load the named world geometry.
virtual bool hasOption(const String &strKey) const
Method for verifying whether the scene manager has an implementation-specific option.
vector< MovableObject * >::type MovableObjectVec
map< String, StaticGeometry * >::type StaticGeometryList
HardwareIndexBufferSharedPtr mShadowIndexBuffer
Alternative listener class for dealing with IntersectionSceneQuery.
unsigned long mLightClippingInfoMapFrameNumber
Ogre::uint32 IdType
Big projects with lots, lots of units for very long periods of time (MMORPGs?) may want to define thi...
Definition: OgreId.h:36
SceneMgrQueuedRenderableVisitor * mActiveQueuedRenderableVisitor
The active renderable visitor class - subclasses could override this.
virtual bool _areRenderStateChangesSuppressed(void) const
Are render state changes suppressed?
CameraList mCameras
Central list of cameras - for easy memory management and lookup.
virtual size_t estimateWorldGeometry(const String &filename)
Estimate the number of loading stages required to load the named world geometry.
RenderQueueListenerList mRenderQueueListeners
vector< MovableObjectLodChangedEvent >::type MovableObjectLodChangedEventList
List of movable object LOD changed events.
A sphere primitive, mostly used for bounds checking.
Definition: OgreSphere.h:51
RenderSystem * mDestRenderSystem
The rendering system to send the scene to.
Defines an instance of a discrete, movable object based on a Mesh.
Definition: OgreEntity.h:81
CameraIterator getCameraIterator(void)
Returns a specialised MapIterator over all cameras in the scene.
set< uint8 >::type SpecialCaseRenderQueueList
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
uint16 mStaticMinDepthLevelDirty
Minimum depth level at which mNodeMemoryManager[SCENE_STATIC] is dirty.
Abstract interface which classes must implement if they wish to receive events from the render queue...
virtual bool isSkyBoxEnabled(void) const
Return whether a skybox is enabled.
CullFrustumRequest(uint8 _firstRq, uint8 _lastRq, const ObjectMemoryManagerVec *_objectMemManager, const Camera *_camera, const Camera *_lodCamera)
Subclass of BillboardChain which automatically leaves a trail behind one or more Node instances...
Struct containing information about a LOD change event for movable objects.
virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
Event raised after all shadow textures have been rendered into for all queues / targets but before an...
virtual bool getFlipCullingOnNegativeScale() const
Get whether to automatically flip the culling mode on objects whenever they are negatively scaled...
Hashed string.
Definition: OgreIdString.h:94
vector< TexturePtr >::type TextureVec
virtual void setSkyPlaneEnabled(bool enable)
Enables / disables a 'sky plane'.
String mShadowTextureCustomCasterFragmentProgram
String mShadowTextureCustomCasterVertexProgram
VisibleObjectsPerThreadArray mVisibleObjectsBackup
CompositorShadowNode remarks
virtual bool getFindVisibleObjects(void)
Gets whether the SceneManager should search for visible objects, or whether they are being manually h...
VectorIterator< CameraList > CameraIterator
static uint32 QUERY_FX_DEFAULT_MASK
Default query mask for effects like billboardsets / particle systems.
vector< String >::type StringVector
CompositorTexture(IdString _name, const TextureVec *_textures)
UpdateTransformRequest mUpdateTransformRequest
virtual const SkyDomeGenParameters & getSkyDomeGenParameters(void) const
Get the parameters used to generate the current SkyDome, if any.
FastArray< MovableObject::MovableObjectArray > VisibleObjectsPerThreadArray
Visitor interface for items in a QueuedRenderableCollection.
InstanceBatchCullRequest mInstanceBatchCullRequest
virtual Real getShadowFarDistance(void) const
Gets the default maximum distance away from the camera that shadows will be visible.
virtual void setShadowDirLightTextureOffset(Real offset)
Sets the proportional distance which a texture shadow which is generated from a directional light wil...
Standard 3-dimensional vector.
Definition: OgreVector3.h:50
virtual_l2 uint32 getVisibilityMask(void) const
Gets a mask which is bitwise 'and'ed with objects own visibility masks to determine if the object is ...
unsigned short mLastLightLimit
Pass * mShadowTextureCustomCasterPass
As a proportion e.g. 0.9.
uint8 firstRq
First RenderQueue ID to render (inclusive)
map< String, MovableObjectCollection * >::type MovableObjectCollectionMap
Matrix4 mCachedViewMatrix
Whether to use camera-relative rendering.
CompositorShadowNode * mCurrentShadowNode
Quaternion orientation
Camera * mCameraInProgress
Camera in progress.
ColourValue mAmbientLight
Current ambient light, cached for RenderSystem.
Struct containing information about a mesh LOD change event for entities.
const CameraList & getCameras() const
Returns a const version of the camera list.
virtual void setSkyDomeEnabled(bool enable)
Enables / disables a 'sky dome'.
Quaternion mSkyBoxOrientation
LightClippingInfoMap mLightClippingInfoMap
Default implementation of RaySceneQuery.
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:56
'New' rendering operation using vertex buffers.
RenderObjectListenerList mRenderObjectListeners
uint32 mVisibilityMask
Visibility mask used to show / hide objects.
ObjectMemoryManagerVec const * mUpdateBoundsRequest
SceneNodeList mSceneNodes
Central list of SceneNodes - for easy memory management.
uint16 SceneTypeMask
Bitmask containing scene types.
A interface class defining a listener which can be used to receive notifications of LOD events...
vector< size_t >::type mShadowTextureIndexLightList
Array defining shadow texture index in light list.
SceneNode * mSkyDomeNode
vector< SceneNode * >::type SceneNodeList
UniformScalableTask * mUserTask
Vector3 localDirection
Local 'normal' direction vector.
uint8 lastRq
Last RenderQueue ID to render (exclusive)
vector< RenderObjectListener * >::type RenderObjectListenerList
AnimationStateIterator getAnimationStateIterator(void)
Returns a specialised MapIterator over all animation states in the scene.
Rectangle2D * mFullScreenQuad
Default implementation of AxisAlignedBoxSceneQuery.
VisibleObjectsPerThreadArray mVisibleObjects
Contains MovableObjects to be visited and rendered.
virtual bool getOption(const String &strKey, void *pDestValue)
Method for getting the value of an implementation-specific Scene Manager option.
SceneMemoryMgrTypes
The types of NodeMemoryManager & ObjectMemoryManagers.
Definition: OgreCommon.h:318
#define OGRE_NEW
AutoTrackingSceneNode(SceneNode *_source, SceneNode *_target, const Vector3 &_offset, const Vector3 &_localDirection)
SpecialCaseRenderQueueList mSpecialCaseQueueList
ObjectMemoryManagerVec mLightsMemoryManagerCulledList
InstanceManagerVec mInstanceManagers
Class to manage the scene object rendering queue.
Specialises the SceneQuery class for querying within an axis aligned box.
void _setCurrentRenderStage(IlluminationRenderStage stage)
ObjectMemoryManagerVec mEntitiesMemoryManagerUpdateList
map< IdString, Camera * >::type CameraMap
vector< RenderQueueListener * >::type RenderQueueListenerList
This is the main starting point for the new instancing system.
CompositorTextureVec mCompositorTextures
virtual CompositorChain * _getActiveCompositorChain() const
Gets the active compositor chain of the current scene being rendered.
const AnimationList & getAnimations() const
Returns a const version of the animation list.
SkeletonAnimManagerVec mSkeletonAnimManagerCulledList
set< LodListener * >::type LodListenerSet
Set of registered LOD listeners.
ColourValue mShadowColour
Specialises the SceneQuery class for querying within a plane-bounded volume.
virtual void setFlipCullingOnNegativeScale(bool n)
Set whether to automatically flip the culling mode on objects whenever they are negatively scaled...
Default implementation of PlaneBoundedVolumeListSceneQuery.
ClipResult
Generic result of clipping.
Definition: OgreCommon.h:770
Structure for holding a position & orientation pair.
_StringBase String
Definition: OgreCommon.h:53
virtual void setShadowCasterRenderBackFaces(bool bf)
Sets whether or not shadow casters should be rendered into shadow textures using their back faces rat...
virtual void setFindVisibleObjects(bool find)
Sets whether the SceneManager should search for visible objects, or whether they are being manually h...
Real range
Use int instead of Light::LightTypes to avoid header file dependence.
size_t getNumCompositorTextures(void) const
Gets the number of currently active compositor textures.
InstancingTheadedCullingMethod mInstancingThreadedCullingMethod
Separate SceneQuery class to query for pairs of objects which are possibly intersecting one another...
unsigned short uint16
Definition: OgrePlatform.h:421
InstancingTheadedCullingMethod getInstancingThreadedCullingMethod() const
virtual SceneNode * getSkyBoxNode(void) const
Get the skybox node, if enabled.
CompositorChain * mActiveCompositorChain
A uniform task is a highly parallelizable task that can be divided in many threads where all threads ...
virtual void postFindVisibleObjects(SceneManager *source, IlluminationRenderStage irs, Viewport *v)
Called after searching for visible objects in this SceneManager.
This optional class allows you to receive per-result callbacks from SceneQuery executions instead of ...
Camera * getCameraInProgress(void) const
Gets the current camera being rendered (advanced use only, only valid during viewport update...
Concrete IteratorWrapper for nonconst access to the underlying container.
virtual void shadowTextureCasterPreViewProj(const Light *light, Camera *camera, size_t iteration)
This event occurs just before the view & projection matrices are set for rendering into a shadow text...
Vector3 position
Sets to zero if directional light.
SceneManager * targetSceneMgr
Target SM to send renderables to.
vector< TexturePtr >::type TextureVec
Defines the functionality of a 3D API.
RequestType mRequestType
virtual void setLateMaterialResolving(bool isLate)
Sets whether to use late material resolving or not.
An animation sequence.
Definition: OgreAnimation.h:90
virtual AutoParamDataSource * createAutoParamDataSource(void) const
Internal method for creating the AutoParamDataSource instance.
ObjectMemoryManagerVec mEntitiesMemoryManagerCulledList
LodListenerSet mLodListeners
Specialises the SceneQuery class for querying along a ray.
Shadow Nodes are special nodes (not to be confused with.
bool mShowBoundingBoxes
Flag that indicates if all of the scene node's bounding boxes should be shown as a wireframe...
Structure containing information about a scene manager.
Class representing a general-purpose node an articulated scene graph.
Definition: OgreNode.h:58
ObjectMemoryManagerVec const * objectMemManager
Memory manager of the objects to cull.
Barrier * mWorkerThreadsBarrier
virtual const SceneManagerMetaData & getMetaData(void) const
Get information about the SceneManager type created by this factory.
Cached light information, used to tracking light's changes.
const String & getName(void) const
Return the instance name of this SceneManager.
Instance of a Skeleton, main external interface for retrieving bone positions and applying animations...
vector< EntityMeshLodChangedEvent >::type EntityMeshLodChangedEventList
List of entity mesh LOD changed events.
UpdateLodRequest mUpdateLodRequest
Wrap-around class that contains multiple ArrayMemoryManager, one per hierarchy depth.
String description
A text description of the scene manager.
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
Class which will create instances of a given SceneManager.
This utility class is used to hold the information used to generate the matrices and other informatio...
virtual void setSkyBoxEnabled(bool enable)
Enables / disables a 'sky box'.
EntityMeshLodChangedEventList mEntityMeshLodChangedEvents
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
bool mDisplayNodes
Flag indicating whether SceneNodes will be rendered as a set of 3 axes.
EntityMaterialLodChangedEventList mEntityMaterialLodChangedEvents