# OgreSceneManager.h

Go to the documentation of this file.

    00001 /*-------------------------------------------------------------------------
    00002 This source file is a part of OGRE
    00003 (Object-oriented Graphics Rendering Engine)
    00004
    00005 For the latest info, see http://www.ogre3d.org/
    00006
    00007 Copyright (c) 2000-2009 Torus Knot Software Ltd
    00008 Permission is hereby granted, free of charge, to any person obtaining a copy
    00009 of this software and associated documentation files (the "Software"), to deal
    00010 in the Software without restriction, including without limitation the rights
    00011 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    00012 copies of the Software, and to permit persons to whom the Software is
    00013 furnished to do so, subject to the following conditions:
    00014
    00015 The above copyright notice and this permission notice shall be included in
    00016 all copies or substantial portions of the Software.
    00017
    00018 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    00019 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00020 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    00021 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00022 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    00023 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    00024 THE SOFTWARE
    00025
    00026 You may alternatively use this source under the terms of a specific version of
    00027 the OGRE Unrestricted License provided you have obtained such a license from
    00028 Torus Knot Software Ltd.
    00029 -------------------------------------------------------------------------*/
    00030 #ifndef __SceneManager_H__
    00031 #define __SceneManager_H__
    00032
    00033 // Precompiler options
    00034 #include "OgrePrerequisites.h"
    00035
    00036 #include "OgreString.h"
    00037 #include "OgreSceneNode.h"
    00038 #include "OgrePlane.h"
    00039 #include "OgreQuaternion.h"
    00040 #include "OgreColourValue.h"
    00041 #include "OgreCommon.h"
    00042 #include "OgreSceneQuery.h"
    00043 #include "OgreAutoParamDataSource.h"
    00044 #include "OgreAnimationState.h"
    00045 #include "OgreRenderQueue.h"
    00046 #include "OgreRenderQueueSortingGrouping.h"
    00047 #include "OgreRectangle2D.h"
    00048 #include "OgrePixelFormat.h"
    00049 #include "OgreResourceGroupManager.h"
    00050 #include "OgreTexture.h"
    00051 #include "OgreShadowCameraSetup.h"
    00052 #include "OgreShadowTextureManager.h"
    00053 #include "OgreCamera.h"
    00054 #include "OgreInstancedGeometry.h"
    00055 #include "OgreLodListener.h"
    00056 #include "OgreRenderSystem.h"
    00057 namespace Ogre {
    00066     struct ViewPoint
    00067     {
    00068         Vector3 position;
    00069         Quaternion orientation;
    00070     };
    00071
    00072     // Forward declarations
    00073     class DefaultIntersectionSceneQuery;
    00074     class DefaultRaySceneQuery;
    00075     class DefaultSphereSceneQuery;
    00076     class DefaultAxisAlignedBoxSceneQuery;
    00077     class CompositorChain;
    00078
    00082     struct _OgreExport VisibleObjectsBoundsInfo
    00083     {
    00085         AxisAlignedBox aabb;
    00087         AxisAlignedBox receiverAabb;
    00089         Real minDistance;
    00091         Real maxDistance;
    00093         Real minDistanceInFrustum;
    00095         Real maxDistanceInFrustum;
    00096
    00097         VisibleObjectsBoundsInfo();
    00098         void reset();
    00099         void merge(const AxisAlignedBox& boxBounds, const Sphere& sphereBounds,
    00100             const Camera* cam, bool receiver=true);
    00104         void mergeNonRenderedButInFrustum(const AxisAlignedBox& boxBounds,
    00105             const Sphere& sphereBounds, const Camera* cam);
    00106
    00107
    00108     };
    00109
    00139     class _OgreExport SceneManager : public SceneMgtAlloc
    00140     {
    00141     public:
    00143         static uint32 WORLD_GEOMETRY_TYPE_MASK;
    00145         static uint32 ENTITY_TYPE_MASK;
    00147         static uint32 FX_TYPE_MASK;
    00149         static uint32 STATICGEOMETRY_TYPE_MASK;
    00151         static uint32 LIGHT_TYPE_MASK;
    00153         static uint32 FRUSTUM_TYPE_MASK;
    00155         static uint32 USER_TYPE_MASK_LIMIT;
    00158         struct materialLess
    00159         {
    00160             _OgreExport bool operator()(const Material* x, const Material* y) const;
    00161         };
    00163         struct lightLess
    00164         {
    00165             _OgreExport bool operator()(const Light* a, const Light* b) const;
    00166         };
    00167
    00169         enum IlluminationRenderStage
    00170         {
    00172             IRS_NONE,
    00174             IRS_RENDER_TO_TEXTURE,
    00176             IRS_RENDER_RECEIVER_PASS
    00177         };
    00178
    00183         enum SpecialCaseRenderQueueMode
    00184         {
    00186             SCRQM_INCLUDE,
    00188             SCRQM_EXCLUDE
    00189         };
    00190
    00191         struct SkyDomeGenParameters
    00192         {
    00193             Real skyDomeCurvature;
    00194             Real skyDomeTiling;
    00195             Real skyDomeDistance;
    00196             int skyDomeXSegments;
    00197             int skyDomeYSegments;
    00198             int skyDomeYSegments_keep;
    00199         };
    00200
    00201         struct SkyPlaneGenParameters
    00202         {
    00203             Real skyPlaneScale;
    00204             Real skyPlaneTiling;
    00205             Real skyPlaneBow;
    00206             int skyPlaneXSegments;
    00207             int skyPlaneYSegments;
    00208         };
    00209
    00210         struct SkyBoxGenParameters
    00211         {
    00212             Real skyBoxDistance;
    00213         };
    00214
    00218         class Listener
    00219         {
    00220         public:
    00221             Listener() {}
    00222             virtual ~Listener() {}
    00223
    00233             virtual void preFindVisibleObjects(SceneManager* source,
    00234                 IlluminationRenderStage irs, Viewport* v)
    00235                         { (void)source; (void)irs; (void)v; }
    00236
    00247             virtual void postFindVisibleObjects(SceneManager* source,
    00248                 IlluminationRenderStage irs, Viewport* v)
    00249                         { (void)source; (void)irs; (void)v; }
    00250
    00265             virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
    00266                         { (void)numberOfShadowTextures; }
    00267
    00281             virtual void shadowTextureCasterPreViewProj(Light* light,
    00282                 Camera* camera, size_t iteration)
    00283                         { (void)light; (void)camera; (void)iteration; }
    00284
    00298             virtual void shadowTextureReceiverPreViewProj(Light* light,
    00299                 Frustum* frustum)
    00300                         { (void)light; (void)frustum; }
    00301
    00324             virtual bool sortLightsAffectingFrustum(LightList& lightList)
    00325                         { (void)lightList; return false; }
    00326
    00328             virtual void sceneManagerDestroyed(SceneManager* source)
    00329                         { (void)source; }
    00330         };
    00331
    00335         class _OgreExport SceneMgrQueuedRenderableVisitor : public QueuedRenderableVisitor
    00336         {
    00337         protected:
    00339             const Pass* mUsedPass;
    00340         public:
    00341             SceneMgrQueuedRenderableVisitor()
    00342                 :transparentShadowCastersMode(false) {}
    00343             ~SceneMgrQueuedRenderableVisitor() {}
    00344             void visit(Renderable* r);
    00345             bool visit(const Pass* p);
    00346             void visit(RenderablePass* rp);
    00347
    00349             SceneManager* targetSceneMgr;
    00351             bool transparentShadowCastersMode;
    00353             bool autoLights;
    00355             const LightList* manualLightList;
    00357             bool scissoring;
    00358
    00359         };
    00361         friend class SceneMgrQueuedRenderableVisitor;
    00362
    00363     protected:
    00364
    00366         virtual SceneNode* createSceneNodeImpl(void);
    00368         virtual SceneNode* createSceneNodeImpl(const String& name);
    00369
    00371         String mName;
    00372
    00374         RenderQueue* mRenderQueue;
    00375         bool mLastRenderQueueInvocationCustom;
    00376
    00378         ColourValue mAmbientLight;
    00379
    00381         RenderSystem *mDestRenderSystem;
    00382
    00383         typedef map<String, Camera* >::type CameraList;
    00384
    00387         CameraList mCameras;
    00388
    00389         typedef map<String, StaticGeometry* >::type StaticGeometryList;
    00390         StaticGeometryList mStaticGeometryList;
    00391         typedef map<String, InstancedGeometry* >::type InstancedGeometryList;
    00392         InstancedGeometryList mInstancedGeometryList;
    00393
    00394         typedef map<String, SceneNode*>::type SceneNodeList;
    00395
    00402         SceneNodeList mSceneNodes;
    00403
    00405         Camera* mCameraInProgress;
    00407         Viewport* mCurrentViewport;
    00408
    00410         SceneNode* mSceneRoot;
    00411
    00413         typedef set<SceneNode*>::type AutoTrackingSceneNodes;
    00414         AutoTrackingSceneNodes mAutoTrackingSceneNodes;
    00415
    00416         // Sky params
    00417         // Sky plane
    00418         Entity* mSkyPlaneEntity;
    00419         Entity* mSkyDomeEntity[5];
    00420         ManualObject* mSkyBoxObj;
    00421
    00422         SceneNode* mSkyPlaneNode;
    00423         SceneNode* mSkyDomeNode;
    00424         SceneNode* mSkyBoxNode;
    00425
    00426         // Sky plane
    00427         bool mSkyPlaneEnabled;
    00428         uint8 mSkyPlaneRenderQueue;
    00429         Plane mSkyPlane;
    00430         SkyPlaneGenParameters mSkyPlaneGenParameters;
    00431         // Sky box
    00432         bool mSkyBoxEnabled;
    00433         uint8 mSkyBoxRenderQueue;
    00434         Quaternion mSkyBoxOrientation;
    00435         SkyBoxGenParameters mSkyBoxGenParameters;
    00436         // Sky dome
    00437         bool mSkyDomeEnabled;
    00438         uint8 mSkyDomeRenderQueue;
    00439         Quaternion mSkyDomeOrientation;
    00440         SkyDomeGenParameters mSkyDomeGenParameters;
    00441
    00442         // Fog
    00443         FogMode mFogMode;
    00444         ColourValue mFogColour;
    00445         Real mFogStart;
    00446         Real mFogEnd;
    00447         Real mFogDensity;
    00448
    00449         typedef set<uint8>::type SpecialCaseRenderQueueList;
    00450         SpecialCaseRenderQueueList mSpecialCaseQueueList;
    00451         SpecialCaseRenderQueueMode mSpecialCaseQueueMode;
    00452         uint8 mWorldGeometryRenderQueue;
    00453
    00454         unsigned long mLastFrameNumber;
    00455         Matrix4 mTempXform[256];
    00456         bool mResetIdentityView;
    00457         bool mResetIdentityProj;
    00458
    00459         bool mNormaliseNormalsOnScale;
    00460         bool mFlipCullingOnNegativeScale;
    00461         CullingMode mPassCullingMode;
    00462
    00463     protected:
    00464
    00472         typedef map< const Camera*, VisibleObjectsBoundsInfo>::type CamVisibleObjectsMap;
    00473         CamVisibleObjectsMap mCamVisibleObjectsMap;
    00474
    00476         typedef map< const Camera*, const Light* >::type ShadowCamLightMapping;
    00477         ShadowCamLightMapping mShadowCamLightMapping;
    00478
    00480         size_t mShadowTextureCountPerType[3];
    00481
    00483         vector<size_t>::type mShadowTextureIndexLightList;
    00484
    00486         struct _OgreExport LightInfo
    00487         {
    00488             Light* light;       // Just a pointer for comparison, the light might destroyed for some reason
    00489             int type;           // Use int instead of Light::LightTypes to avoid header file dependence
    00490             Real range;         // Sets to zero if directional light
    00491             Vector3 position;   // Sets to zero if directional light
    00492             uint32 lightMask;   // Light mask
    00493
    00494             bool operator== (const LightInfo& rhs) const
    00495             {
    00496                 return light == rhs.light && type == rhs.type &&
    00497                     range == rhs.range && position == rhs.position && lightMask == rhs.lightMask;
    00498             }
    00499
    00500             bool operator!= (const LightInfo& rhs) const
    00501             {
    00502                 return !(*this == rhs);
    00503             }
    00504         };
    00505
    00506         typedef vector<LightInfo>::type LightInfoList;
    00507
    00508         LightList mLightsAffectingFrustum;
    00509         LightInfoList mCachedLightInfos;
    00510         LightInfoList mTestLightInfos; // potentially new list
    00511         ulong mLightsDirtyCounter;
    00512         LightList mShadowTextureCurrentCasterLightList;
    00513
    00514         typedef map<String, MovableObject*>::type MovableObjectMap;
    00516         struct MovableObjectCollection
    00517         {
    00518             MovableObjectMap map;
    00519             OGRE_MUTEX(mutex)
    00520         };
    00521         typedef map<String, MovableObjectCollection*>::type MovableObjectCollectionMap;
    00522         MovableObjectCollectionMap mMovableObjectCollectionMap;
    00523         NameGenerator mMovableNameGenerator;
    00528         MovableObjectCollection* getMovableObjectCollection(const String& typeName);
    00533         const MovableObjectCollection* getMovableObjectCollection(const String& typeName) const;
    00535         OGRE_MUTEX(mMovableObjectCollectionMapMutex)
    00536
    00537
    00541         virtual void initRenderQueue(void);
    00543         Pass* mShadowCasterPlainBlackPass;
    00545         Pass* mShadowReceiverPass;
    00555         virtual const Pass* deriveShadowCasterPass(const Pass* pass);
    00564         virtual const Pass* deriveShadowReceiverPass(const Pass* pass);
    00565
    00572         virtual bool validatePassForRendering(const Pass* pass);
    00573
    00580         virtual bool validateRenderableForRendering(const Pass* pass, const Renderable* rend);
    00581
    00582         enum BoxPlane
    00583         {
    00584             BP_FRONT = 0,
    00585             BP_BACK = 1,
    00586             BP_LEFT = 2,
    00587             BP_RIGHT = 3,
    00588             BP_UP = 4,
    00589             BP_DOWN = 5
    00590         };
    00591
    00592         /* Internal utility method for creating the planes of a skybox.
    00593         */
    00594         virtual MeshPtr createSkyboxPlane(
    00595             BoxPlane bp,
    00596             Real distance,
    00597             const Quaternion& orientation,
    00598             const String& groupName);
    00599
    00600         /* Internal utility method for creating the planes of a skydome.
    00601         */
    00602         virtual MeshPtr createSkydomePlane(
    00603             BoxPlane bp,
    00604             Real curvature, Real tiling, Real distance,
    00605             const Quaternion& orientation,
    00606             int xsegments, int ysegments, int ySegmentsToKeep,
    00607             const String& groupName);
    00608
    00609         // Flag indicating whether SceneNodes will be rendered as a set of 3 axes
    00610         bool mDisplayNodes;
    00611
    00613         typedef map<String, Animation*>::type AnimationList;
    00614         AnimationList mAnimationsList;
    00615         OGRE_MUTEX(mAnimationsListMutex)
    00616         AnimationStateSet mAnimationStates;
    00617
    00618
    00621         virtual void useRenderableViewProjMode(const Renderable* pRend, bool fixedFunction);
    00622
    00625         virtual void resetViewProjMode(bool fixedFunction);
    00626
    00627         typedef vector<RenderQueueListener*>::type RenderQueueListenerList;
    00628         RenderQueueListenerList mRenderQueueListeners;
    00629
    00630         typedef vector<RenderObjectListener*>::type RenderObjectListenerList;
    00631         RenderObjectListenerList mRenderObjectListeners;
    00632         typedef vector<Listener*>::type ListenerList;
    00633         ListenerList mListeners;
    00635         virtual void firePreRenderQueues();
    00637         virtual void firePostRenderQueues();
    00639         virtual bool fireRenderQueueStarted(uint8 id, const String& invocation);
    00641         virtual bool fireRenderQueueEnded(uint8 id, const String& invocation);
    00643         virtual void fireRenderSingleObject(Renderable* rend, const Pass* pass, const AutoParamDataSource* source,
    00644             const LightList* pLightList, bool suppressRenderStateChanges);
    00645
    00647         virtual void fireShadowTexturesUpdated(size_t numberOfShadowTextures);
    00649         virtual void fireShadowTexturesPreCaster(Light* light, Camera* camera, size_t iteration);
    00651         virtual void fireShadowTexturesPreReceiver(Light* light, Frustum* f);
    00653         virtual void firePreFindVisibleObjects(Viewport* v);
    00655         virtual void firePostFindVisibleObjects(Viewport* v);
    00657         virtual void fireSceneManagerDestroyed();
    00659         virtual void setViewport(Viewport *vp);
    00660
    00662         bool mShowBoundingBoxes;
    00663
    00665         virtual void renderVisibleObjectsDefaultSequence(void);
    00667         virtual void renderVisibleObjectsCustomSequence(RenderQueueInvocationSequence* s);
    00669         virtual void prepareRenderQueue(void);
    00670
    00671
    00687         virtual void renderSingleObject(Renderable* rend, const Pass* pass,
    00688             bool lightScissoringClipping, bool doLightIteration, const LightList* manualLightList = 0);
    00689
    00691         virtual AutoParamDataSource* createAutoParamDataSource(void) const
    00692         {
    00693             return OGRE_NEW AutoParamDataSource();
    00694         }
    00695
    00697         AutoParamDataSource* mAutoParamDataSource;
    00698
    00699         CompositorChain* mActiveCompositorChain;
    00700         bool mLateMaterialResolving;
    00701
    00702         ShadowTechnique mShadowTechnique;
    00703         bool mDebugShadows;
    00704         ColourValue mShadowColour;
    00705         Pass* mShadowDebugPass;
    00706         Pass* mShadowStencilPass;
    00707         Pass* mShadowModulativePass;
    00708         bool mShadowMaterialInitDone;
    00709         HardwareIndexBufferSharedPtr mShadowIndexBuffer;
    00710         size_t mShadowIndexBufferSize;
    00711         Rectangle2D* mFullScreenQuad;
    00712         Real mShadowDirLightExtrudeDist;
    00713         IlluminationRenderStage mIlluminationStage;
    00714         ShadowTextureConfigList mShadowTextureConfigList;
    00715         bool mShadowTextureConfigDirty;
    00716         ShadowTextureList mShadowTextures;
    00717         TexturePtr mNullShadowTexture;
    00718         typedef vector<Camera*>::type ShadowTextureCameraList;
    00719         ShadowTextureCameraList mShadowTextureCameras;
    00720         Texture* mCurrentShadowTexture;
    00721         bool mShadowUseInfiniteFarPlane;
    00722         bool mShadowCasterRenderBackFaces;
    00723         bool mShadowAdditiveLightClip;
    00725         struct LightClippingInfo
    00726         {
    00727             RealRect scissorRect;
    00728             PlaneList clipPlanes;
    00729             bool scissorValid;
    00730             unsigned long clipPlanesValid;
    00731             LightClippingInfo() : scissorValid(false), clipPlanesValid(false) {}
    00732
    00733         };
    00734         typedef map<Light*, LightClippingInfo>::type LightClippingInfoMap;
    00735         LightClippingInfoMap mLightClippingInfoMap;
    00736         unsigned long mLightClippingInfoMapFrameNumber;
    00737
    00739         ShadowCameraSetupPtr mDefaultShadowCameraSetup;
    00740
    00749         struct lightsForShadowTextureLess
    00750         {
    00751             _OgreExport bool operator()(const Light* l1, const Light* l2) const;
    00752         };
    00753
    00754
    00761         virtual void findLightsAffectingFrustum(const Camera* camera);
    00763         virtual void initShadowVolumeMaterials(void);
    00765         virtual void ensureShadowTexturesCreated();
    00767         virtual void destroyShadowTextures(void);
    00768
    00769     public:
    00773         virtual void prepareShadowTextures(Camera* cam, Viewport* vp, const LightList* lightList = 0);
    00774
    00775         //A render context, used to store internal data for pausing/resuming rendering
    00776         struct RenderContext
    00777         {
    00778             RenderQueue* renderQueue;
    00779             Viewport* viewport;
    00780             Camera* camera;
    00781             CompositorChain* activeChain;
    00782             RenderSystem::RenderSystemContext* rsContext;
    00783         };
    00784
    00788         virtual RenderContext* _pauseRendering();
    00792         virtual void _resumeRendering(RenderContext* context);
    00793
    00794     protected:
    00802         virtual void renderShadowVolumesToStencil(const Light* light, const Camera* cam,
    00803             bool calcScissor);
    00809         virtual void setShadowVolumeStencilState(bool secondpass, bool zfail, bool twosided);
    00811         void renderShadowVolumeObjects(ShadowCaster::ShadowRenderableListIterator iShadowRenderables,
    00812             Pass* pass, const LightList *manualLightList, unsigned long flags,
    00813             bool secondpass, bool zfail, bool twosided);
    00814         typedef vector<ShadowCaster*>::type ShadowCasterList;
    00815         ShadowCasterList mShadowCasterList;
    00816         SphereSceneQuery* mShadowCasterSphereQuery;
    00817         AxisAlignedBoxSceneQuery* mShadowCasterAABBQuery;
    00818         Real mDefaultShadowFarDist;
    00819         Real mDefaultShadowFarDistSquared;
    00820         Real mShadowTextureOffset; // proportion of texture offset in view direction e.g. 0.4
    00821         Real mShadowTextureFadeStart; // as a proportion e.g. 0.6
    00822         Real mShadowTextureFadeEnd; // as a proportion e.g. 0.9
    00823         bool mShadowTextureSelfShadow;
    00824         Pass* mShadowTextureCustomCasterPass;
    00825         Pass* mShadowTextureCustomReceiverPass;
    00826         String mShadowTextureCustomCasterVertexProgram;
    00827         String mShadowTextureCustomReceiverVertexProgram;
    00828         String mShadowTextureCustomReceiverFragmentProgram;
    00829         GpuProgramParametersSharedPtr mShadowTextureCustomCasterVPParams;
    00830         GpuProgramParametersSharedPtr mShadowTextureCustomReceiverVPParams;
    00831         GpuProgramParametersSharedPtr mShadowTextureCustomReceiverFPParams;
    00832
    00834         uint32 mVisibilityMask;
    00835         bool mFindVisibleObjects;
    00836
    00838         bool mSuppressRenderStateChanges;
    00840         bool mSuppressShadows;
    00841
    00842
    00843         GpuProgramParametersSharedPtr mInfiniteExtrusionParams;
    00844         GpuProgramParametersSharedPtr mFiniteExtrusionParams;
    00845
    00847         class _OgreExport ShadowCasterSceneQueryListener : public SceneQueryListener, public SceneMgtAlloc
    00848         {
    00849         protected:
    00850             SceneManager* mSceneMgr;
    00851             ShadowCasterList* mCasterList;
    00852             bool mIsLightInFrustum;
    00853             const PlaneBoundedVolumeList* mLightClipVolumeList;
    00854             const Camera* mCamera;
    00855             const Light* mLight;
    00856             Real mFarDistSquared;
    00857         public:
    00858             ShadowCasterSceneQueryListener(SceneManager* sm) : mSceneMgr(sm),
    00859                 mCasterList(0), mIsLightInFrustum(false), mLightClipVolumeList(0),
    00860                 mCamera(0) {}
    00861             // Prepare the listener for use with a set of parameters
    00862             void prepare(bool lightInFrustum,
    00863                 const PlaneBoundedVolumeList* lightClipVolumes,
    00864                 const Light* light, const Camera* cam, ShadowCasterList* casterList,
    00865                 Real farDistSquared)
    00866             {
    00867                 mCasterList = casterList;
    00868                 mIsLightInFrustum = lightInFrustum;
    00869                 mLightClipVolumeList = lightClipVolumes;
    00870                 mCamera = cam;
    00871                 mLight = light;
    00872                 mFarDistSquared = farDistSquared;
    00873             }
    00874             bool queryResult(MovableObject* object);
    00875             bool queryResult(SceneQuery::WorldFragment* fragment);
    00876         };
    00877
    00878         ShadowCasterSceneQueryListener* mShadowCasterQueryListener;
    00879
    00886         virtual const ShadowCasterList& findShadowCastersForLight(const Light* light,
    00887             const Camera* camera);
    00889         virtual void renderBasicQueueGroupObjects(RenderQueueGroup* pGroup,
    00890             QueuedRenderableCollection::OrganisationMode om);
    00892         virtual void renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* group,
    00893             QueuedRenderableCollection::OrganisationMode om);
    00895         virtual void renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* group,
    00896             QueuedRenderableCollection::OrganisationMode om);
    00898         virtual void renderTextureShadowCasterQueueGroupObjects(RenderQueueGroup* group,
    00899             QueuedRenderableCollection::OrganisationMode om);
    00901         virtual void renderTextureShadowReceiverQueueGroupObjects(RenderQueueGroup* group,
    00902             QueuedRenderableCollection::OrganisationMode om);
    00904         virtual void renderModulativeTextureShadowedQueueGroupObjects(RenderQueueGroup* group,
    00905             QueuedRenderableCollection::OrganisationMode om);
    00906
    00908         virtual void renderAdditiveTextureShadowedQueueGroupObjects(RenderQueueGroup* group,
    00909             QueuedRenderableCollection::OrganisationMode om);
    00911         virtual void renderObjects(const QueuedRenderableCollection& objs,
    00912             QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping,
    00913             bool doLightIteration, const LightList* manualLightList = 0);
    00919         virtual void renderTransparentShadowCasterObjects(const QueuedRenderableCollection& objs,
    00920             QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping,
    00921             bool doLightIteration, const LightList* manualLightList = 0);
    00922
    00925         virtual void updateRenderQueueSplitOptions(void);
    00928         virtual void updateRenderQueueGroupSplitOptions(RenderQueueGroup* group,
    00929             bool suppressShadows, bool suppressRenderState);
    00930
    00932         virtual ClipResult buildAndSetScissor(const LightList& ll, const Camera* cam);
    00934         virtual void buildScissor(const Light* l, const Camera* cam, RealRect& rect);
    00935         virtual void resetScissor();
    00937         virtual ClipResult buildAndSetLightClip(const LightList& ll);
    00938         virtual void buildLightClip(const Light* l, PlaneList& planes);
    00939         virtual void resetLightClip();
    00940         virtual void checkCachedLightClippingInfo();
    00941
    00943         SceneMgrQueuedRenderableVisitor* mActiveQueuedRenderableVisitor;
    00945         SceneMgrQueuedRenderableVisitor mDefaultQueuedRenderableVisitor;
    00946
    00948         bool mCameraRelativeRendering;
    00949         Matrix4 mCachedViewMatrix;
    00950         Vector3 mCameraRelativePosition;
    00951
    00953         uint32 mLastLightHash;
    00954         unsigned short mLastLightLimit;
    00955         uint32 mLastLightHashGpuProgram;
    00957         uint16 mGpuParamsDirty;
    00958
    00959         virtual void useLights(const LightList& lights, unsigned short limit);
    00960         virtual void setViewMatrix(const Matrix4& m);
    00961         virtual void useLightsGpuProgram(const Pass* pass, const LightList* lights);
    00962         virtual void bindGpuProgram(GpuProgram* prog);
    00963         virtual void updateGpuProgramParameters(const Pass* p);
    00964
    00965
    00966
    00967
    00968
    00969
    00970
    00971
    00973         typedef set<LodListener*>::type LodListenerSet;
    00974         LodListenerSet mLodListeners;
    00975
    00977         typedef vector<MovableObjectLodChangedEvent>::type MovableObjectLodChangedEventList;
    00978         MovableObjectLodChangedEventList mMovableObjectLodChangedEvents;
    00979
    00981         typedef vector<EntityMeshLodChangedEvent>::type EntityMeshLodChangedEventList;
    00982         EntityMeshLodChangedEventList mEntityMeshLodChangedEvents;
    00983
    00985         typedef vector<EntityMaterialLodChangedEvent>::type EntityMaterialLodChangedEventList;
    00986         EntityMaterialLodChangedEventList mEntityMaterialLodChangedEvents;
    00987
    00988     public:
    00991         SceneManager(const String& instanceName);
    00992
    00995         virtual ~SceneManager();
    00996
    00997
    01023         OGRE_MUTEX(sceneGraphMutex)
    01024
    01025
    01026         const String& getName(void) const { return mName; }
    01027
    01034         virtual const String& getTypeName(void) const = 0;
    01035
    01043         virtual Camera* createCamera(const String& name);
    01044
    01048         virtual Camera* getCamera(const String& name) const;
    01049
    01052         virtual bool hasCamera(const String& name) const;
    01053
    01062         virtual void destroyCamera(Camera *cam);
    01063
    01069         virtual void destroyCamera(const String& name);
    01070
    01079         virtual void destroyAllCameras(void);
    01080
    01091         virtual Light* createLight(const String& name);
    01092
    01094         virtual Light* createLight();
    01095
    01099         virtual Light* getLight(const String& name) const;
    01100
    01103         virtual bool hasLight(const String& name) const;
    01104
    01107         virtual const PlaneList& getLightClippingPlanes(Light* l);
    01108
    01111         virtual const RealRect& getLightScissorRect(Light* l, const Camera* cam);
    01112
    01117         virtual void destroyLight(const String& name);
    01118
    01123         virtual void destroyLight(Light* light);
    01126         virtual void destroyAllLights(void);
    01127
    01138         virtual void _notifyLightsDirty(void);
    01139
    01152         ulong _getLightsDirtyCounter(void) const { return mLightsDirtyCounter; }
    01153
    01160         virtual const LightList& _getLightsAffectingFrustum(void) const;
    01161
    01184         virtual void _populateLightList(const Vector3& position, Real radius, LightList& destList, uint32 lightMask = 0xFFFFFFFF);
    01185
    01214         virtual void _populateLightList(const SceneNode* sn, Real radius, LightList& destList, uint32 lightMask = 0xFFFFFFFF);
    01215
    01232         virtual SceneNode* createSceneNode(void);
    01233
    01248         virtual SceneNode* createSceneNode(const String& name);
    01249
    01256         virtual void destroySceneNode(const String& name);
    01257
    01264         virtual void destroySceneNode(SceneNode* sn);
    01280         virtual SceneNode* getRootSceneNode(void);
    01281
    01289         virtual SceneNode* getSceneNode(const String& name) const;
    01290
    01293         virtual bool hasSceneNode(const String& name) const;
    01294
    01295
    01303         virtual Entity* createEntity(const String& entityName, const String& meshName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME );
    01304
    01310         virtual Entity* createEntity(const String& meshName);
    01317         enum PrefabType {
    01318             PT_PLANE,
    01319             PT_CUBE,
    01320             PT_SPHERE
    01321         };
    01322
    01329         virtual Entity* createEntity(const String& entityName, PrefabType ptype);
    01330
    01334         virtual Entity* createEntity(PrefabType ptype);
    01338         virtual Entity* getEntity(const String& name) const;
    01341         virtual bool hasEntity(const String& name) const;
    01342
    01351         virtual void destroyEntity(Entity* ent);
    01352
    01361         virtual void destroyEntity(const String& name);
    01362
    01372         virtual void destroyAllEntities(void);
    01373
    01379         virtual ManualObject* createManualObject(const String& name);
    01383         virtual ManualObject* createManualObject();
    01387         virtual ManualObject* getManualObject(const String& name) const;
    01390         virtual bool hasManualObject(const String& name) const;
    01391
    01394         virtual void destroyManualObject(ManualObject* obj);
    01397         virtual void destroyManualObject(const String& name);
    01400         virtual void destroyAllManualObjects(void);
    01406         virtual BillboardChain* createBillboardChain(const String& name);
    01410         virtual BillboardChain* createBillboardChain();
    01414         virtual BillboardChain* getBillboardChain(const String& name) const;
    01417         virtual bool hasBillboardChain(const String& name) const;
    01418
    01421         virtual void destroyBillboardChain(BillboardChain* obj);
    01424         virtual void destroyBillboardChain(const String& name);
    01427         virtual void destroyAllBillboardChains(void);
    01433         virtual RibbonTrail* createRibbonTrail(const String& name);
    01437         virtual RibbonTrail* createRibbonTrail();
    01441         virtual RibbonTrail* getRibbonTrail(const String& name) const;
    01444         virtual bool hasRibbonTrail(const String& name) const;
    01445
    01448         virtual void destroyRibbonTrail(RibbonTrail* obj);
    01451         virtual void destroyRibbonTrail(const String& name);
    01454         virtual void destroyAllRibbonTrails(void);
    01455
    01476         virtual ParticleSystem* createParticleSystem(const String& name,
    01477             const String& templateName);
    01497         virtual ParticleSystem* createParticleSystem(const String& name,
    01498             size_t quota = 500,
    01499             const String& resourceGroup = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01500
    01518         virtual ParticleSystem* createParticleSystem(size_t quota = 500,
    01519             const String& resourceGroup = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01523         virtual ParticleSystem* getParticleSystem(const String& name) const;
    01526         virtual bool hasParticleSystem(const String& name) const;
    01527
    01530         virtual void destroyParticleSystem(ParticleSystem* obj);
    01533         virtual void destroyParticleSystem(const String& name);
    01536         virtual void destroyAllParticleSystems(void);
    01537
    01543         virtual void clearScene(void);
    01544
    01557         void setAmbientLight(const ColourValue& colour);
    01558
    01561         const ColourValue& getAmbientLight(void) const;
    01562
    01578         virtual void prepareWorldGeometry(const String& filename);
    01579
    01597         virtual void prepareWorldGeometry(DataStreamPtr& stream,
    01598             const String& typeName = StringUtil::BLANK);
    01599
    01612         virtual void setWorldGeometry(const String& filename);
    01613
    01629         virtual void setWorldGeometry(DataStreamPtr& stream,
    01630             const String& typeName = StringUtil::BLANK);
    01631
    01644         virtual size_t estimateWorldGeometry(const String& filename)
    01645         { (void)filename; return 0; }
    01646
    01659         virtual size_t estimateWorldGeometry(DataStreamPtr& stream,
    01660             const String& typeName = StringUtil::BLANK)
    01661         { (void)stream; (void)typeName; return 0; }
    01662
    01677         virtual ViewPoint getSuggestedViewpoint(bool random = false);
    01678
    01692         virtual bool setOption( const String& strKey, const void* pValue )
    01693         { (void)strKey; (void)pValue; return false; }
    01694
    01708         virtual bool getOption( const String& strKey, void* pDestValue )
    01709         { (void)strKey; (void)pDestValue; return false; }
    01710
    01720         virtual bool hasOption( const String& strKey ) const
    01721         { (void)strKey; return false; }
    01722
    01737         virtual bool getOptionValues( const String& strKey, StringVector& refValueList )
    01738         { (void)strKey; (void)refValueList; return false; }
    01739
    01746         virtual bool getOptionKeys( StringVector& refKeys )
    01747         { (void)refKeys; return false; }
    01748
    01757         virtual void _updateSceneGraph(Camera* cam);
    01758
    01770         virtual void _findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters);
    01771
    01776         virtual void _applySceneAnimations(void);
    01777
    01780         virtual void _renderVisibleObjects(void);
    01781
    01795         virtual void _renderScene(Camera* camera, Viewport* vp, bool includeOverlays);
    01796
    01800         virtual void _queueSkiesForRendering(Camera* cam);
    01801
    01802
    01803
    01812         virtual void _setDestinationRenderSystem(RenderSystem* sys);
    01813
    01867         virtual void setSkyPlane(
    01868             bool enable,
    01869             const Plane& plane, const String& materialName, Real scale = 1000,
    01870             Real tiling = 10, bool drawFirst = true, Real bow = 0,
    01871             int xsegments = 1, int ysegments = 1,
    01872             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01916         virtual void _setSkyPlane(
    01917             bool enable,
    01918             const Plane& plane, const String& materialName, Real scale = 1000,
    01919             Real tiling = 10, uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY, Real bow = 0,
    01920             int xsegments = 1, int ysegments = 1,
    01921             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01922
    01924         virtual void setSkyPlaneEnabled(bool enable) { mSkyPlaneEnabled = enable; }
    01925
    01927         virtual bool isSkyPlaneEnabled(void) const { return mSkyPlaneEnabled; }
    01928
    01930         virtual SceneNode* getSkyPlaneNode(void) const { return mSkyPlaneNode; }
    01931
    01933         virtual const SkyPlaneGenParameters& getSkyPlaneGenParameters(void) const { return mSkyPlaneGenParameters; }
    01934
    01976         virtual void setSkyBox(
    01977             bool enable, const String& materialName, Real distance = 5000,
    01978             bool drawFirst = true, const Quaternion& orientation = Quaternion::IDENTITY,
    01979             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01980
    02013         virtual void _setSkyBox(
    02014             bool enable, const String& materialName, Real distance = 5000,
    02015             uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY, const Quaternion& orientation = Quaternion::IDENTITY,
    02016             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    02017
    02019         virtual void setSkyBoxEnabled(bool enable) { mSkyBoxEnabled = enable; }
    02020
    02022         virtual bool isSkyBoxEnabled(void) const { return mSkyBoxEnabled; }
    02023
    02025         virtual SceneNode* getSkyBoxNode(void) const { return mSkyBoxNode; }
    02026
    02028         virtual const SkyBoxGenParameters& getSkyBoxGenParameters(void) const { return mSkyBoxGenParameters; }
    02029
    02085         virtual void setSkyDome(
    02086             bool enable, const String& materialName, Real curvature = 10,
    02087             Real tiling = 8, Real distance = 4000, bool drawFirst = true,
    02088             const Quaternion& orientation = Quaternion::IDENTITY,
    02089             int xsegments = 16, int ysegments = 16, int ysegments_keep = -1,
    02090             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    02091
    02138         virtual void _setSkyDome(
    02139             bool enable, const String& materialName, Real curvature = 10,
    02140             Real tiling = 8, Real distance = 4000, uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY,
    02141             const Quaternion& orientation = Quaternion::IDENTITY,
    02142             int xsegments = 16, int ysegments = 16, int ysegments_keep = -1,
    02143             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    02144
    02146         virtual void setSkyDomeEnabled(bool enable) { mSkyDomeEnabled = enable; }
    02147
    02149         virtual bool isSkyDomeEnabled(void) const { return mSkyDomeEnabled; }
    02150
    02152         virtual SceneNode* getSkyDomeNode(void) const { return mSkyDomeNode; }
    02153
    02155         virtual const SkyDomeGenParameters& getSkyDomeGenParameters(void) const { return mSkyDomeGenParameters; }
    02156
    02181         void setFog(
    02182             FogMode mode = FOG_NONE, const ColourValue& colour = ColourValue::White,
    02183             Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0);
    02184
    02187         virtual FogMode getFogMode(void) const;
    02188
    02191         virtual const ColourValue& getFogColour(void) const;
    02192
    02195         virtual Real getFogStart(void) const;
    02196
    02199         virtual Real getFogEnd(void) const;
    02200
    02203         virtual Real getFogDensity(void) const;
    02204
    02205
    02223         virtual BillboardSet* createBillboardSet(const String& name, unsigned int poolSize = 20);
    02224
    02231         virtual BillboardSet* createBillboardSet(unsigned int poolSize = 20);
    02235         virtual BillboardSet* getBillboardSet(const String& name) const;
    02238         virtual bool hasBillboardSet(const String& name) const;
    02239
    02246         virtual void destroyBillboardSet(BillboardSet* set);
    02247
    02254         virtual void destroyBillboardSet(const String& name);
    02255
    02265         virtual void destroyAllBillboardSets(void);
    02266
    02274         virtual void setDisplaySceneNodes(bool display);
    02276         virtual bool getDisplaySceneNodes(void) const {return mDisplayNodes;}
    02277
    02298         virtual Animation* createAnimation(const String& name, Real length);
    02299
    02303         virtual Animation* getAnimation(const String& name) const;
    02306         virtual bool hasAnimation(const String& name) const;
    02307
    02313         virtual void destroyAnimation(const String& name);
    02314
    02316         virtual void destroyAllAnimations(void);
    02317
    02345         virtual AnimationState* createAnimationState(const String& animName);
    02346
    02350         virtual AnimationState* getAnimationState(const String& animName) const;
    02353         virtual bool hasAnimationState(const String& name) const;
    02354
    02360         virtual void destroyAnimationState(const String& name);
    02361
    02363         virtual void destroyAllAnimationStates(void);
    02364
    02388         virtual void manualRender(RenderOperation* rend, Pass* pass, Viewport* vp,
    02389             const Matrix4& worldMatrix, const Matrix4& viewMatrix, const Matrix4& projMatrix,
    02390             bool doBeginEndFrame = false) ;
    02391
    02412         virtual void manualRender(Renderable* rend, const Pass* pass, Viewport* vp,
    02413             const Matrix4& viewMatrix, const Matrix4& projMatrix, bool doBeginEndFrame = false, bool lightScissoringClipping = true,
    02414             bool doLightIteration = true, const LightList* manualLightList = 0);
    02415
    02426         virtual RenderQueue* getRenderQueue(void);
    02427
    02431         virtual void addRenderQueueListener(RenderQueueListener* newListener);
    02432
    02434         virtual void removeRenderQueueListener(RenderQueueListener* delListener);
    02435
    02438         virtual void addRenderObjectListener(RenderObjectListener* newListener);
    02440         virtual void removeRenderObjectListener(RenderObjectListener* delListener);
    02441
    02455         virtual void addSpecialCaseRenderQueue(uint8 qid);
    02461         virtual void removeSpecialCaseRenderQueue(uint8 qid);
    02465         virtual void clearSpecialCaseRenderQueues(void);
    02470         virtual void setSpecialCaseRenderQueueMode(SpecialCaseRenderQueueMode mode);
    02472         virtual SpecialCaseRenderQueueMode getSpecialCaseRenderQueueMode(void);
    02479         virtual bool isRenderQueueToBeProcessed(uint8 qid);
    02480
    02496         virtual void setWorldGeometryRenderQueue(uint8 qid);
    02507         virtual uint8 getWorldGeometryRenderQueue(void);
    02508
    02510         virtual void showBoundingBoxes(bool bShow);
    02511
    02513         virtual bool getShowBoundingBoxes() const;
    02514
    02516         virtual void _notifyAutotrackingSceneNode(SceneNode* node, bool autoTrack);
    02517
    02518
    02531         virtual AxisAlignedBoxSceneQuery*
    02532             createAABBQuery(const AxisAlignedBox& box, unsigned long mask = 0xFFFFFFFF);
    02545         virtual SphereSceneQuery*
    02546             createSphereQuery(const Sphere& sphere, unsigned long mask = 0xFFFFFFFF);
    02559         virtual PlaneBoundedVolumeListSceneQuery*
    02560             createPlaneBoundedVolumeQuery(const PlaneBoundedVolumeList& volumes, unsigned long mask = 0xFFFFFFFF);
    02561
    02562
    02575         virtual RaySceneQuery*
    02576             createRayQuery(const Ray& ray, unsigned long mask = 0xFFFFFFFF);
    02577         //PyramidSceneQuery* createPyramidQuery(const Pyramid& p, unsigned long mask = 0xFFFFFFFF);
    02589         virtual IntersectionSceneQuery*
    02590             createIntersectionQuery(unsigned long mask = 0xFFFFFFFF);
    02591
    02593         virtual void destroyQuery(SceneQuery* query);
    02594
    02595         typedef MapIterator<CameraList> CameraIterator;
    02596         typedef MapIterator<AnimationList> AnimationIterator;
    02597
    02600         CameraIterator getCameraIterator(void) {
    02601             return CameraIterator(mCameras.begin(), mCameras.end());
    02602         }
    02605         const CameraList& getCameras() const { return mCameras; }
    02607         AnimationIterator getAnimationIterator(void) {
    02608             return AnimationIterator(mAnimationsList.begin(), mAnimationsList.end());
    02609         }
    02612         const AnimationList& getAnimations() const { return mAnimationsList; }
    02614         AnimationStateIterator getAnimationStateIterator(void) {
    02615             return mAnimationStates.getAnimationStateIterator();
    02616         }
    02617
    02650         virtual void setShadowTechnique(ShadowTechnique technique);
    02651
    02653         virtual ShadowTechnique getShadowTechnique(void) const { return mShadowTechnique; }
    02654
    02656         virtual void setShowDebugShadows(bool debug) { mDebugShadows = debug; }
    02658         virtual bool getShowDebugShadows(void ) const { return mDebugShadows; }
    02659
    02666         virtual void setShadowColour(const ColourValue& colour);
    02673         virtual const ColourValue& getShadowColour(void) const;
    02685         virtual void setShadowDirectionalLightExtrusionDistance(Real dist);
    02688         virtual Real getShadowDirectionalLightExtrusionDistance(void) const;
    02705         virtual void setShadowFarDistance(Real distance);
    02709         virtual Real getShadowFarDistance(void) const
    02710         { return mDefaultShadowFarDist; }
    02711         virtual Real getShadowFarDistanceSquared(void) const
    02712         { return mDefaultShadowFarDistSquared; }
    02713
    02739         virtual void setShadowIndexBufferSize(size_t size);
    02741         virtual size_t getShadowIndexBufferSize(void) const
    02742         { return mShadowIndexBufferSize; }
    02751         virtual void setShadowTextureSize(unsigned short size);
    02752
    02759         virtual void setShadowTextureConfig(size_t shadowIndex, unsigned short width,
    02760             unsigned short height, PixelFormat format);
    02766         virtual void setShadowTextureConfig(size_t shadowIndex,
    02767             const ShadowTextureConfig& config);
    02768
    02770         ConstShadowTextureConfigIterator getShadowTextureConfigIterator() const;
    02771
    02783         virtual void setShadowTexturePixelFormat(PixelFormat fmt);
    02791         virtual void setShadowTextureCount(size_t count);
    02793         size_t getShadowTextureCount(void) const {return mShadowTextureConfigList.size(); }
    02794
    02804         void setShadowTextureCountPerLightType(Light::LightTypes type, size_t count)
    02805         { mShadowTextureCountPerType[type] = count; }
    02807         size_t getShadowTextureCountPerLightType(Light::LightTypes type) const
    02808         {return mShadowTextureCountPerType[type]; }
    02809
    02818         virtual void setShadowTextureSettings(unsigned short size, unsigned short count,
    02819             PixelFormat fmt = PF_X8R8G8B8);
    02820
    02827         virtual const TexturePtr& getShadowTexture(size_t shadowIndex);
    02828
    02843         virtual void setShadowDirLightTextureOffset(Real offset) { mShadowTextureOffset = offset;}
    02847         virtual Real getShadowDirLightTextureOffset(void)  const { return mShadowTextureOffset; }
    02855         virtual void setShadowTextureFadeStart(Real fadeStart)
    02856         { mShadowTextureFadeStart = fadeStart; }
    02864         virtual void setShadowTextureFadeEnd(Real fadeEnd)
    02865         { mShadowTextureFadeEnd = fadeEnd; }
    02866
    02879         virtual void setShadowTextureSelfShadow(bool selfShadow);
    02880
    02882         virtual bool getShadowTextureSelfShadow(void) const
    02883         { return mShadowTextureSelfShadow; }
    02904         virtual void setShadowTextureCasterMaterial(const String& name);
    02926         virtual void setShadowTextureReceiverMaterial(const String& name);
    02927
    02938         virtual void setShadowCasterRenderBackFaces(bool bf) { mShadowCasterRenderBackFaces = bf; }
    02939
    02943         virtual bool getShadowCasterRenderBackFaces() const { return mShadowCasterRenderBackFaces; }
    02944
    02949         virtual void setShadowCameraSetup(const ShadowCameraSetupPtr& shadowSetup);
    02950
    02955         virtual const ShadowCameraSetupPtr& getShadowCameraSetup() const;
    02956
    02993         virtual void setShadowUseInfiniteFarPlane(bool enable) {
    02994             mShadowUseInfiniteFarPlane = enable; }
    02995
    02997         virtual bool isShadowTechniqueStencilBased(void) const
    02998         { return (mShadowTechnique & SHADOWDETAILTYPE_STENCIL) != 0; }
    03000         virtual bool isShadowTechniqueTextureBased(void) const
    03001         { return (mShadowTechnique & SHADOWDETAILTYPE_TEXTURE) != 0; }
    03003         virtual bool isShadowTechniqueModulative(void) const
    03004         { return (mShadowTechnique & SHADOWDETAILTYPE_MODULATIVE) != 0; }
    03006         virtual bool isShadowTechniqueAdditive(void) const
    03007         { return (mShadowTechnique & SHADOWDETAILTYPE_ADDITIVE) != 0; }
    03009         virtual bool isShadowTechniqueIntegrated(void) const
    03010         { return (mShadowTechnique & SHADOWDETAILTYPE_INTEGRATED) != 0; }
    03012         virtual bool isShadowTechniqueInUse(void) const
    03013         { return mShadowTechnique != SHADOWTYPE_NONE; }
    03017         virtual void setShadowUseLightClipPlanes(bool enabled) { mShadowAdditiveLightClip = enabled; }
    03021         virtual bool getShadowUseLightClipPlanes() const { return mShadowAdditiveLightClip; }
    03022
    03026         virtual void _setActiveCompositorChain(CompositorChain* chain) { mActiveCompositorChain = chain; }
    03027
    03033         virtual void setLateMaterialResolving(bool isLate) { mLateMaterialResolving = isLate; }
    03034
    03037         virtual bool isLateMaterialResolving() const { return mLateMaterialResolving; }
    03038
    03040         virtual CompositorChain* _getActiveCompositorChain() const { return mActiveCompositorChain; }
    03041
    03044         virtual void addListener(Listener* s);
    03047         virtual void removeListener(Listener* s);
    03048
    03058         virtual StaticGeometry* createStaticGeometry(const String& name);
    03062         virtual StaticGeometry* getStaticGeometry(const String& name) const;
    03064         virtual bool hasStaticGeometry(const String& name) const;
    03066         virtual void destroyStaticGeometry(StaticGeometry* geom);
    03068         virtual void destroyStaticGeometry(const String& name);
    03070         virtual void destroyAllStaticGeometry(void);
    03071
    03081         virtual InstancedGeometry* createInstancedGeometry(const String& name);
    03083         virtual InstancedGeometry* getInstancedGeometry(const String& name) const;
    03085         virtual void destroyInstancedGeometry(InstancedGeometry* geom);
    03087         virtual void destroyInstancedGeometry(const String& name);
    03089         virtual void destroyAllInstancedGeometry(void);
    03090
    03091
    03102         virtual MovableObject* createMovableObject(const String& name,
    03103             const String& typeName, const NameValuePairList* params = 0);
    03113         virtual MovableObject* createMovableObject(const String& typeName, const NameValuePairList* params = 0);
    03119         virtual void destroyMovableObject(const String& name, const String& typeName);
    03125         virtual void destroyMovableObject(MovableObject* m);
    03127         virtual void destroyAllMovableObjectsByType(const String& typeName);
    03129         virtual void destroyAllMovableObjects(void);
    03133         virtual MovableObject* getMovableObject(const String& name, const String& typeName) const;
    03135         virtual bool hasMovableObject(const String& name, const String& typeName) const;
    03136         typedef MapIterator<MovableObjectMap> MovableObjectIterator;
    03142         virtual MovableObjectIterator getMovableObjectIterator(const String& typeName);
    03154         virtual void injectMovableObject(MovableObject* m);
    03161         virtual void extractMovableObject(const String& name, const String& typeName);
    03168         virtual void extractMovableObject(MovableObject* m);
    03175         virtual void extractAllMovableObjectsByType(const String& typeName);
    03176
    03183         virtual void setVisibilityMask(uint32 vmask) { mVisibilityMask = vmask; }
    03184
    03188         virtual uint32 getVisibilityMask(void) { return mVisibilityMask; }
    03189
    03193         uint32 _getCombinedVisibilityMask(void) const;
    03194
    03201         virtual void setFindVisibleObjects(bool find) { mFindVisibleObjects = find; }
    03202
    03206         virtual bool getFindVisibleObjects(void) { return mFindVisibleObjects; }
    03207
    03216         virtual void setNormaliseNormalsOnScale(bool n) { mNormaliseNormalsOnScale = n; }
    03217
    03221         virtual bool getNormaliseNormalsOnScale() const { return mNormaliseNormalsOnScale; }
    03222
    03231         virtual void setFlipCullingOnNegativeScale(bool n) { mFlipCullingOnNegativeScale = n; }
    03232
    03236         virtual bool getFlipCullingOnNegativeScale() const { return mFlipCullingOnNegativeScale; }
    03237
    03243         virtual void _injectRenderWithPass(Pass *pass, Renderable *rend, bool shadowDerivation = true,
    03244             bool doLightIteration = false, const LightList* manualLightList = 0);
    03245
    03264         virtual void _suppressRenderStateChanges(bool suppress);
    03265
    03269         virtual bool _areRenderStateChangesSuppressed(void) const
    03270         { return mSuppressRenderStateChanges; }
    03271
    03284         virtual const Pass* _setPass(const Pass* pass,
    03285             bool evenIfSuppressed = false, bool shadowDerivation = true);
    03286
    03294         virtual void _markGpuParamsDirty(uint16 mask);
    03295
    03296
    03306         virtual void _suppressShadows(bool suppress);
    03307
    03311         virtual bool _areShadowsSuppressed(void) const
    03312         { return mSuppressShadows; }
    03313
    03317         virtual void _renderQueueGroupObjects(RenderQueueGroup* group,
    03318             QueuedRenderableCollection::OrganisationMode om);
    03319
    03335         void setQueuedRenderableVisitor(SceneMgrQueuedRenderableVisitor* visitor);
    03336
    03338         SceneMgrQueuedRenderableVisitor* getQueuedRenderableVisitor(void) const;
    03339
    03340
    03344         RenderSystem *getDestinationRenderSystem();
    03345
    03348         Viewport* getCurrentViewport(void) const { return mCurrentViewport; }
    03349
    03351         const VisibleObjectsBoundsInfo& getVisibleObjectsBoundsInfo(const Camera* cam) const;
    03352
    03354         const VisibleObjectsBoundsInfo& getShadowCasterBoundsInfo(const Light* light, size_t iteration = 0) const;
    03355
    03370         virtual void setCameraRelativeRendering(bool rel) { mCameraRelativeRendering = rel; }
    03371
    03375         virtual bool getCameraRelativeRendering() const { return mCameraRelativeRendering; }
    03376
    03377
    03379         void addLodListener(LodListener *listener);
    03380
    03386         void removeLodListener(LodListener *listener);
    03387
    03389         void _notifyMovableObjectLodChanged(MovableObjectLodChangedEvent& evt);
    03390
    03392         void _notifyEntityMeshLodChanged(EntityMeshLodChangedEvent& evt);
    03393
    03395         void _notifyEntityMaterialLodChanged(EntityMaterialLodChangedEvent& evt);
    03396
    03398         void _handleLodEvents();
    03399     };
    03400
    03402     class _OgreExport DefaultIntersectionSceneQuery :
    03403         public IntersectionSceneQuery
    03404     {
    03405     public:
    03406         DefaultIntersectionSceneQuery(SceneManager* creator);
    03407         ~DefaultIntersectionSceneQuery();
    03408
    03410         void execute(IntersectionSceneQueryListener* listener);
    03411     };
    03412
    03414     class _OgreExport DefaultRaySceneQuery : public RaySceneQuery
    03415     {
    03416     public:
    03417         DefaultRaySceneQuery(SceneManager* creator);
    03418         ~DefaultRaySceneQuery();
    03419
    03421         void execute(RaySceneQueryListener* listener);
    03422     };
    03424     class _OgreExport DefaultSphereSceneQuery : public SphereSceneQuery
    03425     {
    03426     public:
    03427         DefaultSphereSceneQuery(SceneManager* creator);
    03428         ~DefaultSphereSceneQuery();
    03429
    03431         void execute(SceneQueryListener* listener);
    03432     };
    03434     class _OgreExport DefaultPlaneBoundedVolumeListSceneQuery : public PlaneBoundedVolumeListSceneQuery
    03435     {
    03436     public:
    03437         DefaultPlaneBoundedVolumeListSceneQuery(SceneManager* creator);
    03438         ~DefaultPlaneBoundedVolumeListSceneQuery();
    03439
    03441         void execute(SceneQueryListener* listener);
    03442     };
    03444     class _OgreExport DefaultAxisAlignedBoxSceneQuery : public AxisAlignedBoxSceneQuery
    03445     {
    03446     public:
    03447         DefaultAxisAlignedBoxSceneQuery(SceneManager* creator);
    03448         ~DefaultAxisAlignedBoxSceneQuery();
    03449
    03451         void execute(SceneQueryListener* listener);
    03452     };
    03453
    03454
    03456     typedef uint16 SceneTypeMask;
    03457
    03461     enum SceneType
    03462     {
    03463         ST_GENERIC = 1,
    03464         ST_EXTERIOR_CLOSE = 2,
    03465         ST_EXTERIOR_FAR = 4,
    03466         ST_EXTERIOR_REAL_FAR = 8,
    03467         ST_INTERIOR = 16
    03468     };
    03469
    03471     struct SceneManagerMetaData
    03472     {
    03474         String typeName;
    03476         String description;
    03478         SceneTypeMask sceneTypeMask;
    03480         bool worldGeometrySupported;
    03481     };
    03482
    03483
    03484
    03486     class _OgreExport SceneManagerFactory : public SceneMgtAlloc
    03487     {
    03488     protected:
    03489         mutable SceneManagerMetaData mMetaData;
    03490         mutable bool mMetaDataInit;
    03492         virtual void initMetaData(void) const = 0;
    03493     public:
    03494         SceneManagerFactory() : mMetaDataInit(true) {}
    03495         virtual ~SceneManagerFactory() {}
    03497         virtual const SceneManagerMetaData& getMetaData(void) const
    03498         {
    03499             if (mMetaDataInit)
    03500             {
    03501                 initMetaData();
    03502                 mMetaDataInit = false;
    03503             }
    03504             return mMetaData;
    03505         }
    03510         virtual SceneManager* createInstance(const String& instanceName) = 0;
    03512         virtual void destroyInstance(SceneManager* instance) = 0;
    03513
    03514     };
    03515
    03520 } // Namespace
    03521
    03522
    03523
    03524 #endif

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun May 8 2011 20:28:09