# 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-2006 Torus Knot Software Ltd
    00008 Also see acknowledgements in Readme.html
    00009
    00010 This library is free software; you can redistribute it and/or modify it
    00011 under the terms of the GNU Lesser General Public License (LGPL) as
    00012 published by the Free Software Foundation; either version 2.1 of the
    00013 License, or (at your option) any later version.
    00014
    00015 This library is distributed in the hope that it will be useful, but
    00016 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    00017 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
    00018 License for more details.
    00019
    00020 You should have received a copy of the GNU Lesser General Public License
    00021 along with this library; if not, write to the Free Software Foundation,
    00022 Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
    00023 http://www.gnu.org/copyleft/lesser.txt
    00024
    00025 You may alternatively use this source under the terms of a specific version of
    00026 the OGRE Unrestricted License provided you have obtained such a license from
    00027 Torus Knot Software Ltd.
    00028 -------------------------------------------------------------------------*/
    00029 #ifndef __SceneManager_H__
    00030 #define __SceneManager_H__
    00031
    00032 // Precompiler options
    00033 #include "OgrePrerequisites.h"
    00034
    00035 #include "OgreString.h"
    00036 #include "OgreSceneNode.h"
    00037 #include "OgrePlane.h"
    00038 #include "OgreQuaternion.h"
    00039 #include "OgreColourValue.h"
    00040 #include "OgreCommon.h"
    00041 #include "OgreSceneQuery.h"
    00042 #include "OgreAutoParamDataSource.h"
    00043 #include "OgreAnimationState.h"
    00044 #include "OgreRenderQueue.h"
    00045 #include "OgreRenderQueueSortingGrouping.h"
    00046 #include "OgreRectangle2D.h"
    00047 #include "OgrePixelFormat.h"
    00048 #include "OgreResourceGroupManager.h"
    00049 #include "OgreTexture.h"
    00050 #include "OgreShadowCameraSetup.h"
    00051 #include "OgreShadowTextureManager.h"
    00052 #include "OgreCamera.h"
    00053 #include "OgreInstancedGeometry.h"
    00054
    00055 namespace Ogre {
    00056
    00058     struct ViewPoint
    00059     {
    00060         Vector3 position;
    00061         Quaternion orientation;
    00062     };
    00063
    00064     // Forward declarations
    00065     class DefaultIntersectionSceneQuery;
    00066     class DefaultRaySceneQuery;
    00067     class DefaultSphereSceneQuery;
    00068     class DefaultAxisAlignedBoxSceneQuery;
    00069
    00073     struct VisibleObjectsBoundsInfo
    00074     {
    00076         AxisAlignedBox aabb;
    00078         AxisAlignedBox receiverAabb;
    00080         Real minDistance;
    00082         Real maxDistance;
    00084         Real minDistanceInFrustum;
    00086         Real maxDistanceInFrustum;
    00087
    00088         VisibleObjectsBoundsInfo()
    00089         {
    00090             reset();
    00091         }
    00092
    00093         void reset()
    00094         {
    00095             aabb.setNull();
    00096             receiverAabb.setNull();
    00097             minDistance = minDistanceInFrustum = std::numeric_limits<Real>::infinity();
    00098             maxDistance = maxDistanceInFrustum = 0;
    00099         }
    00100
    00101         void merge(const AxisAlignedBox& boxBounds, const Sphere& sphereBounds,
    00102             const Camera* cam, bool receiver=true)
    00103         {
    00104             aabb.merge(boxBounds);
    00105             if (receiver)
    00106                 receiverAabb.merge(boxBounds);
    00107             // use view matrix to determine distance, works with custom view matrices
    00108             Vector3 vsSpherePos = cam->getViewMatrix(true) * sphereBounds.getCenter();
    00109             Real camDistToCenter = vsSpherePos.length();
    00110             minDistance = (std::min)(minDistance, (std::max)((Real)0, camDistToCenter - sphereBounds.getRadius()));
    00111             maxDistance = (std::max)(maxDistance, camDistToCenter + sphereBounds.getRadius());
    00112             minDistanceInFrustum = (std::min)(minDistanceInFrustum, (std::max)((Real)0, camDistToCenter - sphereBounds.getRadius()));
    00113             maxDistanceInFrustum = (std::max)(maxDistanceInFrustum, camDistToCenter + sphereBounds.getRadius());
    00114         }
    00115
    00119         void mergeNonRenderedButInFrustum(const AxisAlignedBox& boxBounds,
    00120             const Sphere& sphereBounds, const Camera* cam)
    00121         {
    00122             // use view matrix to determine distance, works with custom view matrices
    00123             Vector3 vsSpherePos = cam->getViewMatrix(true) * sphereBounds.getCenter();
    00124             Real camDistToCenter = vsSpherePos.length();
    00125             minDistanceInFrustum = (std::min)(minDistanceInFrustum, (std::max)((Real)0, camDistToCenter - sphereBounds.getRadius()));
    00126             maxDistanceInFrustum = (std::max)(maxDistanceInFrustum, camDistToCenter + sphereBounds.getRadius());
    00127
    00128         }
    00129
    00130
    00131     };
    00132
    00162     class _OgreExport SceneManager : public SceneMgtAlloc
    00163     {
    00164     public:
    00166         static uint32 WORLD_GEOMETRY_TYPE_MASK;
    00168         static uint32 ENTITY_TYPE_MASK;
    00170         static uint32 FX_TYPE_MASK;
    00172         static uint32 STATICGEOMETRY_TYPE_MASK;
    00174         static uint32 LIGHT_TYPE_MASK;
    00176         static uint32 FRUSTUM_TYPE_MASK;
    00178         static uint32 USER_TYPE_MASK_LIMIT;
    00181         struct materialLess
    00182         {
    00183             _OgreExport bool operator()(const Material* x, const Material* y) const;
    00184         };
    00186         struct lightLess
    00187         {
    00188             _OgreExport bool operator()(const Light* a, const Light* b) const;
    00189         };
    00190
    00192         enum IlluminationRenderStage
    00193         {
    00195             IRS_NONE,
    00197             IRS_RENDER_TO_TEXTURE,
    00199             IRS_RENDER_RECEIVER_PASS
    00200         };
    00201
    00206         enum SpecialCaseRenderQueueMode
    00207         {
    00209             SCRQM_INCLUDE,
    00211             SCRQM_EXCLUDE
    00212         };
    00213
    00214         struct SkyDomeGenParameters
    00215         {
    00216             Real skyDomeCurvature;
    00217             Real skyDomeTiling;
    00218             Real skyDomeDistance;
    00219             int skyDomeXSegments;
    00220             int skyDomeYSegments;
    00221             int skyDomeYSegments_keep;
    00222         };
    00223
    00224         struct SkyPlaneGenParameters
    00225         {
    00226             Real skyPlaneScale;
    00227             Real skyPlaneTiling;
    00228             Real skyPlaneBow;
    00229             int skyPlaneXSegments;
    00230             int skyPlaneYSegments;
    00231         };
    00232
    00233         struct SkyBoxGenParameters
    00234         {
    00235             Real skyBoxDistance;
    00236         };
    00237
    00241         class Listener
    00242         {
    00243         public:
    00244             Listener() {}
    00245             virtual ~Listener() {}
    00246
    00256             virtual void preFindVisibleObjects(SceneManager* source,
    00257                 IlluminationRenderStage irs, Viewport* v) = 0;
    00268             virtual void postFindVisibleObjects(SceneManager* source,
    00269                 IlluminationRenderStage irs, Viewport* v) = 0;
    00270
    00285             virtual void shadowTexturesUpdated(size_t numberOfShadowTextures) = 0;
    00286
    00300             virtual void shadowTextureCasterPreViewProj(Light* light,
    00301                 Camera* camera, size_t iteration) = 0;
    00315             virtual void shadowTextureReceiverPreViewProj(Light* light,
    00316                 Frustum* frustum) = 0;
    00317
    00340             virtual bool sortLightsAffectingFrustum(LightList& lightList) { return false; }
    00341
    00342
    00343
    00344         };
    00345
    00349         class _OgreExport SceneMgrQueuedRenderableVisitor : public QueuedRenderableVisitor
    00350         {
    00351         protected:
    00353             const Pass* mUsedPass;
    00354         public:
    00355             SceneMgrQueuedRenderableVisitor()
    00356                 :transparentShadowCastersMode(false) {}
    00357             ~SceneMgrQueuedRenderableVisitor() {}
    00358             void visit(Renderable* r);
    00359             bool visit(const Pass* p);
    00360             void visit(RenderablePass* rp);
    00361
    00363             SceneManager* targetSceneMgr;
    00365             bool transparentShadowCastersMode;
    00367             bool autoLights;
    00369             const LightList* manualLightList;
    00371             bool scissoring;
    00372
    00373         };
    00375         friend class SceneMgrQueuedRenderableVisitor;
    00376
    00377     protected:
    00378
    00380         virtual SceneNode* createSceneNodeImpl(void);
    00382         virtual SceneNode* createSceneNodeImpl(const String& name);
    00383
    00385         String mName;
    00386
    00388         RenderQueue* mRenderQueue;
    00389         bool mLastRenderQueueInvocationCustom;
    00390
    00392         ColourValue mAmbientLight;
    00393
    00395         RenderSystem *mDestRenderSystem;
    00396
    00397         typedef std::map<String, Camera* > CameraList;
    00398
    00401         CameraList mCameras;
    00402
    00403         typedef std::map<String, StaticGeometry* > StaticGeometryList;
    00404         StaticGeometryList mStaticGeometryList;
    00405         typedef std::map<String, InstancedGeometry* > InstancedGeometryList;
    00406         InstancedGeometryList mInstancedGeometryList;
    00407
    00408         typedef std::map<String, SceneNode*> SceneNodeList;
    00409
    00416         SceneNodeList mSceneNodes;
    00417
    00419         Camera* mCameraInProgress;
    00421         Viewport* mCurrentViewport;
    00422
    00424         SceneNode* mSceneRoot;
    00425
    00427         typedef std::set<SceneNode*> AutoTrackingSceneNodes;
    00428         AutoTrackingSceneNodes mAutoTrackingSceneNodes;
    00429
    00430         // Sky params
    00431         // Sky plane
    00432         Entity* mSkyPlaneEntity;
    00433         Entity* mSkyDomeEntity[5];
    00434         ManualObject* mSkyBoxObj;
    00435
    00436         SceneNode* mSkyPlaneNode;
    00437         SceneNode* mSkyDomeNode;
    00438         SceneNode* mSkyBoxNode;
    00439
    00440         // Sky plane
    00441         bool mSkyPlaneEnabled;
    00442         uint8 mSkyPlaneRenderQueue;
    00443         Plane mSkyPlane;
    00444         SkyPlaneGenParameters mSkyPlaneGenParameters;
    00445         // Sky box
    00446         bool mSkyBoxEnabled;
    00447         uint8 mSkyBoxRenderQueue;
    00448         Quaternion mSkyBoxOrientation;
    00449         SkyBoxGenParameters mSkyBoxGenParameters;
    00450         // Sky dome
    00451         bool mSkyDomeEnabled;
    00452         uint8 mSkyDomeRenderQueue;
    00453         Quaternion mSkyDomeOrientation;
    00454         SkyDomeGenParameters mSkyDomeGenParameters;
    00455
    00456         // Fog
    00457         FogMode mFogMode;
    00458         ColourValue mFogColour;
    00459         Real mFogStart;
    00460         Real mFogEnd;
    00461         Real mFogDensity;
    00462
    00463         typedef std::set<uint8> SpecialCaseRenderQueueList;
    00464         SpecialCaseRenderQueueList mSpecialCaseQueueList;
    00465         SpecialCaseRenderQueueMode mSpecialCaseQueueMode;
    00466         uint8 mWorldGeometryRenderQueue;
    00467
    00468         unsigned long mLastFrameNumber;
    00469         Matrix4 mTempXform[256];
    00470         bool mResetIdentityView;
    00471         bool mResetIdentityProj;
    00472
    00473         bool mNormaliseNormalsOnScale;
    00474         bool mFlipCullingOnNegativeScale;
    00475         CullingMode mPassCullingMode;
    00476
    00477     protected:
    00478
    00486         typedef std::map< const Camera*, VisibleObjectsBoundsInfo> CamVisibleObjectsMap;
    00487         CamVisibleObjectsMap mCamVisibleObjectsMap;
    00488
    00490         typedef std::map< const Camera*, const Light* > ShadowCamLightMapping;
    00491         ShadowCamLightMapping mShadowCamLightMapping;
    00492
    00494         size_t mShadowTextureCountPerType[3];
    00495
    00497         std::vector<size_t> mShadowTextureIndexLightList;
    00498
    00500         struct _OgreExport LightInfo
    00501         {
    00502             Light* light;       // Just a pointer for comparison, the light might destroyed for some reason
    00503             int type;           // Use int instead of Light::LightTypes to avoid header file dependence
    00504             Real range;         // Sets to zero if directional light
    00505             Vector3 position;   // Sets to zero if directional light
    00506
    00507             bool operator== (const LightInfo& rhs) const
    00508             {
    00509                 return light == rhs.light && type == rhs.type &&
    00510                     range == rhs.range && position == rhs.position;
    00511             }
    00512
    00513             bool operator!= (const LightInfo& rhs) const
    00514             {
    00515                 return !(*this == rhs);
    00516             }
    00517         };
    00518
    00519         typedef std::vector<LightInfo> LightInfoList;
    00520
    00521         LightList mLightsAffectingFrustum;
    00522         LightInfoList mCachedLightInfos;
    00523         LightInfoList mTestLightInfos; // potentially new list
    00524         ulong mLightsDirtyCounter;
    00525
    00526         typedef std::map<String, MovableObject*> MovableObjectMap;
    00528         struct MovableObjectCollection
    00529         {
    00530             MovableObjectMap map;
    00531             OGRE_MUTEX(mutex)
    00532         };
    00533         typedef std::map<String, MovableObjectCollection*> MovableObjectCollectionMap;
    00534         MovableObjectCollectionMap mMovableObjectCollectionMap;
    00539         MovableObjectCollection* getMovableObjectCollection(const String& typeName);
    00544         const MovableObjectCollection* getMovableObjectCollection(const String& typeName) const;
    00546         OGRE_MUTEX(mMovableObjectCollectionMapMutex)
    00547
    00548
    00552         virtual void initRenderQueue(void);
    00554         Pass* mShadowCasterPlainBlackPass;
    00556         Pass* mShadowReceiverPass;
    00566         virtual const Pass* deriveShadowCasterPass(const Pass* pass);
    00575         virtual const Pass* deriveShadowReceiverPass(const Pass* pass);
    00576
    00583         virtual bool validatePassForRendering(const Pass* pass);
    00584
    00591         virtual bool validateRenderableForRendering(const Pass* pass, const Renderable* rend);
    00592
    00593         enum BoxPlane
    00594         {
    00595             BP_FRONT = 0,
    00596             BP_BACK = 1,
    00597             BP_LEFT = 2,
    00598             BP_RIGHT = 3,
    00599             BP_UP = 4,
    00600             BP_DOWN = 5
    00601         };
    00602
    00603         /* Internal utility method for creating the planes of a skybox.
    00604         */
    00605         virtual MeshPtr createSkyboxPlane(
    00606             BoxPlane bp,
    00607             Real distance,
    00608             const Quaternion& orientation,
    00609             const String& groupName);
    00610
    00611         /* Internal utility method for creating the planes of a skydome.
    00612         */
    00613         virtual MeshPtr createSkydomePlane(
    00614             BoxPlane bp,
    00615             Real curvature, Real tiling, Real distance,
    00616             const Quaternion& orientation,
    00617             int xsegments, int ysegments, int ySegmentsToKeep,
    00618             const String& groupName);
    00619
    00620         // Flag indicating whether SceneNodes will be rendered as a set of 3 axes
    00621         bool mDisplayNodes;
    00622
    00624         typedef std::map<String, Animation*> AnimationList;
    00625         AnimationList mAnimationsList;
    00626         OGRE_MUTEX(mAnimationsListMutex)
    00627         AnimationStateSet mAnimationStates;
    00628
    00629
    00632         virtual void useRenderableViewProjMode(const Renderable* pRend);
    00633
    00636         virtual void resetViewProjMode(void);
    00637
    00638         typedef std::vector<RenderQueueListener*> RenderQueueListenerList;
    00639         RenderQueueListenerList mRenderQueueListeners;
    00640
    00641         typedef std::vector<Listener*> ListenerList;
    00642         ListenerList mListeners;
    00644         virtual bool fireRenderQueueStarted(uint8 id, const String& invocation);
    00646         virtual bool fireRenderQueueEnded(uint8 id, const String& invocation);
    00647
    00649         virtual void fireShadowTexturesUpdated(size_t numberOfShadowTextures);
    00651         virtual void fireShadowTexturesPreCaster(Light* light, Camera* camera, size_t iteration);
    00653         virtual void fireShadowTexturesPreReceiver(Light* light, Frustum* f);
    00655         virtual void firePreFindVisibleObjects(Viewport* v);
    00657         virtual void firePostFindVisibleObjects(Viewport* v);
    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         ShadowTechnique mShadowTechnique;
    00700         bool mDebugShadows;
    00701         ColourValue mShadowColour;
    00702         Pass* mShadowDebugPass;
    00703         Pass* mShadowStencilPass;
    00704         Pass* mShadowModulativePass;
    00705         bool mShadowMaterialInitDone;
    00706         HardwareIndexBufferSharedPtr mShadowIndexBuffer;
    00707         size_t mShadowIndexBufferSize;
    00708         Rectangle2D* mFullScreenQuad;
    00709         Real mShadowDirLightExtrudeDist;
    00710         IlluminationRenderStage mIlluminationStage;
    00711         ShadowTextureConfigList mShadowTextureConfigList;
    00712         bool mShadowTextureConfigDirty;
    00713         ShadowTextureList mShadowTextures;
    00714         TexturePtr mNullShadowTexture;
    00715         typedef std::vector<Camera*> ShadowTextureCameraList;
    00716         ShadowTextureCameraList mShadowTextureCameras;
    00717         Texture* mCurrentShadowTexture;
    00718         bool mShadowUseInfiniteFarPlane;
    00719         bool mShadowCasterRenderBackFaces;
    00720         bool mShadowAdditiveLightClip;
    00722         struct LightClippingInfo
    00723         {
    00724             RealRect scissorRect;
    00725             PlaneList clipPlanes;
    00726             bool scissorValid;
    00727             unsigned long clipPlanesValid;
    00728             LightClippingInfo() : scissorValid(false), clipPlanesValid(false) {}
    00729
    00730         };
    00731         typedef std::map<Light*, LightClippingInfo> LightClippingInfoMap;
    00732         LightClippingInfoMap mLightClippingInfoMap;
    00733         unsigned long mLightClippingInfoMapFrameNumber;
    00734
    00736         ShadowCameraSetupPtr mDefaultShadowCameraSetup;
    00737
    00746         struct lightsForShadowTextureLess
    00747         {
    00748             _OgreExport bool operator()(const Light* l1, const Light* l2) const;
    00749         };
    00750
    00751
    00758         virtual void findLightsAffectingFrustum(const Camera* camera);
    00760         virtual void initShadowVolumeMaterials(void);
    00762         virtual void ensureShadowTexturesCreated();
    00764         virtual void destroyShadowTextures(void);
    00766         virtual void prepareShadowTextures(Camera* cam, Viewport* vp);
    00767
    00775         virtual void renderShadowVolumesToStencil(const Light* light, const Camera* cam,
    00776             bool calcScissor);
    00782         virtual void setShadowVolumeStencilState(bool secondpass, bool zfail, bool twosided);
    00784         void renderShadowVolumeObjects(ShadowCaster::ShadowRenderableListIterator iShadowRenderables,
    00785             Pass* pass, const LightList *manualLightList, unsigned long flags,
    00786             bool secondpass, bool zfail, bool twosided);
    00787         typedef std::vector<ShadowCaster*> ShadowCasterList;
    00788         ShadowCasterList mShadowCasterList;
    00789         SphereSceneQuery* mShadowCasterSphereQuery;
    00790         AxisAlignedBoxSceneQuery* mShadowCasterAABBQuery;
    00791         Real mDefaultShadowFarDist;
    00792         Real mDefaultShadowFarDistSquared;
    00793         Real mShadowTextureOffset; // proportion of texture offset in view direction e.g. 0.4
    00794         Real mShadowTextureFadeStart; // as a proportion e.g. 0.6
    00795         Real mShadowTextureFadeEnd; // as a proportion e.g. 0.9
    00796         bool mShadowTextureSelfShadow;
    00797         Pass* mShadowTextureCustomCasterPass;
    00798         Pass* mShadowTextureCustomReceiverPass;
    00799         String mShadowTextureCustomCasterVertexProgram;
    00800         String mShadowTextureCustomReceiverVertexProgram;
    00801         String mShadowTextureCustomReceiverFragmentProgram;
    00802         GpuProgramParametersSharedPtr mShadowTextureCustomCasterVPParams;
    00803         GpuProgramParametersSharedPtr mShadowTextureCustomReceiverVPParams;
    00804         GpuProgramParametersSharedPtr mShadowTextureCustomReceiverFPParams;
    00805
    00807         uint32 mVisibilityMask;
    00808         bool mFindVisibleObjects;
    00809
    00811         bool mSuppressRenderStateChanges;
    00813         bool mSuppressShadows;
    00814
    00815
    00816         GpuProgramParametersSharedPtr mInfiniteExtrusionParams;
    00817         GpuProgramParametersSharedPtr mFiniteExtrusionParams;
    00818
    00820         class _OgreExport ShadowCasterSceneQueryListener : public SceneQueryListener, public SceneMgtAlloc
    00821         {
    00822         protected:
    00823             SceneManager* mSceneMgr;
    00824             ShadowCasterList* mCasterList;
    00825             bool mIsLightInFrustum;
    00826             const PlaneBoundedVolumeList* mLightClipVolumeList;
    00827             const Camera* mCamera;
    00828             const Light* mLight;
    00829             Real mFarDistSquared;
    00830         public:
    00831             ShadowCasterSceneQueryListener(SceneManager* sm) : mSceneMgr(sm),
    00832                 mCasterList(0), mIsLightInFrustum(false), mLightClipVolumeList(0),
    00833                 mCamera(0) {}
    00834             // Prepare the listener for use with a set of parameters
    00835             void prepare(bool lightInFrustum,
    00836                 const PlaneBoundedVolumeList* lightClipVolumes,
    00837                 const Light* light, const Camera* cam, ShadowCasterList* casterList,
    00838                 Real farDistSquared)
    00839             {
    00840                 mCasterList = casterList;
    00841                 mIsLightInFrustum = lightInFrustum;
    00842                 mLightClipVolumeList = lightClipVolumes;
    00843                 mCamera = cam;
    00844                 mLight = light;
    00845                 mFarDistSquared = farDistSquared;
    00846             }
    00847             bool queryResult(MovableObject* object);
    00848             bool queryResult(SceneQuery::WorldFragment* fragment);
    00849         };
    00850
    00851         ShadowCasterSceneQueryListener* mShadowCasterQueryListener;
    00852
    00859         virtual const ShadowCasterList& findShadowCastersForLight(const Light* light,
    00860             const Camera* camera);
    00862         virtual void renderBasicQueueGroupObjects(RenderQueueGroup* pGroup,
    00863             QueuedRenderableCollection::OrganisationMode om);
    00865         virtual void renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* group,
    00866             QueuedRenderableCollection::OrganisationMode om);
    00868         virtual void renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* group,
    00869             QueuedRenderableCollection::OrganisationMode om);
    00871         virtual void renderTextureShadowCasterQueueGroupObjects(RenderQueueGroup* group,
    00872             QueuedRenderableCollection::OrganisationMode om);
    00874         virtual void renderTextureShadowReceiverQueueGroupObjects(RenderQueueGroup* group,
    00875             QueuedRenderableCollection::OrganisationMode om);
    00877         virtual void renderModulativeTextureShadowedQueueGroupObjects(RenderQueueGroup* group,
    00878             QueuedRenderableCollection::OrganisationMode om);
    00879
    00881         virtual void renderAdditiveTextureShadowedQueueGroupObjects(RenderQueueGroup* group,
    00882             QueuedRenderableCollection::OrganisationMode om);
    00884         virtual void renderObjects(const QueuedRenderableCollection& objs,
    00885             QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping,
    00886             bool doLightIteration, const LightList* manualLightList = 0);
    00892         virtual void renderTransparentShadowCasterObjects(const QueuedRenderableCollection& objs,
    00893             QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping,
    00894             bool doLightIteration, const LightList* manualLightList = 0);
    00895
    00898         virtual void updateRenderQueueSplitOptions(void);
    00901         virtual void updateRenderQueueGroupSplitOptions(RenderQueueGroup* group,
    00902             bool suppressShadows, bool suppressRenderState);
    00903
    00905         virtual ClipResult buildAndSetScissor(const LightList& ll, const Camera* cam);
    00907         virtual void buildScissor(const Light* l, const Camera* cam, RealRect& rect);
    00908         virtual void resetScissor();
    00910         virtual ClipResult buildAndSetLightClip(const LightList& ll);
    00911         virtual void buildLightClip(const Light* l, PlaneList& planes);
    00912         virtual void resetLightClip();
    00913         virtual void checkCachedLightClippingInfo();
    00914
    00916         SceneMgrQueuedRenderableVisitor* mActiveQueuedRenderableVisitor;
    00918         SceneMgrQueuedRenderableVisitor mDefaultQueuedRenderableVisitor;
    00919
    00921         bool mCameraRelativeRendering;
    00922         Matrix4 mCachedViewMatrix;
    00923         Vector3 mCameraRelativePosition;
    00924
    00925     public:
    00928         SceneManager(const String& instanceName);
    00929
    00932         virtual ~SceneManager();
    00933
    00934
    00960         OGRE_MUTEX(sceneGraphMutex)
    00961
    00962
    00963         const String& getName(void) const { return mName; }
    00964
    00971         virtual const String& getTypeName(void) const = 0;
    00972
    00980         virtual Camera* createCamera(const String& name);
    00981
    00985         virtual Camera* getCamera(const String& name) const;
    00986
    00989         virtual bool hasCamera(const String& name) const;
    00990
    00999         virtual void destroyCamera(Camera *cam);
    01000
    01006         virtual void destroyCamera(const String& name);
    01007
    01016         virtual void destroyAllCameras(void);
    01017
    01028         virtual Light* createLight(const String& name);
    01029
    01033         virtual Light* getLight(const String& name) const;
    01034
    01037         virtual bool hasLight(const String& name) const;
    01038
    01041         virtual const PlaneList& getLightClippingPlanes(Light* l);
    01042
    01045         virtual const RealRect& getLightScissorRect(Light* l, const Camera* cam);
    01046
    01051         virtual void destroyLight(const String& name);
    01052
    01057         virtual void destroyLight(Light* light);
    01060         virtual void destroyAllLights(void);
    01061
    01072         virtual void _notifyLightsDirty(void);
    01073
    01086         ulong _getLightsDirtyCounter(void) const { return mLightsDirtyCounter; }
    01087
    01094         virtual const LightList& _getLightsAffectingFrustum(void) const;
    01095
    01117         virtual void _populateLightList(const Vector3& position, Real radius, LightList& destList);
    01118
    01119
    01136         virtual SceneNode* createSceneNode(void);
    01137
    01152         virtual SceneNode* createSceneNode(const String& name);
    01153
    01160         virtual void destroySceneNode(const String& name);
    01161
    01168         virtual void destroySceneNode(SceneNode* sn);
    01184         virtual SceneNode* getRootSceneNode(void);
    01185
    01193         virtual SceneNode* getSceneNode(const String& name) const;
    01194
    01197         virtual bool hasSceneNode(const String& name) const;
    01198
    01199
    01207         virtual Entity* createEntity(const String& entityName, const String& meshName);
    01208
    01215         enum PrefabType {
    01216             PT_PLANE,
    01217             PT_CUBE,
    01218             PT_SPHERE
    01219         };
    01220
    01227         virtual Entity* createEntity(const String& entityName, PrefabType ptype);
    01231         virtual Entity* getEntity(const String& name) const;
    01234         virtual bool hasEntity(const String& name) const;
    01235
    01244         virtual void destroyEntity(Entity* ent);
    01245
    01254         virtual void destroyEntity(const String& name);
    01255
    01265         virtual void destroyAllEntities(void);
    01266
    01272         virtual ManualObject* createManualObject(const String& name);
    01276         virtual ManualObject* getManualObject(const String& name) const;
    01279         virtual bool hasManualObject(const String& name) const;
    01280
    01283         virtual void destroyManualObject(ManualObject* obj);
    01286         virtual void destroyManualObject(const String& name);
    01289         virtual void destroyAllManualObjects(void);
    01295         virtual BillboardChain* createBillboardChain(const String& name);
    01299         virtual BillboardChain* getBillboardChain(const String& name) const;
    01302         virtual bool hasBillboardChain(const String& name) const;
    01303
    01306         virtual void destroyBillboardChain(BillboardChain* obj);
    01309         virtual void destroyBillboardChain(const String& name);
    01312         virtual void destroyAllBillboardChains(void);
    01318         virtual RibbonTrail* createRibbonTrail(const String& name);
    01322         virtual RibbonTrail* getRibbonTrail(const String& name) const;
    01325         virtual bool hasRibbonTrail(const String& name) const;
    01326
    01329         virtual void destroyRibbonTrail(RibbonTrail* obj);
    01332         virtual void destroyRibbonTrail(const String& name);
    01335         virtual void destroyAllRibbonTrails(void);
    01336
    01357         virtual ParticleSystem* createParticleSystem(const String& name,
    01358             const String& templateName);
    01378         virtual ParticleSystem* createParticleSystem(const String& name,
    01379             size_t quota = 500,
    01380             const String& resourceGroup = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01384         virtual ParticleSystem* getParticleSystem(const String& name) const;
    01387         virtual bool hasParticleSystem(const String& name) const;
    01388
    01391         virtual void destroyParticleSystem(ParticleSystem* obj);
    01394         virtual void destroyParticleSystem(const String& name);
    01397         virtual void destroyAllParticleSystems(void);
    01398
    01404         virtual void clearScene(void);
    01405
    01418         void setAmbientLight(const ColourValue& colour);
    01419
    01422         const ColourValue& getAmbientLight(void) const;
    01423
    01439         virtual void prepareWorldGeometry(const String& filename);
    01440
    01458         virtual void prepareWorldGeometry(DataStreamPtr& stream,
    01459             const String& typeName = StringUtil::BLANK);
    01460
    01473         virtual void setWorldGeometry(const String& filename);
    01474
    01490         virtual void setWorldGeometry(DataStreamPtr& stream,
    01491             const String& typeName = StringUtil::BLANK);
    01492
    01505         virtual size_t estimateWorldGeometry(const String& filename) { return 0; }
    01506
    01519         virtual size_t estimateWorldGeometry(DataStreamPtr& stream,
    01520             const String& typeName = StringUtil::BLANK) { return 0; }
    01535         virtual ViewPoint getSuggestedViewpoint(bool random = false);
    01536
    01550         virtual bool setOption( const String& strKey, const void* pValue ) { return false; }
    01551
    01565         virtual bool getOption( const String& strKey, void* pDestValue ) { return false; }
    01566
    01576         virtual bool hasOption( const String& strKey ) const { return false; }
    01591         virtual bool getOptionValues( const String& strKey, StringVector& refValueList ) { return false; }
    01592
    01599         virtual bool getOptionKeys( StringVector& refKeys ) { return false; }
    01600
    01609         virtual void _updateSceneGraph(Camera* cam);
    01610
    01622         virtual void _findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters);
    01623
    01628         virtual void _applySceneAnimations(void);
    01629
    01632         virtual void _renderVisibleObjects(void);
    01633
    01647         virtual void _renderScene(Camera* camera, Viewport* vp, bool includeOverlays);
    01648
    01652         virtual void _queueSkiesForRendering(Camera* cam);
    01653
    01654
    01655
    01664         virtual void _setDestinationRenderSystem(RenderSystem* sys);
    01665
    01719         virtual void setSkyPlane(
    01720             bool enable,
    01721             const Plane& plane, const String& materialName, Real scale = 1000,
    01722             Real tiling = 10, bool drawFirst = true, Real bow = 0,
    01723             int xsegments = 1, int ysegments = 1,
    01724             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01768         virtual void _setSkyPlane(
    01769             bool enable,
    01770             const Plane& plane, const String& materialName, Real scale = 1000,
    01771             Real tiling = 10, uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY, Real bow = 0,
    01772             int xsegments = 1, int ysegments = 1,
    01773             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01774
    01776         virtual bool isSkyPlaneEnabled(void) const { return mSkyPlaneEnabled; }
    01777
    01779         virtual SceneNode* getSkyPlaneNode(void) const { return mSkyPlaneNode; }
    01780
    01782         virtual const SkyPlaneGenParameters& getSkyPlaneGenParameters(void) const { return mSkyPlaneGenParameters; }
    01783
    01825         virtual void setSkyBox(
    01826             bool enable, const String& materialName, Real distance = 5000,
    01827             bool drawFirst = true, const Quaternion& orientation = Quaternion::IDENTITY,
    01828             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01829
    01862         virtual void _setSkyBox(
    01863             bool enable, const String& materialName, Real distance = 5000,
    01864             uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY, const Quaternion& orientation = Quaternion::IDENTITY,
    01865             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01866
    01868         virtual bool isSkyBoxEnabled(void) const { return mSkyBoxEnabled; }
    01869
    01871         virtual SceneNode* getSkyBoxNode(void) const { return mSkyBoxNode; }
    01872
    01874         virtual const SkyBoxGenParameters& getSkyBoxGenParameters(void) const { return mSkyBoxGenParameters; }
    01875
    01931         virtual void setSkyDome(
    01932             bool enable, const String& materialName, Real curvature = 10,
    01933             Real tiling = 8, Real distance = 4000, bool drawFirst = true,
    01934             const Quaternion& orientation = Quaternion::IDENTITY,
    01935             int xsegments = 16, int ysegments = 16, int ysegments_keep = -1,
    01936             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01937
    01984         virtual void _setSkyDome(
    01985             bool enable, const String& materialName, Real curvature = 10,
    01986             Real tiling = 8, Real distance = 4000, uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY,
    01987             const Quaternion& orientation = Quaternion::IDENTITY,
    01988             int xsegments = 16, int ysegments = 16, int ysegments_keep = -1,
    01989             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01990
    01992         virtual bool isSkyDomeEnabled(void) const { return mSkyDomeEnabled; }
    01993
    01995         virtual SceneNode* getSkyDomeNode(void) const { return mSkyDomeNode; }
    01996
    01998         virtual const SkyDomeGenParameters& getSkyDomeGenParameters(void) const { return mSkyDomeGenParameters; }
    01999
    02024         void setFog(
    02025             FogMode mode = FOG_NONE, const ColourValue& colour = ColourValue::White,
    02026             Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0);
    02027
    02030         virtual FogMode getFogMode(void) const;
    02031
    02034         virtual const ColourValue& getFogColour(void) const;
    02035
    02038         virtual Real getFogStart(void) const;
    02039
    02042         virtual Real getFogEnd(void) const;
    02043
    02046         virtual Real getFogDensity(void) const;
    02047
    02048
    02066         virtual BillboardSet* createBillboardSet(const String& name, unsigned int poolSize = 20);
    02067
    02071         virtual BillboardSet* getBillboardSet(const String& name) const;
    02074         virtual bool hasBillboardSet(const String& name) const;
    02075
    02082         virtual void destroyBillboardSet(BillboardSet* set);
    02083
    02090         virtual void destroyBillboardSet(const String& name);
    02091
    02101         virtual void destroyAllBillboardSets(void);
    02102
    02110         virtual void setDisplaySceneNodes(bool display);
    02112         virtual bool getDisplaySceneNodes(void) const {return mDisplayNodes;}
    02113
    02134         virtual Animation* createAnimation(const String& name, Real length);
    02135
    02139         virtual Animation* getAnimation(const String& name) const;
    02142         virtual bool hasAnimation(const String& name) const;
    02143
    02149         virtual void destroyAnimation(const String& name);
    02150
    02152         virtual void destroyAllAnimations(void);
    02153
    02181         virtual AnimationState* createAnimationState(const String& animName);
    02182
    02186         virtual AnimationState* getAnimationState(const String& animName) const;
    02189         virtual bool hasAnimationState(const String& name) const;
    02190
    02196         virtual void destroyAnimationState(const String& name);
    02197
    02199         virtual void destroyAllAnimationStates(void);
    02200
    02224         virtual void manualRender(RenderOperation* rend, Pass* pass, Viewport* vp,
    02225             const Matrix4& worldMatrix, const Matrix4& viewMatrix, const Matrix4& projMatrix,
    02226             bool doBeginEndFrame = false) ;
    02227
    02238         virtual RenderQueue* getRenderQueue(void);
    02239
    02243         virtual void addRenderQueueListener(RenderQueueListener* newListener);
    02244
    02246         virtual void removeRenderQueueListener(RenderQueueListener* delListener);
    02247
    02261         virtual void addSpecialCaseRenderQueue(uint8 qid);
    02267         virtual void removeSpecialCaseRenderQueue(uint8 qid);
    02271         virtual void clearSpecialCaseRenderQueues(void);
    02276         virtual void setSpecialCaseRenderQueueMode(SpecialCaseRenderQueueMode mode);
    02278         virtual SpecialCaseRenderQueueMode getSpecialCaseRenderQueueMode(void);
    02285         virtual bool isRenderQueueToBeProcessed(uint8 qid);
    02286
    02302         virtual void setWorldGeometryRenderQueue(uint8 qid);
    02313         virtual uint8 getWorldGeometryRenderQueue(void);
    02314
    02316         virtual void showBoundingBoxes(bool bShow);
    02317
    02319         virtual bool getShowBoundingBoxes() const;
    02320
    02322         virtual void _notifyAutotrackingSceneNode(SceneNode* node, bool autoTrack);
    02323
    02324
    02337         virtual AxisAlignedBoxSceneQuery*
    02338             createAABBQuery(const AxisAlignedBox& box, unsigned long mask = 0xFFFFFFFF);
    02351         virtual SphereSceneQuery*
    02352             createSphereQuery(const Sphere& sphere, unsigned long mask = 0xFFFFFFFF);
    02365         virtual PlaneBoundedVolumeListSceneQuery*
    02366             createPlaneBoundedVolumeQuery(const PlaneBoundedVolumeList& volumes, unsigned long mask = 0xFFFFFFFF);
    02367
    02368
    02381         virtual RaySceneQuery*
    02382             createRayQuery(const Ray& ray, unsigned long mask = 0xFFFFFFFF);
    02383         //PyramidSceneQuery* createPyramidQuery(const Pyramid& p, unsigned long mask = 0xFFFFFFFF);
    02395         virtual IntersectionSceneQuery*
    02396             createIntersectionQuery(unsigned long mask = 0xFFFFFFFF);
    02397
    02399         virtual void destroyQuery(SceneQuery* query);
    02400
    02401         typedef MapIterator<CameraList> CameraIterator;
    02402         typedef MapIterator<AnimationList> AnimationIterator;
    02403
    02406         CameraIterator getCameraIterator(void) {
    02407             return CameraIterator(mCameras.begin(), mCameras.end());
    02408         }
    02410         AnimationIterator getAnimationIterator(void) {
    02411             return AnimationIterator(mAnimationsList.begin(), mAnimationsList.end());
    02412         }
    02414         AnimationStateIterator getAnimationStateIterator(void) {
    02415             return mAnimationStates.getAnimationStateIterator();
    02416         }
    02417
    02450         virtual void setShadowTechnique(ShadowTechnique technique);
    02451
    02453         virtual ShadowTechnique getShadowTechnique(void) const { return mShadowTechnique; }
    02454
    02456         virtual void setShowDebugShadows(bool debug) { mDebugShadows = debug; }
    02458         virtual bool getShowDebugShadows(void ) const { return mDebugShadows; }
    02459
    02466         virtual void setShadowColour(const ColourValue& colour);
    02473         virtual const ColourValue& getShadowColour(void) const;
    02485         virtual void setShadowDirectionalLightExtrusionDistance(Real dist);
    02488         virtual Real getShadowDirectionalLightExtrusionDistance(void) const;
    02505         virtual void setShadowFarDistance(Real distance);
    02509         virtual Real getShadowFarDistance(void) const
    02510         { return mDefaultShadowFarDist; }
    02511         virtual Real getShadowFarDistanceSquared(void) const
    02512         { return mDefaultShadowFarDistSquared; }
    02513
    02539         virtual void setShadowIndexBufferSize(size_t size);
    02541         virtual size_t getShadowIndexBufferSize(void) const
    02542         { return mShadowIndexBufferSize; }
    02551         virtual void setShadowTextureSize(unsigned short size);
    02552
    02559         virtual void setShadowTextureConfig(size_t shadowIndex, unsigned short width,
    02560             unsigned short height, PixelFormat format);
    02566         virtual void setShadowTextureConfig(size_t shadowIndex,
    02567             const ShadowTextureConfig& config);
    02568
    02570         ConstShadowTextureConfigIterator getShadowTextureConfigIterator() const;
    02571
    02583         virtual void setShadowTexturePixelFormat(PixelFormat fmt);
    02591         virtual void setShadowTextureCount(size_t count);
    02593         size_t getShadowTextureCount(void) const {return mShadowTextureConfigList.size(); }
    02594
    02604         void setShadowTextureCountPerLightType(Light::LightTypes type, size_t count)
    02605         { mShadowTextureCountPerType[type] = count; }
    02607         size_t getShadowTextureCountPerLightType(Light::LightTypes type) const
    02608         {return mShadowTextureCountPerType[type]; }
    02609
    02618         virtual void setShadowTextureSettings(unsigned short size, unsigned short count,
    02619             PixelFormat fmt = PF_X8R8G8B8);
    02620
    02627         virtual const TexturePtr& getShadowTexture(size_t shadowIndex);
    02628
    02643         virtual void setShadowDirLightTextureOffset(Real offset) { mShadowTextureOffset = offset;}
    02647         virtual Real getShadowDirLightTextureOffset(void)  const { return mShadowTextureOffset; }
    02655         virtual void setShadowTextureFadeStart(Real fadeStart)
    02656         { mShadowTextureFadeStart = fadeStart; }
    02664         virtual void setShadowTextureFadeEnd(Real fadeEnd)
    02665         { mShadowTextureFadeEnd = fadeEnd; }
    02666
    02679         virtual void setShadowTextureSelfShadow(bool selfShadow);
    02680
    02682         virtual bool getShadowTextureSelfShadow(void) const
    02683         { return mShadowTextureSelfShadow; }
    02704         virtual void setShadowTextureCasterMaterial(const String& name);
    02726         virtual void setShadowTextureReceiverMaterial(const String& name);
    02727
    02738         virtual void setShadowCasterRenderBackFaces(bool bf) { mShadowCasterRenderBackFaces = bf; }
    02739
    02743         virtual bool getShadowCasterRenderBackFaces() const { return mShadowCasterRenderBackFaces; }
    02744
    02749         virtual void setShadowCameraSetup(const ShadowCameraSetupPtr& shadowSetup);
    02750
    02755         virtual const ShadowCameraSetupPtr& getShadowCameraSetup() const;
    02756
    02793         virtual void setShadowUseInfiniteFarPlane(bool enable) {
    02794             mShadowUseInfiniteFarPlane = enable; }
    02795
    02797         virtual bool isShadowTechniqueStencilBased(void) const
    02798         { return (mShadowTechnique & SHADOWDETAILTYPE_STENCIL) != 0; }
    02800         virtual bool isShadowTechniqueTextureBased(void) const
    02801         { return (mShadowTechnique & SHADOWDETAILTYPE_TEXTURE) != 0; }
    02803         virtual bool isShadowTechniqueModulative(void) const
    02804         { return (mShadowTechnique & SHADOWDETAILTYPE_MODULATIVE) != 0; }
    02806         virtual bool isShadowTechniqueAdditive(void) const
    02807         { return (mShadowTechnique & SHADOWDETAILTYPE_ADDITIVE) != 0; }
    02809         virtual bool isShadowTechniqueIntegrated(void) const
    02810         { return (mShadowTechnique & SHADOWDETAILTYPE_INTEGRATED) != 0; }
    02812         virtual bool isShadowTechniqueInUse(void) const
    02813         { return mShadowTechnique != SHADOWTYPE_NONE; }
    02817         virtual void setShadowUseLightClipPlanes(bool enabled) { mShadowAdditiveLightClip = enabled; }
    02821         virtual bool getShadowUseLightClipPlanes() const { return mShadowAdditiveLightClip; }
    02822
    02825         virtual void addListener(Listener* s);
    02828         virtual void removeListener(Listener* s);
    02829
    02839         virtual StaticGeometry* createStaticGeometry(const String& name);
    02843         virtual StaticGeometry* getStaticGeometry(const String& name) const;
    02845         virtual bool hasStaticGeometry(const String& name) const;
    02847         virtual void destroyStaticGeometry(StaticGeometry* geom);
    02849         virtual void destroyStaticGeometry(const String& name);
    02851         virtual void destroyAllStaticGeometry(void);
    02852
    02862         virtual InstancedGeometry* createInstancedGeometry(const String& name);
    02864         virtual InstancedGeometry* getInstancedGeometry(const String& name) const;
    02866         virtual void destroyInstancedGeometry(InstancedGeometry* geom);
    02868         virtual void destroyInstancedGeometry(const String& name);
    02870         virtual void destroyAllInstancedGeometry(void);
    02871
    02872
    02883         virtual MovableObject* createMovableObject(const String& name,
    02884             const String& typeName, const NameValuePairList* params = 0);
    02890         virtual void destroyMovableObject(const String& name, const String& typeName);
    02896         virtual void destroyMovableObject(MovableObject* m);
    02898         virtual void destroyAllMovableObjectsByType(const String& typeName);
    02900         virtual void destroyAllMovableObjects(void);
    02904         virtual MovableObject* getMovableObject(const String& name, const String& typeName) const;
    02906         virtual bool hasMovableObject(const String& name, const String& typeName) const;
    02907         typedef MapIterator<MovableObjectMap> MovableObjectIterator;
    02913         virtual MovableObjectIterator getMovableObjectIterator(const String& typeName);
    02925         virtual void injectMovableObject(MovableObject* m);
    02932         virtual void extractMovableObject(const String& name, const String& typeName);
    02939         virtual void extractMovableObject(MovableObject* m);
    02946         virtual void extractAllMovableObjectsByType(const String& typeName);
    02947
    02954         virtual void setVisibilityMask(uint32 vmask) { mVisibilityMask = vmask; }
    02955
    02959         virtual uint32 getVisibilityMask(void) { return mVisibilityMask; }
    02960
    02964         uint32 _getCombinedVisibilityMask(void) const;
    02965
    02972         virtual void setFindVisibleObjects(bool find) { mFindVisibleObjects = find; }
    02973
    02977         virtual bool getFindVisibleObjects(void) { return mFindVisibleObjects; }
    02978
    02987         virtual void setNormaliseNormalsOnScale(bool n) { mNormaliseNormalsOnScale = n; }
    02988
    02992         virtual bool getNormaliseNormalsOnScale() const { return mNormaliseNormalsOnScale; }
    02993
    03002         virtual void setFlipCullingOnNegativeScale(bool n) { mFlipCullingOnNegativeScale = n; }
    03003
    03007         virtual bool getFlipCullingOnNegativeScale() const { return mFlipCullingOnNegativeScale; }
    03008
    03014         virtual void _injectRenderWithPass(Pass *pass, Renderable *rend, bool shadowDerivation = true);
    03015
    03034         virtual void _suppressRenderStateChanges(bool suppress);
    03035
    03039         virtual bool _areRenderStateChangesSuppressed(void) const
    03040         { return mSuppressRenderStateChanges; }
    03041
    03054         virtual const Pass* _setPass(const Pass* pass,
    03055             bool evenIfSuppressed = false, bool shadowDerivation = true);
    03056
    03057
    03067         virtual void _suppressShadows(bool suppress);
    03068
    03072         virtual bool _areShadowsSuppressed(void) const
    03073         { return mSuppressShadows; }
    03074
    03078         virtual void _renderQueueGroupObjects(RenderQueueGroup* group,
    03079             QueuedRenderableCollection::OrganisationMode om);
    03080
    03096         void setQueuedRenderableVisitor(SceneMgrQueuedRenderableVisitor* visitor);
    03097
    03099         SceneMgrQueuedRenderableVisitor* getQueuedRenderableVisitor(void) const;
    03100
    03101
    03105         RenderSystem *getDestinationRenderSystem();
    03106
    03109         Viewport* getCurrentViewport(void) const { return mCurrentViewport; }
    03110
    03112         const VisibleObjectsBoundsInfo& getVisibleObjectsBoundsInfo(const Camera* cam) const;
    03113
    03115         const VisibleObjectsBoundsInfo& getShadowCasterBoundsInfo(const Light* light, size_t iteration = 0) const;
    03116
    03131         virtual void setCameraRelativeRendering(bool rel) { mCameraRelativeRendering = rel; }
    03132
    03136         virtual bool getCameraRelativeRendering() const { return mCameraRelativeRendering; }
    03137     };
    03138
    03140     class _OgreExport DefaultIntersectionSceneQuery :
    03141         public IntersectionSceneQuery
    03142     {
    03143     public:
    03144         DefaultIntersectionSceneQuery(SceneManager* creator);
    03145         ~DefaultIntersectionSceneQuery();
    03146
    03148         void execute(IntersectionSceneQueryListener* listener);
    03149     };
    03150
    03152     class _OgreExport DefaultRaySceneQuery : public RaySceneQuery
    03153     {
    03154     public:
    03155         DefaultRaySceneQuery(SceneManager* creator);
    03156         ~DefaultRaySceneQuery();
    03157
    03159         void execute(RaySceneQueryListener* listener);
    03160     };
    03162     class _OgreExport DefaultSphereSceneQuery : public SphereSceneQuery
    03163     {
    03164     public:
    03165         DefaultSphereSceneQuery(SceneManager* creator);
    03166         ~DefaultSphereSceneQuery();
    03167
    03169         void execute(SceneQueryListener* listener);
    03170     };
    03172     class _OgreExport DefaultPlaneBoundedVolumeListSceneQuery : public PlaneBoundedVolumeListSceneQuery
    03173     {
    03174     public:
    03175         DefaultPlaneBoundedVolumeListSceneQuery(SceneManager* creator);
    03176         ~DefaultPlaneBoundedVolumeListSceneQuery();
    03177
    03179         void execute(SceneQueryListener* listener);
    03180     };
    03182     class _OgreExport DefaultAxisAlignedBoxSceneQuery : public AxisAlignedBoxSceneQuery
    03183     {
    03184     public:
    03185         DefaultAxisAlignedBoxSceneQuery(SceneManager* creator);
    03186         ~DefaultAxisAlignedBoxSceneQuery();
    03187
    03189         void execute(SceneQueryListener* listener);
    03190     };
    03191
    03192
    03194     typedef uint16 SceneTypeMask;
    03195
    03199     enum SceneType
    03200     {
    03201         ST_GENERIC = 1,
    03202         ST_EXTERIOR_CLOSE = 2,
    03203         ST_EXTERIOR_FAR = 4,
    03204         ST_EXTERIOR_REAL_FAR = 8,
    03205         ST_INTERIOR = 16
    03206     };
    03207
    03209     struct SceneManagerMetaData
    03210     {
    03212         String typeName;
    03214         String description;
    03216         SceneTypeMask sceneTypeMask;
    03218         bool worldGeometrySupported;
    03219     };
    03220
    03221
    03222
    03224     class _OgreExport SceneManagerFactory : public SceneMgtAlloc
    03225     {
    03226     protected:
    03227         mutable SceneManagerMetaData mMetaData;
    03228         mutable bool mMetaDataInit;
    03230         virtual void initMetaData(void) const = 0;
    03231     public:
    03232         SceneManagerFactory() : mMetaDataInit(true) {}
    03233         virtual ~SceneManagerFactory() {}
    03235         virtual const SceneManagerMetaData& getMetaData(void) const
    03236         {
    03237             if (mMetaDataInit)
    03238             {
    03239                 initMetaData();
    03240                 mMetaDataInit = false;
    03241             }
    03242             return mMetaData;
    03243         }
    03248         virtual SceneManager* createInstance(const String& instanceName) = 0;
    03250         virtual void destroyInstance(SceneManager* instance) = 0;
    03251
    03252     };
    03253
    03254
    03255
    03256 } // Namespace
    03257
    03258
    03259
    03260 #endif

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Dec 27 17:31:07 2009