39 #ifndef TERRAINSCENEMANAGER_H
40 #define TERRAINSCENEMANAGER_H
85 const String& getTypeName(
void)
const;
88 void setWorldGeometry(
const String& filename );
95 virtual void _renderVisibleObjects(
void );
98 float getHeightAt(
float x,
float y );
104 void setWorldTexture(
const String& textureName);
106 void setDetailTexture(
const String& textureName);
108 void setDetailTextureRepeat(
int repeat);
110 void setTileSize(
int size);
112 void setPageSize(
int size);
114 void setMaxPixelError(
int pixelError);
116 void setScale(
const Vector3& scale);
118 void setMaxGeoMipMapLevel(
int maxMip);
125 int getDetailTextureRepeat(
void);
127 int getTileSize(
void);
129 int getPageSize(
void);
131 int getMaxPixelError(
void);
135 int getMaxGeoMipMapLevel(
void);
143 void setUseTriStrips(
bool useStrips);
146 void setUseLODMorph(
bool useMorph);
148 void setUseVertexNormals(
bool useNormals);
150 void setUseVertexColours(
bool useColours);
177 void setCustomMaterial(
const String& materialName);
196 void setCustomMaterialMorphFactorParam(
const String& paramName);
215 void setCustomMaterialMorphFactorParam(
size_t paramIndex);
218 void setLODMorphStart(
Real morphStart);
243 createRayQuery(
const Ray& ray,
unsigned long mask = 0xFFFFFFFF);
273 virtual bool setOption(
const String &,
const void * );
278 virtual void setPrimaryCamera(
const Camera* cam);
309 virtual void selectPageSource(
const String& typeName,
326 void _renderScene(
Camera *cam,
Viewport *vp,
bool includeOverlays);
331 void clearScene(
void);
333 void setWorldGeometryRenderQueue(
uint8 qid);
353 for (
int i = 0; i < 16; i++ )
355 printf(
"Checking...%d\n", ( 1 << i ) + 1 );
357 if ( s == ( 1 << i ) + 1 )
401 void setupTerrainMaterial(
void);
403 void setupTerrainPages(
void);
405 void initLevelIndexes(
void);
407 void destroyLevelIndexes(
void);
Representation of a ray in space, i.e.
A viewpoint from which the scene will be rendered.
#define _OgreOctreePluginExport
float Real
Software floating point type.
String mDetailTextureName
The name of the detail texture.
A simple class for encapsulating parameters which are commonly needed by both TerrainSceneManager and...
String mCustomMaterialName
The name of the custom material to use.
void initMetaData(void) const
Internal method to initialise the metadata, must be implemented.
TerrainPageSource * mActivePageSource
The currently active page source.
Factory for TerrainSceneManager.
unsigned short mLivePageMargin
The number of pages to render outside the 'home' page.
PageSourceMap mPageSources
Map of source type -> TerrainPageSource.
SceneNode * mTerrainRoot
The node to which all terrain tiles are attached.
Manages the organisation and rendering of a 'scene' i.e.
bool mUseNamedParameterLodMorph
Are we using a named parameter to hook up LOD morph?
Octree implementation of RaySceneQuery.
const String & getDetailTexture(void)
Gets the texture to use for the detail texture.
~TerrainSceneManagerFactory()
ConstMapIterator< PageSourceMap > PageSourceIterator
Iterator over all page sources.
Default implementation of RaySceneQuery.
vector< TerrainPage * >::type TerrainPageRow
TerrainPage2D mTerrainPages
Grid of buffered pages.
LevelArray & _getLevelIndex(void)
Get the shared level index list (internal use only)
Class representing a node in the scene graph.
vector< TerrainPageSource * >::type TerrainPageSources
TerrainOptions mOptions
Terrain size, detail etc.
vector< TerrainPageRow >::type TerrainPage2D
TerrainBufferCache mIndexCache
Shared list of index buffers.
Specialized SceneManager that divides the geometry into an octree in order to facilitate spatial quer...
static const String FACTORY_TYPE_NAME
Factory type name.
Alternative listener class for dealing with RaySceneQuery.
unsigned short mBufferedPageMargin
The number of pages to keep loaded outside the 'home' page.
TerrainBufferCache & _getIndexCache(void)
Get the shared list of indexes cached (internal use only)
String mLodMorphParamName
The name of the parameter to send the LOD morph to.
This is a basic SceneManager for organizing TerrainRenderables into a total landscape.
bool _checkSize(int s)
Validates that the size picked for the terrain is acceptable.
A cache of TerrainIndexBuffers.
size_t _getPageCount(void)
Get the current page count (internal use only)
bool mPagingEnabled
Whether paging is enabled, or whether a single page will be used.
const TerrainOptions & getOptions(void)
Gets the terrain options.
void destroyInstance(SceneManager *instance)
Destroy an instance of a SceneManager.
TerrainPageSources mTerrainPageSources
const String & getWorldTexture(void)
Gets the texture to use for the main world texture.
Standard 3-dimensional vector.
Class representing an image file.
String mWorldTextureName
The name of the world texture.
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
An abstraction of a viewport, i.e.
TerrainSceneManagerFactory()
vector< TerrainPageSourceOption >::type TerrainPageSourceOptionList
size_t mLodMorphParamIndex
The index of the parameter to send the LOD morph to.
vector< IndexMap * >::type LevelArray
Concrete IteratorWrapper for const access to the underlying key-value container.
map< String, TerrainPageSource * >::type PageSourceMap
Internal map of page source name to page source.
SceneNode * getTerrainRootNode(void) const
Get the SceneNode under which all terrain nodes are attached.
SceneManager * createInstance(const String &instanceName)
Create a new instance of a SceneManager.
Groups a number of TerrainRenderables (tiles) into a page, which is the unit of loading / unloading...
LevelArray mLevelIndex
Shared array of IndexData (reuse indexes across tiles)
bool mUseCustomMaterial
Should we use an externally-defined custom material?
Specialisation of SharedPtr to allow SharedPtr to be assigned to MaterialPtr.
Abstract class which describes the interface which a source of terrain pages must implement...
Specialises the SceneQuery class for querying along a ray.
Class which will create instances of a given SceneManager.
Represents a terrain tile.