2
// C++ Interface: EmberPagingSceneManager
7
// Author: Erik Hjortsberg <erik.hjortsberg@gmail.com>, (C) 2005
9
// This program is free software; you can redistribute it and/or modify
10
// it under the terms of the GNU General Public License as published by
11
// the Free Software Foundation; either version 2 of the License, or
12
// (at your option) any later version.
14
// This program is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
// GNU General Public License for more details.
19
// You should have received a copy of the GNU General Public License
20
// along with this program; if not, write to the Free Software
21
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.//
24
#ifndef EMBERPAGINGSCENEMANAGER_H
25
#define EMBERPAGINGSCENEMANAGER_H
27
#include "../../../EmberOgrePrerequisites.h"
28
#include "OgrePagingLandScapeSceneManager.h"
33
class EmberPagingSceneManager;
36
class ITerrainPageBridge;
43
* @brief Page data for one page in the terrain rendering system.
48
virtual ~IPageData() {}
49
virtual Ogre::MaterialPtr getMaterial() = 0;
54
* @brief Provides IPageData instances for the terrain rendering system.
56
class IPageDataProvider
59
typedef std::pair<unsigned int, unsigned int> OgreIndex;
60
virtual IPageData* getPageData(const OgreIndex& index) = 0;
61
virtual int getPageIndexSize() const = 0;
62
virtual void setUpTerrainPageAtIndex(const OgreIndex& ogreIndexPosition, ::Ember::OgreView::Terrain::ITerrainPageBridge* bridge) = 0;
63
virtual void removeBridge(const OgreIndex& ogreIndexPosition) = 0;
67
/// Factory for OctreeSceneManager
68
class EmberPagingSceneManagerFactory : public Ogre::SceneManagerFactory
71
void initMetaData(void) const;
73
EmberPagingSceneManagerFactory() {}
74
virtual ~EmberPagingSceneManagerFactory() {}
76
static const Ogre::String FACTORY_TYPE_NAME;
77
Ogre::SceneManager* createInstance(const Ogre::String& instanceName);
78
void destroyInstance(Ogre::SceneManager* instance);
82
* This is a specialization of Ogre::PagingLandScapeSceneManager.
84
* @see Ogre::PagingLandScapeSceneManager
86
class EmberPagingSceneManager : public Ogre::PagingLandScapeSceneManager {
89
void InitScene( void );
91
EmberPagingSceneManager(const Ogre::String &name);
94
* Utility method for creating a new Model.
95
* @param modelName the id of the model
96
* @param modelDefinitionName the name of the model defition from which the model should be created
99
Model::Model* createModel(const Ogre::String& modelName, const Ogre::String& modelDefinitionName);
101
void registerProvider(IPageDataProvider* provider);
103
IPageDataProvider* getProvider();
105
const Ogre::String& getTypeName(void) const;
110
* @see OgreView::EmberTerrainSceneManager::getPageOffset()
112
Ogre::ushort mPageOffset;
115
* Max and min values for the world. Used to resize the octree.
124
IPageDataProvider* mProvider;
126
virtual const Ogre::Pass* deriveShadowCasterPass(const Ogre::Pass* pass);
135
#endif // EMBERPAGINGSCENEMANAGER_H