# 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;
    00083
    00084         VisibleObjectsBoundsInfo()
    00085         {
    00086             reset();
    00087         }
    00088
    00089         void reset()
    00090         {
    00091             aabb.setNull();
    00092             receiverAabb.setNull();
    00093             minDistance = std::numeric_limits<Real>::infinity();
    00094             maxDistance = 0;
    00095         }
    00096
    00097         void merge(const AxisAlignedBox& boxBounds, const Sphere& sphereBounds,
    00098             const Camera* cam, bool receiver=true)
    00099         {
    00100             aabb.merge(boxBounds);
    00101             if (receiver)
    00102                 receiverAabb.merge(boxBounds);
    00103             Real camDistToCenter =
    00104                 (cam->getDerivedPosition() - sphereBounds.getCenter()).length();
    00105             minDistance = (std::min)(minDistance, (std::max)((Real)0, camDistToCenter - sphereBounds.getRadius()));
    00106             maxDistance = (std::max)(maxDistance, camDistToCenter + sphereBounds.getRadius());
    00107         }
    00108
    00109
    00110     };
    00111
    00141     class _OgreExport SceneManager : public SceneMgtAlloc
    00142     {
    00143     public:
    00145         static uint32 WORLD_GEOMETRY_TYPE_MASK;
    00147         static uint32 ENTITY_TYPE_MASK;
    00149         static uint32 FX_TYPE_MASK;
    00151         static uint32 STATICGEOMETRY_TYPE_MASK;
    00153         static uint32 LIGHT_TYPE_MASK;
    00155         static uint32 FRUSTUM_TYPE_MASK;
    00157         static uint32 USER_TYPE_MASK_LIMIT;
    00160         struct materialLess
    00161         {
    00162             _OgreExport bool operator()(const Material* x, const Material* y) const;
    00163         };
    00165         struct lightLess
    00166         {
    00167             _OgreExport bool operator()(const Light* a, const Light* b) const;
    00168         };
    00169
    00171         enum IlluminationRenderStage
    00172         {
    00174             IRS_NONE,
    00176             IRS_RENDER_TO_TEXTURE,
    00178             IRS_RENDER_RECEIVER_PASS
    00179         };
    00180
    00185         enum SpecialCaseRenderQueueMode
    00186         {
    00188             SCRQM_INCLUDE,
    00190             SCRQM_EXCLUDE
    00191         };
    00192
    00193         struct SkyDomeGenParameters
    00194         {
    00195             Real skyDomeCurvature;
    00196             Real skyDomeTiling;
    00197             Real skyDomeDistance;
    00198             int skyDomeXSegments;
    00199             int skyDomeYSegments;
    00200             int skyDomeYSegments_keep;
    00201         };
    00202
    00203         struct SkyPlaneGenParameters
    00204         {
    00205             Real skyPlaneScale;
    00206             Real skyPlaneTiling;
    00207             Real skyPlaneBow;
    00208             int skyPlaneXSegments;
    00209             int skyPlaneYSegments;
    00210         };
    00211
    00212         struct SkyBoxGenParameters
    00213         {
    00214             Real skyBoxDistance;
    00215         };
    00216
    00220         class Listener
    00221         {
    00222         public:
    00223             Listener() {}
    00224             virtual ~Listener() {}
    00225
    00235             virtual void preFindVisibleObjects(SceneManager* source,
    00236                 IlluminationRenderStage irs, Viewport* v) = 0;
    00247             virtual void postFindVisibleObjects(SceneManager* source,
    00248                 IlluminationRenderStage irs, Viewport* v) = 0;
    00249
    00264             virtual void shadowTexturesUpdated(size_t numberOfShadowTextures) = 0;
    00265
    00279             virtual void shadowTextureCasterPreViewProj(Light* light,
    00280                 Camera* camera, size_t iteration) = 0;
    00294             virtual void shadowTextureReceiverPreViewProj(Light* light,
    00295                 Frustum* frustum) = 0;
    00296
    00319             virtual bool sortLightsAffectingFrustum(LightList& lightList) { return false; }
    00320
    00321
    00322
    00323         };
    00324
    00328         class _OgreExport SceneMgrQueuedRenderableVisitor : public QueuedRenderableVisitor
    00329         {
    00330         protected:
    00332             const Pass* mUsedPass;
    00333         public:
    00334             SceneMgrQueuedRenderableVisitor()
    00335                 :transparentShadowCastersMode(false) {}
    00336             ~SceneMgrQueuedRenderableVisitor() {}
    00337             void visit(Renderable* r);
    00338             bool visit(const Pass* p);
    00339             void visit(RenderablePass* rp);
    00340
    00342             SceneManager* targetSceneMgr;
    00344             bool transparentShadowCastersMode;
    00346             bool autoLights;
    00348             const LightList* manualLightList;
    00350             bool scissoring;
    00351
    00352         };
    00354         friend class SceneMgrQueuedRenderableVisitor;
    00355
    00356     protected:
    00357
    00359         virtual SceneNode* createSceneNodeImpl(void);
    00361         virtual SceneNode* createSceneNodeImpl(const String& name);
    00362
    00364         String mName;
    00365
    00367         RenderQueue* mRenderQueue;
    00368         bool mLastRenderQueueInvocationCustom;
    00369
    00371         ColourValue mAmbientLight;
    00372
    00374         RenderSystem *mDestRenderSystem;
    00375
    00376         typedef std::map<String, Camera* > CameraList;
    00377
    00380         CameraList mCameras;
    00381
    00382         typedef std::map<String, StaticGeometry* > StaticGeometryList;
    00383         StaticGeometryList mStaticGeometryList;
    00384         typedef std::map<String, InstancedGeometry* > InstancedGeometryList;
    00385         InstancedGeometryList mInstancedGeometryList;
    00386
    00387         typedef std::map<String, SceneNode*> SceneNodeList;
    00388
    00395         SceneNodeList mSceneNodes;
    00396
    00398         Camera* mCameraInProgress;
    00400         Viewport* mCurrentViewport;
    00401
    00403         SceneNode* mSceneRoot;
    00404
    00406         typedef std::set<SceneNode*> AutoTrackingSceneNodes;
    00407         AutoTrackingSceneNodes mAutoTrackingSceneNodes;
    00408
    00409         // Sky params
    00410         // Sky plane
    00411         Entity* mSkyPlaneEntity;
    00412         Entity* mSkyDomeEntity[5];
    00413         ManualObject* mSkyBoxObj;
    00414
    00415         SceneNode* mSkyPlaneNode;
    00416         SceneNode* mSkyDomeNode;
    00417         SceneNode* mSkyBoxNode;
    00418
    00419         // Sky plane
    00420         bool mSkyPlaneEnabled;
    00421         uint8 mSkyPlaneRenderQueue;
    00422         Plane mSkyPlane;
    00423         SkyPlaneGenParameters mSkyPlaneGenParameters;
    00424         // Sky box
    00425         bool mSkyBoxEnabled;
    00426         uint8 mSkyBoxRenderQueue;
    00427         Quaternion mSkyBoxOrientation;
    00428         SkyBoxGenParameters mSkyBoxGenParameters;
    00429         // Sky dome
    00430         bool mSkyDomeEnabled;
    00431         uint8 mSkyDomeRenderQueue;
    00432         Quaternion mSkyDomeOrientation;
    00433         SkyDomeGenParameters mSkyDomeGenParameters;
    00434
    00435         // Fog
    00436         FogMode mFogMode;
    00437         ColourValue mFogColour;
    00438         Real mFogStart;
    00439         Real mFogEnd;
    00440         Real mFogDensity;
    00441
    00442         typedef std::set<uint8> SpecialCaseRenderQueueList;
    00443         SpecialCaseRenderQueueList mSpecialCaseQueueList;
    00444         SpecialCaseRenderQueueMode mSpecialCaseQueueMode;
    00445         uint8 mWorldGeometryRenderQueue;
    00446
    00447         unsigned long mLastFrameNumber;
    00448         Matrix4 mTempXform[256];
    00449         bool mResetIdentityView;
    00450         bool mResetIdentityProj;
    00451
    00452         bool mNormaliseNormalsOnScale;
    00453         bool mFlipCullingOnNegativeScale;
    00454         CullingMode mPassCullingMode;
    00455
    00456     protected:
    00457
    00465         typedef std::map< const Camera*, VisibleObjectsBoundsInfo> CamVisibleObjectsMap;
    00466         CamVisibleObjectsMap mCamVisibleObjectsMap;
    00467
    00469         typedef std::map< const Camera*, const Light* > ShadowCamLightMapping;
    00470         ShadowCamLightMapping mShadowCamLightMapping;
    00471
    00473         size_t mShadowTextureCountPerType[3];
    00474
    00476         std::vector<size_t> mShadowTextureIndexLightList;
    00477
    00479         struct _OgreExport LightInfo
    00480         {
    00481             Light* light;       // Just a pointer for comparison, the light might destroyed for some reason
    00482             int type;           // Use int instead of Light::LightTypes to avoid header file dependence
    00483             Real range;         // Sets to zero if directional light
    00484             Vector3 position;   // Sets to zero if directional light
    00485
    00486             bool operator== (const LightInfo& rhs) const
    00487             {
    00488                 return light == rhs.light && type == rhs.type &&
    00489                     range == rhs.range && position == rhs.position;
    00490             }
    00491
    00492             bool operator!= (const LightInfo& rhs) const
    00493             {
    00494                 return !(*this == rhs);
    00495             }
    00496         };
    00497
    00498         typedef std::vector<LightInfo> LightInfoList;
    00499
    00500         LightList mLightsAffectingFrustum;
    00501         LightInfoList mCachedLightInfos;
    00502         LightInfoList mTestLightInfos; // potentially new list
    00503         ulong mLightsDirtyCounter;
    00504
    00505         typedef std::map<String, MovableObject*> MovableObjectMap;
    00507         struct MovableObjectCollection
    00508         {
    00509             MovableObjectMap map;
    00510             OGRE_MUTEX(mutex)
    00511         };
    00512         typedef std::map<String, MovableObjectCollection*> MovableObjectCollectionMap;
    00513         MovableObjectCollectionMap mMovableObjectCollectionMap;
    00518         MovableObjectCollection* getMovableObjectCollection(const String& typeName);
    00523         const MovableObjectCollection* getMovableObjectCollection(const String& typeName) const;
    00525         OGRE_MUTEX(mMovableObjectCollectionMapMutex)
    00526
    00527
    00531         virtual void initRenderQueue(void);
    00533         Pass* mShadowCasterPlainBlackPass;
    00535         Pass* mShadowReceiverPass;
    00545         virtual const Pass* deriveShadowCasterPass(const Pass* pass);
    00554         virtual const Pass* deriveShadowReceiverPass(const Pass* pass);
    00555
    00562         virtual bool validatePassForRendering(const Pass* pass);
    00563
    00570         virtual bool validateRenderableForRendering(const Pass* pass, const Renderable* rend);
    00571
    00572         enum BoxPlane
    00573         {
    00574             BP_FRONT = 0,
    00575             BP_BACK = 1,
    00576             BP_LEFT = 2,
    00577             BP_RIGHT = 3,
    00578             BP_UP = 4,
    00579             BP_DOWN = 5
    00580         };
    00581
    00582         /* Internal utility method for creating the planes of a skybox.
    00583         */
    00584         virtual MeshPtr createSkyboxPlane(
    00585             BoxPlane bp,
    00586             Real distance,
    00587             const Quaternion& orientation,
    00588             const String& groupName);
    00589
    00590         /* Internal utility method for creating the planes of a skydome.
    00591         */
    00592         virtual MeshPtr createSkydomePlane(
    00593             BoxPlane bp,
    00594             Real curvature, Real tiling, Real distance,
    00595             const Quaternion& orientation,
    00596             int xsegments, int ysegments, int ySegmentsToKeep,
    00597             const String& groupName);
    00598
    00599         // Flag indicating whether SceneNodes will be rendered as a set of 3 axes
    00600         bool mDisplayNodes;
    00601
    00603         typedef std::map<String, Animation*> AnimationList;
    00604         AnimationList mAnimationsList;
    00605         OGRE_MUTEX(mAnimationsListMutex)
    00606         AnimationStateSet mAnimationStates;
    00607
    00608
    00611         virtual void useRenderableViewProjMode(const Renderable* pRend);
    00612
    00615         virtual void resetViewProjMode(void);
    00616
    00617         typedef std::vector<RenderQueueListener*> RenderQueueListenerList;
    00618         RenderQueueListenerList mRenderQueueListeners;
    00619
    00620         typedef std::vector<Listener*> ListenerList;
    00621         ListenerList mListeners;
    00623         virtual bool fireRenderQueueStarted(uint8 id, const String& invocation);
    00625         virtual bool fireRenderQueueEnded(uint8 id, const String& invocation);
    00626
    00628         virtual void fireShadowTexturesUpdated(size_t numberOfShadowTextures);
    00630         virtual void fireShadowTexturesPreCaster(Light* light, Camera* camera, size_t iteration);
    00632         virtual void fireShadowTexturesPreReceiver(Light* light, Frustum* f);
    00634         virtual void firePreFindVisibleObjects(Viewport* v);
    00636         virtual void firePostFindVisibleObjects(Viewport* v);
    00638         virtual void setViewport(Viewport *vp);
    00639
    00641         bool mShowBoundingBoxes;
    00642
    00644         virtual void renderVisibleObjectsDefaultSequence(void);
    00646         virtual void renderVisibleObjectsCustomSequence(RenderQueueInvocationSequence* s);
    00648         virtual void prepareRenderQueue(void);
    00649
    00650
    00666         virtual void renderSingleObject(Renderable* rend, const Pass* pass,
    00667             bool lightScissoringClipping, bool doLightIteration, const LightList* manualLightList = 0);
    00668
    00670         virtual AutoParamDataSource* createAutoParamDataSource(void) const
    00671         {
    00672             return OGRE_NEW AutoParamDataSource();
    00673         }
    00674
    00676         AutoParamDataSource* mAutoParamDataSource;
    00677
    00678         ShadowTechnique mShadowTechnique;
    00679         bool mDebugShadows;
    00680         ColourValue mShadowColour;
    00681         Pass* mShadowDebugPass;
    00682         Pass* mShadowStencilPass;
    00683         Pass* mShadowModulativePass;
    00684         bool mShadowMaterialInitDone;
    00685         HardwareIndexBufferSharedPtr mShadowIndexBuffer;
    00686         size_t mShadowIndexBufferSize;
    00687         Rectangle2D* mFullScreenQuad;
    00688         Real mShadowDirLightExtrudeDist;
    00689         IlluminationRenderStage mIlluminationStage;
    00690         ShadowTextureConfigList mShadowTextureConfigList;
    00691         bool mShadowTextureConfigDirty;
    00692         ShadowTextureList mShadowTextures;
    00693         TexturePtr mNullShadowTexture;
    00694         typedef std::vector<Camera*> ShadowTextureCameraList;
    00695         ShadowTextureCameraList mShadowTextureCameras;
    00696         Texture* mCurrentShadowTexture;
    00697         bool mShadowUseInfiniteFarPlane;
    00698         bool mShadowCasterRenderBackFaces;
    00699         bool mShadowAdditiveLightClip;
    00701         struct LightClippingInfo
    00702         {
    00703             RealRect scissorRect;
    00704             PlaneList clipPlanes;
    00705             bool scissorValid;
    00706             unsigned long clipPlanesValid;
    00707             LightClippingInfo() : scissorValid(false), clipPlanesValid(false) {}
    00708
    00709         };
    00710         typedef std::map<Light*, LightClippingInfo> LightClippingInfoMap;
    00711         LightClippingInfoMap mLightClippingInfoMap;
    00712         unsigned long mLightClippingInfoMapFrameNumber;
    00713
    00715         ShadowCameraSetupPtr mDefaultShadowCameraSetup;
    00716
    00725         struct lightsForShadowTextureLess
    00726         {
    00727             _OgreExport bool operator()(const Light* l1, const Light* l2) const;
    00728         };
    00729
    00730
    00737         virtual void findLightsAffectingFrustum(const Camera* camera);
    00739         virtual void initShadowVolumeMaterials(void);
    00741         virtual void ensureShadowTexturesCreated();
    00743         virtual void destroyShadowTextures(void);
    00745         virtual void prepareShadowTextures(Camera* cam, Viewport* vp);
    00746
    00754         virtual void renderShadowVolumesToStencil(const Light* light, const Camera* cam,
    00755             bool calcScissor);
    00761         virtual void setShadowVolumeStencilState(bool secondpass, bool zfail, bool twosided);
    00763         void renderShadowVolumeObjects(ShadowCaster::ShadowRenderableListIterator iShadowRenderables,
    00764             Pass* pass, const LightList *manualLightList, unsigned long flags,
    00765             bool secondpass, bool zfail, bool twosided);
    00766         typedef std::vector<ShadowCaster*> ShadowCasterList;
    00767         ShadowCasterList mShadowCasterList;
    00768         SphereSceneQuery* mShadowCasterSphereQuery;
    00769         AxisAlignedBoxSceneQuery* mShadowCasterAABBQuery;
    00770         Real mDefaultShadowFarDist;
    00771         Real mDefaultShadowFarDistSquared;
    00772         Real mShadowTextureOffset; // proportion of texture offset in view direction e.g. 0.4
    00773         Real mShadowTextureFadeStart; // as a proportion e.g. 0.6
    00774         Real mShadowTextureFadeEnd; // as a proportion e.g. 0.9
    00775         bool mShadowTextureSelfShadow;
    00776         Pass* mShadowTextureCustomCasterPass;
    00777         Pass* mShadowTextureCustomReceiverPass;
    00778         String mShadowTextureCustomCasterVertexProgram;
    00779         String mShadowTextureCustomReceiverVertexProgram;
    00780         String mShadowTextureCustomReceiverFragmentProgram;
    00781         GpuProgramParametersSharedPtr mShadowTextureCustomCasterVPParams;
    00782         GpuProgramParametersSharedPtr mShadowTextureCustomReceiverVPParams;
    00783         GpuProgramParametersSharedPtr mShadowTextureCustomReceiverFPParams;
    00784
    00786         uint32 mVisibilityMask;
    00787         bool mFindVisibleObjects;
    00788
    00790         bool mSuppressRenderStateChanges;
    00792         bool mSuppressShadows;
    00793
    00794
    00795         GpuProgramParametersSharedPtr mInfiniteExtrusionParams;
    00796         GpuProgramParametersSharedPtr mFiniteExtrusionParams;
    00797
    00799         class _OgreExport ShadowCasterSceneQueryListener : public SceneQueryListener, public SceneMgtAlloc
    00800         {
    00801         protected:
    00802             SceneManager* mSceneMgr;
    00803             ShadowCasterList* mCasterList;
    00804             bool mIsLightInFrustum;
    00805             const PlaneBoundedVolumeList* mLightClipVolumeList;
    00806             const Camera* mCamera;
    00807             const Light* mLight;
    00808             Real mFarDistSquared;
    00809         public:
    00810             ShadowCasterSceneQueryListener(SceneManager* sm) : mSceneMgr(sm),
    00811                 mCasterList(0), mIsLightInFrustum(false), mLightClipVolumeList(0),
    00812                 mCamera(0) {}
    00813             // Prepare the listener for use with a set of parameters
    00814             void prepare(bool lightInFrustum,
    00815                 const PlaneBoundedVolumeList* lightClipVolumes,
    00816                 const Light* light, const Camera* cam, ShadowCasterList* casterList,
    00817                 Real farDistSquared)
    00818             {
    00819                 mCasterList = casterList;
    00820                 mIsLightInFrustum = lightInFrustum;
    00821                 mLightClipVolumeList = lightClipVolumes;
    00822                 mCamera = cam;
    00823                 mLight = light;
    00824                 mFarDistSquared = farDistSquared;
    00825             }
    00826             bool queryResult(MovableObject* object);
    00827             bool queryResult(SceneQuery::WorldFragment* fragment);
    00828         };
    00829
    00830         ShadowCasterSceneQueryListener* mShadowCasterQueryListener;
    00831
    00838         virtual const ShadowCasterList& findShadowCastersForLight(const Light* light,
    00839             const Camera* camera);
    00841         virtual void renderBasicQueueGroupObjects(RenderQueueGroup* pGroup,
    00842             QueuedRenderableCollection::OrganisationMode om);
    00844         virtual void renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* group,
    00845             QueuedRenderableCollection::OrganisationMode om);
    00847         virtual void renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* group,
    00848             QueuedRenderableCollection::OrganisationMode om);
    00850         virtual void renderTextureShadowCasterQueueGroupObjects(RenderQueueGroup* group,
    00851             QueuedRenderableCollection::OrganisationMode om);
    00853         virtual void renderTextureShadowReceiverQueueGroupObjects(RenderQueueGroup* group,
    00854             QueuedRenderableCollection::OrganisationMode om);
    00856         virtual void renderModulativeTextureShadowedQueueGroupObjects(RenderQueueGroup* group,
    00857             QueuedRenderableCollection::OrganisationMode om);
    00858
    00860         virtual void renderAdditiveTextureShadowedQueueGroupObjects(RenderQueueGroup* group,
    00861             QueuedRenderableCollection::OrganisationMode om);
    00863         virtual void renderObjects(const QueuedRenderableCollection& objs,
    00864             QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping,
    00865             bool doLightIteration, const LightList* manualLightList = 0);
    00871         virtual void renderTransparentShadowCasterObjects(const QueuedRenderableCollection& objs,
    00872             QueuedRenderableCollection::OrganisationMode om, bool lightScissoringClipping,
    00873             bool doLightIteration, const LightList* manualLightList = 0);
    00874
    00877         virtual void updateRenderQueueSplitOptions(void);
    00880         virtual void updateRenderQueueGroupSplitOptions(RenderQueueGroup* group,
    00881             bool suppressShadows, bool suppressRenderState);
    00882
    00884         virtual ClipResult buildAndSetScissor(const LightList& ll, const Camera* cam);
    00886         virtual void buildScissor(const Light* l, const Camera* cam, RealRect& rect);
    00887         virtual void resetScissor();
    00889         virtual ClipResult buildAndSetLightClip(const LightList& ll);
    00890         virtual void buildLightClip(const Light* l, PlaneList& planes);
    00891         virtual void resetLightClip();
    00892         virtual void checkCachedLightClippingInfo();
    00893
    00895         SceneMgrQueuedRenderableVisitor* mActiveQueuedRenderableVisitor;
    00897         SceneMgrQueuedRenderableVisitor mDefaultQueuedRenderableVisitor;
    00898
    00900         bool mCameraRelativeRendering;
    00901         Matrix4 mCachedViewMatrix;
    00902         Vector3 mCameraRelativePosition;
    00903
    00904     public:
    00907         SceneManager(const String& instanceName);
    00908
    00911         virtual ~SceneManager();
    00912
    00913
    00939         OGRE_MUTEX(sceneGraphMutex)
    00940
    00941
    00942         const String& getName(void) const { return mName; }
    00943
    00950         virtual const String& getTypeName(void) const = 0;
    00951
    00959         virtual Camera* createCamera(const String& name);
    00960
    00964         virtual Camera* getCamera(const String& name) const;
    00965
    00968         virtual bool hasCamera(const String& name) const;
    00969
    00978         virtual void destroyCamera(Camera *cam);
    00979
    00985         virtual void destroyCamera(const String& name);
    00986
    00995         virtual void destroyAllCameras(void);
    00996
    01007         virtual Light* createLight(const String& name);
    01008
    01012         virtual Light* getLight(const String& name) const;
    01013
    01016         virtual bool hasLight(const String& name) const;
    01017
    01020         virtual const PlaneList& getLightClippingPlanes(Light* l);
    01021
    01024         virtual const RealRect& getLightScissorRect(Light* l, const Camera* cam);
    01025
    01030         virtual void destroyLight(const String& name);
    01031
    01036         virtual void destroyLight(Light* light);
    01039         virtual void destroyAllLights(void);
    01040
    01051         virtual void _notifyLightsDirty(void);
    01052
    01065         ulong _getLightsDirtyCounter(void) const { return mLightsDirtyCounter; }
    01066
    01073         virtual const LightList& _getLightsAffectingFrustum(void) const;
    01074
    01096         virtual void _populateLightList(const Vector3& position, Real radius, LightList& destList);
    01097
    01098
    01115         virtual SceneNode* createSceneNode(void);
    01116
    01131         virtual SceneNode* createSceneNode(const String& name);
    01132
    01139         virtual void destroySceneNode(const String& name);
    01140
    01147         virtual void destroySceneNode(SceneNode* sn);
    01163         virtual SceneNode* getRootSceneNode(void);
    01164
    01172         virtual SceneNode* getSceneNode(const String& name) const;
    01173
    01176         virtual bool hasSceneNode(const String& name) const;
    01177
    01178
    01186         virtual Entity* createEntity(const String& entityName, const String& meshName);
    01187
    01194         enum PrefabType {
    01195             PT_PLANE,
    01196             PT_CUBE,
    01197             PT_SPHERE
    01198         };
    01199
    01206         virtual Entity* createEntity(const String& entityName, PrefabType ptype);
    01210         virtual Entity* getEntity(const String& name) const;
    01213         virtual bool hasEntity(const String& name) const;
    01214
    01223         virtual void destroyEntity(Entity* ent);
    01224
    01233         virtual void destroyEntity(const String& name);
    01234
    01244         virtual void destroyAllEntities(void);
    01245
    01251         virtual ManualObject* createManualObject(const String& name);
    01255         virtual ManualObject* getManualObject(const String& name) const;
    01258         virtual bool hasManualObject(const String& name) const;
    01259
    01262         virtual void destroyManualObject(ManualObject* obj);
    01265         virtual void destroyManualObject(const String& name);
    01268         virtual void destroyAllManualObjects(void);
    01274         virtual BillboardChain* createBillboardChain(const String& name);
    01278         virtual BillboardChain* getBillboardChain(const String& name) const;
    01281         virtual bool hasBillboardChain(const String& name) const;
    01282
    01285         virtual void destroyBillboardChain(BillboardChain* obj);
    01288         virtual void destroyBillboardChain(const String& name);
    01291         virtual void destroyAllBillboardChains(void);
    01297         virtual RibbonTrail* createRibbonTrail(const String& name);
    01301         virtual RibbonTrail* getRibbonTrail(const String& name) const;
    01304         virtual bool hasRibbonTrail(const String& name) const;
    01305
    01308         virtual void destroyRibbonTrail(RibbonTrail* obj);
    01311         virtual void destroyRibbonTrail(const String& name);
    01314         virtual void destroyAllRibbonTrails(void);
    01315
    01336         virtual ParticleSystem* createParticleSystem(const String& name,
    01337             const String& templateName);
    01357         virtual ParticleSystem* createParticleSystem(const String& name,
    01358             size_t quota = 500,
    01359             const String& resourceGroup = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01363         virtual ParticleSystem* getParticleSystem(const String& name) const;
    01366         virtual bool hasParticleSystem(const String& name) const;
    01367
    01370         virtual void destroyParticleSystem(ParticleSystem* obj);
    01373         virtual void destroyParticleSystem(const String& name);
    01376         virtual void destroyAllParticleSystems(void);
    01377
    01383         virtual void clearScene(void);
    01384
    01397         void setAmbientLight(const ColourValue& colour);
    01398
    01401         const ColourValue& getAmbientLight(void) const;
    01402
    01418         virtual void prepareWorldGeometry(const String& filename);
    01419
    01437         virtual void prepareWorldGeometry(DataStreamPtr& stream,
    01438             const String& typeName = StringUtil::BLANK);
    01439
    01452         virtual void setWorldGeometry(const String& filename);
    01453
    01469         virtual void setWorldGeometry(DataStreamPtr& stream,
    01470             const String& typeName = StringUtil::BLANK);
    01471
    01484         virtual size_t estimateWorldGeometry(const String& filename) { return 0; }
    01485
    01498         virtual size_t estimateWorldGeometry(DataStreamPtr& stream,
    01499             const String& typeName = StringUtil::BLANK) { return 0; }
    01514         virtual ViewPoint getSuggestedViewpoint(bool random = false);
    01515
    01529         virtual bool setOption( const String& strKey, const void* pValue ) { return false; }
    01530
    01544         virtual bool getOption( const String& strKey, void* pDestValue ) { return false; }
    01545
    01555         virtual bool hasOption( const String& strKey ) const { return false; }
    01570         virtual bool getOptionValues( const String& strKey, StringVector& refValueList ) { return false; }
    01571
    01578         virtual bool getOptionKeys( StringVector& refKeys ) { return false; }
    01579
    01588         virtual void _updateSceneGraph(Camera* cam);
    01589
    01601         virtual void _findVisibleObjects(Camera* cam, VisibleObjectsBoundsInfo* visibleBounds, bool onlyShadowCasters);
    01602
    01607         virtual void _applySceneAnimations(void);
    01608
    01611         virtual void _renderVisibleObjects(void);
    01612
    01626         virtual void _renderScene(Camera* camera, Viewport* vp, bool includeOverlays);
    01627
    01631         virtual void _queueSkiesForRendering(Camera* cam);
    01632
    01633
    01634
    01643         virtual void _setDestinationRenderSystem(RenderSystem* sys);
    01644
    01698         virtual void setSkyPlane(
    01699             bool enable,
    01700             const Plane& plane, const String& materialName, Real scale = 1000,
    01701             Real tiling = 10, bool drawFirst = true, Real bow = 0,
    01702             int xsegments = 1, int ysegments = 1,
    01703             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01747         virtual void _setSkyPlane(
    01748             bool enable,
    01749             const Plane& plane, const String& materialName, Real scale = 1000,
    01750             Real tiling = 10, uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY, Real bow = 0,
    01751             int xsegments = 1, int ysegments = 1,
    01752             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01753
    01755         virtual bool isSkyPlaneEnabled(void) const { return mSkyPlaneEnabled; }
    01756
    01758         virtual SceneNode* getSkyPlaneNode(void) const { return mSkyPlaneNode; }
    01759
    01761         virtual const SkyPlaneGenParameters& getSkyPlaneGenParameters(void) const { return mSkyPlaneGenParameters; }
    01762
    01804         virtual void setSkyBox(
    01805             bool enable, const String& materialName, Real distance = 5000,
    01806             bool drawFirst = true, const Quaternion& orientation = Quaternion::IDENTITY,
    01807             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01808
    01841         virtual void _setSkyBox(
    01842             bool enable, const String& materialName, Real distance = 5000,
    01843             uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY, const Quaternion& orientation = Quaternion::IDENTITY,
    01844             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01845
    01847         virtual bool isSkyBoxEnabled(void) const { return mSkyBoxEnabled; }
    01848
    01850         virtual SceneNode* getSkyBoxNode(void) const { return mSkyBoxNode; }
    01851
    01853         virtual const SkyBoxGenParameters& getSkyBoxGenParameters(void) const { return mSkyBoxGenParameters; }
    01854
    01910         virtual void setSkyDome(
    01911             bool enable, const String& materialName, Real curvature = 10,
    01912             Real tiling = 8, Real distance = 4000, bool drawFirst = true,
    01913             const Quaternion& orientation = Quaternion::IDENTITY,
    01914             int xsegments = 16, int ysegments = 16, int ysegments_keep = -1,
    01915             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01916
    01963         virtual void _setSkyDome(
    01964             bool enable, const String& materialName, Real curvature = 10,
    01965             Real tiling = 8, Real distance = 4000, uint8 renderQueue = RENDER_QUEUE_SKIES_EARLY,
    01966             const Quaternion& orientation = Quaternion::IDENTITY,
    01967             int xsegments = 16, int ysegments = 16, int ysegments_keep = -1,
    01968             const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
    01969
    01971         virtual bool isSkyDomeEnabled(void) const { return mSkyDomeEnabled; }
    01972
    01974         virtual SceneNode* getSkyDomeNode(void) const { return mSkyDomeNode; }
    01975
    01977         virtual const SkyDomeGenParameters& getSkyDomeGenParameters(void) const { return mSkyDomeGenParameters; }
    01978
    02003         void setFog(
    02004             FogMode mode = FOG_NONE, const ColourValue& colour = ColourValue::White,
    02005             Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0);
    02006
    02009         virtual FogMode getFogMode(void) const;
    02010
    02013         virtual const ColourValue& getFogColour(void) const;
    02014
    02017         virtual Real getFogStart(void) const;
    02018
    02021         virtual Real getFogEnd(void) const;
    02022
    02025         virtual Real getFogDensity(void) const;
    02026
    02027
    02045         virtual BillboardSet* createBillboardSet(const String& name, unsigned int poolSize = 20);
    02046
    02050         virtual BillboardSet* getBillboardSet(const String& name) const;
    02053         virtual bool hasBillboardSet(const String& name) const;
    02054
    02061         virtual void destroyBillboardSet(BillboardSet* set);
    02062
    02069         virtual void destroyBillboardSet(const String& name);
    02070
    02080         virtual void destroyAllBillboardSets(void);
    02081
    02089         virtual void setDisplaySceneNodes(bool display);
    02091         virtual bool getDisplaySceneNodes(void) const {return mDisplayNodes;}
    02092
    02113         virtual Animation* createAnimation(const String& name, Real length);
    02114
    02118         virtual Animation* getAnimation(const String& name) const;
    02121         virtual bool hasAnimation(const String& name) const;
    02122
    02128         virtual void destroyAnimation(const String& name);
    02129
    02131         virtual void destroyAllAnimations(void);
    02132
    02160         virtual AnimationState* createAnimationState(const String& animName);
    02161
    02165         virtual AnimationState* getAnimationState(const String& animName) const;
    02168         virtual bool hasAnimationState(const String& name) const;
    02169
    02175         virtual void destroyAnimationState(const String& name);
    02176
    02178         virtual void destroyAllAnimationStates(void);
    02179
    02203         virtual void manualRender(RenderOperation* rend, Pass* pass, Viewport* vp,
    02204             const Matrix4& worldMatrix, const Matrix4& viewMatrix, const Matrix4& projMatrix,
    02205             bool doBeginEndFrame = false) ;
    02206
    02217         virtual RenderQueue* getRenderQueue(void);
    02218
    02222         virtual void addRenderQueueListener(RenderQueueListener* newListener);
    02223
    02225         virtual void removeRenderQueueListener(RenderQueueListener* delListener);
    02226
    02240         virtual void addSpecialCaseRenderQueue(uint8 qid);
    02246         virtual void removeSpecialCaseRenderQueue(uint8 qid);
    02250         virtual void clearSpecialCaseRenderQueues(void);
    02255         virtual void setSpecialCaseRenderQueueMode(SpecialCaseRenderQueueMode mode);
    02257         virtual SpecialCaseRenderQueueMode getSpecialCaseRenderQueueMode(void);
    02264         virtual bool isRenderQueueToBeProcessed(uint8 qid);
    02265
    02281         virtual void setWorldGeometryRenderQueue(uint8 qid);
    02292         virtual uint8 getWorldGeometryRenderQueue(void);
    02293
    02295         virtual void showBoundingBoxes(bool bShow);
    02296
    02298         virtual bool getShowBoundingBoxes() const;
    02299
    02301         virtual void _notifyAutotrackingSceneNode(SceneNode* node, bool autoTrack);
    02302
    02303
    02316         virtual AxisAlignedBoxSceneQuery*
    02317             createAABBQuery(const AxisAlignedBox& box, unsigned long mask = 0xFFFFFFFF);
    02330         virtual SphereSceneQuery*
    02331             createSphereQuery(const Sphere& sphere, unsigned long mask = 0xFFFFFFFF);
    02344         virtual PlaneBoundedVolumeListSceneQuery*
    02345             createPlaneBoundedVolumeQuery(const PlaneBoundedVolumeList& volumes, unsigned long mask = 0xFFFFFFFF);
    02346
    02347
    02360         virtual RaySceneQuery*
    02361             createRayQuery(const Ray& ray, unsigned long mask = 0xFFFFFFFF);
    02362         //PyramidSceneQuery* createPyramidQuery(const Pyramid& p, unsigned long mask = 0xFFFFFFFF);
    02374         virtual IntersectionSceneQuery*
    02375             createIntersectionQuery(unsigned long mask = 0xFFFFFFFF);
    02376
    02378         virtual void destroyQuery(SceneQuery* query);
    02379
    02380         typedef MapIterator<CameraList> CameraIterator;
    02381         typedef MapIterator<AnimationList> AnimationIterator;
    02382
    02385         CameraIterator getCameraIterator(void) {
    02386             return CameraIterator(mCameras.begin(), mCameras.end());
    02387         }
    02389         AnimationIterator getAnimationIterator(void) {
    02390             return AnimationIterator(mAnimationsList.begin(), mAnimationsList.end());
    02391         }
    02393         AnimationStateIterator getAnimationStateIterator(void) {
    02394             return mAnimationStates.getAnimationStateIterator();
    02395         }
    02396
    02429         virtual void setShadowTechnique(ShadowTechnique technique);
    02430
    02432         virtual ShadowTechnique getShadowTechnique(void) const { return mShadowTechnique; }
    02433
    02435         virtual void setShowDebugShadows(bool debug) { mDebugShadows = debug; }
    02437         virtual bool getShowDebugShadows(void ) const { return mDebugShadows; }
    02438
    02445         virtual void setShadowColour(const ColourValue& colour);
    02452         virtual const ColourValue& getShadowColour(void) const;
    02464         virtual void setShadowDirectionalLightExtrusionDistance(Real dist);
    02467         virtual Real getShadowDirectionalLightExtrusionDistance(void) const;
    02484         virtual void setShadowFarDistance(Real distance);
    02488         virtual Real getShadowFarDistance(void) const
    02489         { return mDefaultShadowFarDist; }
    02490         virtual Real getShadowFarDistanceSquared(void) const
    02491         { return mDefaultShadowFarDistSquared; }
    02492
    02518         virtual void setShadowIndexBufferSize(size_t size);
    02520         virtual size_t getShadowIndexBufferSize(void) const
    02521         { return mShadowIndexBufferSize; }
    02530         virtual void setShadowTextureSize(unsigned short size);
    02531
    02538         virtual void setShadowTextureConfig(size_t shadowIndex, unsigned short width,
    02539             unsigned short height, PixelFormat format);
    02545         virtual void setShadowTextureConfig(size_t shadowIndex,
    02546             const ShadowTextureConfig& config);
    02547
    02549         ConstShadowTextureConfigIterator getShadowTextureConfigIterator() const;
    02550
    02562         virtual void setShadowTexturePixelFormat(PixelFormat fmt);
    02570         virtual void setShadowTextureCount(size_t count);
    02572         size_t getShadowTextureCount(void) const {return mShadowTextureConfigList.size(); }
    02573
    02583         void setShadowTextureCountPerLightType(Light::LightTypes type, size_t count)
    02584         { mShadowTextureCountPerType[type] = count; }
    02586         size_t getShadowTextureCountPerLightType(Light::LightTypes type) const
    02587         {return mShadowTextureCountPerType[type]; }
    02588
    02597         virtual void setShadowTextureSettings(unsigned short size, unsigned short count,
    02598             PixelFormat fmt = PF_X8R8G8B8);
    02599
    02606         virtual const TexturePtr& getShadowTexture(size_t shadowIndex);
    02607
    02622         virtual void setShadowDirLightTextureOffset(Real offset) { mShadowTextureOffset = offset;}
    02626         virtual Real getShadowDirLightTextureOffset(void)  const { return mShadowTextureOffset; }
    02634         virtual void setShadowTextureFadeStart(Real fadeStart)
    02635         { mShadowTextureFadeStart = fadeStart; }
    02643         virtual void setShadowTextureFadeEnd(Real fadeEnd)
    02644         { mShadowTextureFadeEnd = fadeEnd; }
    02645
    02658         virtual void setShadowTextureSelfShadow(bool selfShadow);
    02659
    02661         virtual bool getShadowTextureSelfShadow(void) const
    02662         { return mShadowTextureSelfShadow; }
    02683         virtual void setShadowTextureCasterMaterial(const String& name);
    02705         virtual void setShadowTextureReceiverMaterial(const String& name);
    02706
    02717         virtual void setShadowCasterRenderBackFaces(bool bf) { mShadowCasterRenderBackFaces = bf; }
    02718
    02722         virtual bool getShadowCasterRenderBackFaces() const { return mShadowCasterRenderBackFaces; }
    02723
    02728         virtual void setShadowCameraSetup(const ShadowCameraSetupPtr& shadowSetup);
    02729
    02734         virtual const ShadowCameraSetupPtr& getShadowCameraSetup() const;
    02735
    02772         virtual void setShadowUseInfiniteFarPlane(bool enable) {
    02773             mShadowUseInfiniteFarPlane = enable; }
    02774
    02776         virtual bool isShadowTechniqueStencilBased(void) const
    02777         { return (mShadowTechnique & SHADOWDETAILTYPE_STENCIL) != 0; }
    02779         virtual bool isShadowTechniqueTextureBased(void) const
    02780         { return (mShadowTechnique & SHADOWDETAILTYPE_TEXTURE) != 0; }
    02782         virtual bool isShadowTechniqueModulative(void) const
    02783         { return (mShadowTechnique & SHADOWDETAILTYPE_MODULATIVE) != 0; }
    02785         virtual bool isShadowTechniqueAdditive(void) const
    02786         { return (mShadowTechnique & SHADOWDETAILTYPE_ADDITIVE) != 0; }
    02788         virtual bool isShadowTechniqueIntegrated(void) const
    02789         { return (mShadowTechnique & SHADOWDETAILTYPE_INTEGRATED) != 0; }
    02791         virtual bool isShadowTechniqueInUse(void) const
    02792         { return mShadowTechnique != SHADOWTYPE_NONE; }
    02796         virtual void setShadowUseLightClipPlanes(bool enabled) { mShadowAdditiveLightClip = enabled; }
    02800         virtual bool getShadowUseLightClipPlanes() const { return mShadowAdditiveLightClip; }
    02801
    02804         virtual void addListener(Listener* s);
    02807         virtual void removeListener(Listener* s);
    02808
    02818         virtual StaticGeometry* createStaticGeometry(const String& name);
    02822         virtual StaticGeometry* getStaticGeometry(const String& name) const;
    02824         virtual bool hasStaticGeometry(const String& name) const;
    02826         virtual void destroyStaticGeometry(StaticGeometry* geom);
    02828         virtual void destroyStaticGeometry(const String& name);
    02830         virtual void destroyAllStaticGeometry(void);
    02831
    02841         virtual InstancedGeometry* createInstancedGeometry(const String& name);
    02843         virtual InstancedGeometry* getInstancedGeometry(const String& name) const;
    02845         virtual void destroyInstancedGeometry(InstancedGeometry* geom);
    02847         virtual void destroyInstancedGeometry(const String& name);
    02849         virtual void destroyAllInstancedGeometry(void);
    02850
    02851
    02862         virtual MovableObject* createMovableObject(const String& name,
    02863             const String& typeName, const NameValuePairList* params = 0);
    02869         virtual void destroyMovableObject(const String& name, const String& typeName);
    02875         virtual void destroyMovableObject(MovableObject* m);
    02877         virtual void destroyAllMovableObjectsByType(const String& typeName);
    02879         virtual void destroyAllMovableObjects(void);
    02883         virtual MovableObject* getMovableObject(const String& name, const String& typeName) const;
    02885         virtual bool hasMovableObject(const String& name, const String& typeName) const;
    02886         typedef MapIterator<MovableObjectMap> MovableObjectIterator;
    02892         virtual MovableObjectIterator getMovableObjectIterator(const String& typeName);
    02904         virtual void injectMovableObject(MovableObject* m);
    02911         virtual void extractMovableObject(const String& name, const String& typeName);
    02918         virtual void extractMovableObject(MovableObject* m);
    02925         virtual void extractAllMovableObjectsByType(const String& typeName);
    02926
    02933         virtual void setVisibilityMask(uint32 vmask) { mVisibilityMask = vmask; }
    02934
    02938         virtual uint32 getVisibilityMask(void) { return mVisibilityMask; }
    02939
    02943         uint32 _getCombinedVisibilityMask(void) const;
    02944
    02951         virtual void setFindVisibleObjects(bool find) { mFindVisibleObjects = find; }
    02952
    02956         virtual bool getFindVisibleObjects(void) { return mFindVisibleObjects; }
    02957
    02966         virtual void setNormaliseNormalsOnScale(bool n) { mNormaliseNormalsOnScale = n; }
    02967
    02971         virtual bool getNormaliseNormalsOnScale() const { return mNormaliseNormalsOnScale; }
    02972
    02981         virtual void setFlipCullingOnNegativeScale(bool n) { mFlipCullingOnNegativeScale = n; }
    02982
    02986         virtual bool getFlipCullingOnNegativeScale() const { return mFlipCullingOnNegativeScale; }
    02987
    02993         virtual void _injectRenderWithPass(Pass *pass, Renderable *rend, bool shadowDerivation = true);
    02994
    03013         virtual void _suppressRenderStateChanges(bool suppress);
    03014
    03018         virtual bool _areRenderStateChangesSuppressed(void) const
    03019         { return mSuppressRenderStateChanges; }
    03020
    03033         virtual const Pass* _setPass(const Pass* pass,
    03034             bool evenIfSuppressed = false, bool shadowDerivation = true);
    03035
    03036
    03046         virtual void _suppressShadows(bool suppress);
    03047
    03051         virtual bool _areShadowsSuppressed(void) const
    03052         { return mSuppressShadows; }
    03053
    03057         virtual void _renderQueueGroupObjects(RenderQueueGroup* group,
    03058             QueuedRenderableCollection::OrganisationMode om);
    03059
    03075         void setQueuedRenderableVisitor(SceneMgrQueuedRenderableVisitor* visitor);
    03076
    03078         SceneMgrQueuedRenderableVisitor* getQueuedRenderableVisitor(void) const;
    03079
    03080
    03084         RenderSystem *getDestinationRenderSystem();
    03085
    03088         Viewport* getCurrentViewport(void) const { return mCurrentViewport; }
    03089
    03091         const VisibleObjectsBoundsInfo& getVisibleObjectsBoundsInfo(const Camera* cam) const;
    03092
    03094         const VisibleObjectsBoundsInfo& getShadowCasterBoundsInfo(const Light* light, size_t iteration = 0) const;
    03095
    03110         virtual void setCameraRelativeRendering(bool rel) { mCameraRelativeRendering = rel; }
    03111
    03115         virtual bool getCameraRelativeRendering() const { return mCameraRelativeRendering; }
    03116     };
    03117
    03119     class _OgreExport DefaultIntersectionSceneQuery :
    03120         public IntersectionSceneQuery
    03121     {
    03122     public:
    03123         DefaultIntersectionSceneQuery(SceneManager* creator);
    03124         ~DefaultIntersectionSceneQuery();
    03125
    03127         void execute(IntersectionSceneQueryListener* listener);
    03128     };
    03129
    03131     class _OgreExport DefaultRaySceneQuery : public RaySceneQuery
    03132     {
    03133     public:
    03134         DefaultRaySceneQuery(SceneManager* creator);
    03135         ~DefaultRaySceneQuery();
    03136
    03138         void execute(RaySceneQueryListener* listener);
    03139     };
    03141     class _OgreExport DefaultSphereSceneQuery : public SphereSceneQuery
    03142     {
    03143     public:
    03144         DefaultSphereSceneQuery(SceneManager* creator);
    03145         ~DefaultSphereSceneQuery();
    03146
    03148         void execute(SceneQueryListener* listener);
    03149     };
    03151     class _OgreExport DefaultPlaneBoundedVolumeListSceneQuery : public PlaneBoundedVolumeListSceneQuery
    03152     {
    03153     public:
    03154         DefaultPlaneBoundedVolumeListSceneQuery(SceneManager* creator);
    03155         ~DefaultPlaneBoundedVolumeListSceneQuery();
    03156
    03158         void execute(SceneQueryListener* listener);
    03159     };
    03161     class _OgreExport DefaultAxisAlignedBoxSceneQuery : public AxisAlignedBoxSceneQuery
    03162     {
    03163     public:
    03164         DefaultAxisAlignedBoxSceneQuery(SceneManager* creator);
    03165         ~DefaultAxisAlignedBoxSceneQuery();
    03166
    03168         void execute(SceneQueryListener* listener);
    03169     };
    03170
    03171
    03173     typedef uint16 SceneTypeMask;
    03174
    03178     enum SceneType
    03179     {
    03180         ST_GENERIC = 1,
    03181         ST_EXTERIOR_CLOSE = 2,
    03182         ST_EXTERIOR_FAR = 4,
    03183         ST_EXTERIOR_REAL_FAR = 8,
    03184         ST_INTERIOR = 16
    03185     };
    03186
    03188     struct SceneManagerMetaData
    03189     {
    03191         String typeName;
    03193         String description;
    03195         SceneTypeMask sceneTypeMask;
    03197         bool worldGeometrySupported;
    03198     };
    03199
    03200
    03201
    03203     class _OgreExport SceneManagerFactory : public SceneMgtAlloc
    03204     {
    03205     protected:
    03206         mutable SceneManagerMetaData mMetaData;
    03207         mutable bool mMetaDataInit;
    03209         virtual void initMetaData(void) const = 0;
    03210     public:
    03211         SceneManagerFactory() : mMetaDataInit(true) {}
    03212         virtual ~SceneManagerFactory() {}
    03214         virtual const SceneManagerMetaData& getMetaData(void) const
    03215         {
    03216             if (mMetaDataInit)
    03217             {
    03218                 initMetaData();
    03219                 mMetaDataInit = false;
    03220             }
    03221             return mMetaData;
    03222         }
    03227         virtual SceneManager* createInstance(const String& instanceName) = 0;
    03229         virtual void destroyInstance(SceneManager* instance) = 0;
    03230
    03231     };
    03232
    03233
    03234
    03235 } // Namespace
    03236
    03237
    03238
    03239 #endif

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Jul 26 11:32:20 2009