OGRE  2.2.4
Object-Oriented Graphics Rendering Engine
Ogre::TerrainGlobalOptions Class Reference

Options class which just stores default options for the terrain. More...

#include <OgreTerrain.h>

+ Inheritance diagram for Ogre::TerrainGlobalOptions:

Public Member Functions

 TerrainGlobalOptions ()
 
virtual ~TerrainGlobalOptions ()
 
void addQueryFlags (uint32 flags)
 As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object. More...
 
bool getCastsDynamicShadows () const
 Whether the terrain will be able to cast shadows (texture shadows only are supported, and you must be using depth shadow maps). More...
 
const ColourValuegetCompositeMapAmbient () const
 Get the composite map ambient light to use. More...
 
const ColourValuegetCompositeMapDiffuse () const
 Get the composite map iffuse light to use. More...
 
Real getCompositeMapDistance () const
 Get the distance at which to start using a composite map if present. More...
 
uint16 getCompositeMapSize () const
 Get the default size of the composite maps for a new terrain. More...
 
uint16 getDefaultGlobalColourMapSize () const
 Get the default size of the terrain global colour map for a new terrain. More...
 
Real getDefaultLayerTextureWorldSize () const
 Get the default world size for a layer 'splat' texture to cover. More...
 
TerrainMaterialGeneratorPtr getDefaultMaterialGenerator ()
 Get the default material generator. More...
 
const StringgetDefaultResourceGroup () const
 Get the default resource group to use to load / save terrains. More...
 
uint16 getLayerBlendMapSize () const
 Get the default size of the blend maps for a new terrain. More...
 
const Vector3getLightMapDirection () const
 Get the shadow map light direction to use (world space) More...
 
uint16 getLightMapSize () const
 Get the default size of the lightmaps for a new terrain. More...
 
Real getMaxPixelError () const
 Get the maximum screen pixel error that should be allowed when rendering. More...
 
uint32 getQueryFlags (void) const
 Get the default query flags for terrains. More...
 
uint8 getRenderQueueGroup (void) const
 Get the render queue group that this terrain will be rendered into. More...
 
Real getSkirtSize () const
 The default size of 'skirts' used to hide terrain cracks (default 10) More...
 
bool getUseRayBoxDistanceCalculation () const
 Returns whether or not to use an accurate calculation of camera distance from a terrain tile (ray / AABB intersection) or whether to use the simpler distance from the tile centre. More...
 
bool getUseVertexCompressionWhenAvailable () const
 Get whether to allow vertex compression to be used when the material generator states that it supports it. More...
 
uint32 getVisibilityFlags (void) const
 Get the visbility flags that terrains will be rendered with. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 
void removeQueryFlags (uint32 flags)
 
void setCastsDynamicShadows (bool s)
 Whether the terrain will be able to cast shadows (texture shadows only are supported, and you must be using depth shadow maps). More...
 
void setCompositeMapAmbient (const ColourValue &c)
 Set the composite map ambient light to use. More...
 
void setCompositeMapDiffuse (const ColourValue &c)
 Set the composite map diffuse light to use. More...
 
void setCompositeMapDistance (Real c)
 Set the distance at which to start using a composite map if present. More...
 
void setCompositeMapSize (uint16 sz)
 Sets the default size of composite maps for a new terrain. More...
 
void setDefaultGlobalColourMapSize (uint16 sz)
 Set the default size of the terrain global colour map for a new terrain. More...
 
void setDefaultLayerTextureWorldSize (Real sz)
 Set the default world size for a layer 'splat' texture to cover. More...
 
void setDefaultMaterialGenerator (TerrainMaterialGeneratorPtr gen)
 Set the default material generator. More...
 
void setDefaultResourceGroup (const String &grp)
 Set the default resource group to use to load / save terrains. More...
 
void setLayerBlendMapSize (uint16 sz)
 Sets the default size of blend maps for a new terrain. More...
 
void setLightMapDirection (const Vector3 &v)
 Set the shadow map light direction to use (world space). More...
 
void setLightMapSize (uint16 sz)
 Sets the default size of lightmaps for a new terrain. More...
 
void setMaxPixelError (Real pixerr)
 Set the maximum screen pixel error that should be allowed when rendering. More...
 
void setQueryFlags (uint32 flags)
 Set the default query flags for terrains. More...
 
void setRenderQueueGroup (uint8 grp)
 Set the render queue group that terrains will be rendered into. More...
 
void setSkirtSize (Real skirtSz)
 method - the default size of 'skirts' used to hide terrain cracks (default 10) More...
 
void setUseRayBoxDistanceCalculation (bool rb)
 Sets whether to use an accurate ray / box intersection to determine distance from a terrain tile, or whether to use the simple distance from the tile centre. More...
 
void setUseVertexCompressionWhenAvailable (bool enable)
 Set whether to allow vertex compression to be used when the material generator states that it supports it. More...
 
void setVisibilityFlags (uint32 flags)
 Set the visbility flags that terrains will be rendered with. More...
 

Static Public Member Functions

static TerrainGlobalOptionsgetSingleton (void)
 Override standard Singleton retrieval. More...
 
static TerrainGlobalOptionsgetSingletonPtr (void)
 Override standard Singleton retrieval. More...
 

Detailed Description

Options class which just stores default options for the terrain.

Remarks
None of these options are stored with the terrain when saved. They are options that you can use to modify the behaviour of the terrain when it is loaded or created.
Note
You should construct a single instance of this class per application and do so before you start working with any other terrain classes.

Constructor & Destructor Documentation

◆ TerrainGlobalOptions()

Ogre::TerrainGlobalOptions::TerrainGlobalOptions ( )

◆ ~TerrainGlobalOptions()

virtual Ogre::TerrainGlobalOptions::~TerrainGlobalOptions ( )
inlinevirtual

Member Function Documentation

◆ addQueryFlags()

void Ogre::TerrainGlobalOptions::addQueryFlags ( uint32  flags)
inline

As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.

◆ getCastsDynamicShadows()

bool Ogre::TerrainGlobalOptions::getCastsDynamicShadows ( ) const
inline

Whether the terrain will be able to cast shadows (texture shadows only are supported, and you must be using depth shadow maps).

◆ getCompositeMapAmbient()

const ColourValue& Ogre::TerrainGlobalOptions::getCompositeMapAmbient ( ) const
inline

Get the composite map ambient light to use.

◆ getCompositeMapDiffuse()

const ColourValue& Ogre::TerrainGlobalOptions::getCompositeMapDiffuse ( ) const
inline

Get the composite map iffuse light to use.

◆ getCompositeMapDistance()

Real Ogre::TerrainGlobalOptions::getCompositeMapDistance ( ) const
inline

Get the distance at which to start using a composite map if present.

◆ getCompositeMapSize()

uint16 Ogre::TerrainGlobalOptions::getCompositeMapSize ( ) const
inline

Get the default size of the composite maps for a new terrain.

◆ getDefaultGlobalColourMapSize()

uint16 Ogre::TerrainGlobalOptions::getDefaultGlobalColourMapSize ( ) const
inline

Get the default size of the terrain global colour map for a new terrain.

◆ getDefaultLayerTextureWorldSize()

Real Ogre::TerrainGlobalOptions::getDefaultLayerTextureWorldSize ( ) const
inline

Get the default world size for a layer 'splat' texture to cover.

◆ getDefaultMaterialGenerator()

TerrainMaterialGeneratorPtr Ogre::TerrainGlobalOptions::getDefaultMaterialGenerator ( )

Get the default material generator.

◆ getDefaultResourceGroup()

const String& Ogre::TerrainGlobalOptions::getDefaultResourceGroup ( ) const
inline

Get the default resource group to use to load / save terrains.

◆ getLayerBlendMapSize()

uint16 Ogre::TerrainGlobalOptions::getLayerBlendMapSize ( ) const
inline

Get the default size of the blend maps for a new terrain.

◆ getLightMapDirection()

const Vector3& Ogre::TerrainGlobalOptions::getLightMapDirection ( ) const
inline

Get the shadow map light direction to use (world space)

◆ getLightMapSize()

uint16 Ogre::TerrainGlobalOptions::getLightMapSize ( ) const
inline

Get the default size of the lightmaps for a new terrain.

◆ getMaxPixelError()

Real Ogre::TerrainGlobalOptions::getMaxPixelError ( ) const
inline

Get the maximum screen pixel error that should be allowed when rendering.

◆ getQueryFlags()

uint32 Ogre::TerrainGlobalOptions::getQueryFlags ( void  ) const
inline

Get the default query flags for terrains.

◆ getRenderQueueGroup()

uint8 Ogre::TerrainGlobalOptions::getRenderQueueGroup ( void  ) const
inline

Get the render queue group that this terrain will be rendered into.

◆ getSingleton()

static TerrainGlobalOptions& Ogre::TerrainGlobalOptions::getSingleton ( void  )
static

Override standard Singleton retrieval.

Remarks
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.
This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

◆ getSingletonPtr()

static TerrainGlobalOptions* Ogre::TerrainGlobalOptions::getSingletonPtr ( void  )
static

Override standard Singleton retrieval.

Remarks
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.
This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

◆ getSkirtSize()

Real Ogre::TerrainGlobalOptions::getSkirtSize ( ) const
inline

The default size of 'skirts' used to hide terrain cracks (default 10)

◆ getUseRayBoxDistanceCalculation()

bool Ogre::TerrainGlobalOptions::getUseRayBoxDistanceCalculation ( ) const
inline

Returns whether or not to use an accurate calculation of camera distance from a terrain tile (ray / AABB intersection) or whether to use the simpler distance from the tile centre.

◆ getUseVertexCompressionWhenAvailable()

bool Ogre::TerrainGlobalOptions::getUseVertexCompressionWhenAvailable ( ) const
inline

Get whether to allow vertex compression to be used when the material generator states that it supports it.

◆ getVisibilityFlags()

uint32 Ogre::TerrainGlobalOptions::getVisibilityFlags ( void  ) const
inline

Get the visbility flags that terrains will be rendered with.

◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator new() [1/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

◆ operator new() [2/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

◆ operator new() [3/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

◆ operator new[]() [1/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

◆ operator new[]() [2/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

◆ removeQueryFlags()

void Ogre::TerrainGlobalOptions::removeQueryFlags ( uint32  flags)
inline

◆ setCastsDynamicShadows()

void Ogre::TerrainGlobalOptions::setCastsDynamicShadows ( bool  s)
inline

Whether the terrain will be able to cast shadows (texture shadows only are supported, and you must be using depth shadow maps).

This value can be set dynamically, and affects all existing terrains. It defaults to false.

◆ setCompositeMapAmbient()

void Ogre::TerrainGlobalOptions::setCompositeMapAmbient ( const ColourValue c)
inline

Set the composite map ambient light to use.

◆ setCompositeMapDiffuse()

void Ogre::TerrainGlobalOptions::setCompositeMapDiffuse ( const ColourValue c)
inline

Set the composite map diffuse light to use.

◆ setCompositeMapDistance()

void Ogre::TerrainGlobalOptions::setCompositeMapDistance ( Real  c)
inline

Set the distance at which to start using a composite map if present.

◆ setCompositeMapSize()

void Ogre::TerrainGlobalOptions::setCompositeMapSize ( uint16  sz)
inline

Sets the default size of composite maps for a new terrain.

◆ setDefaultGlobalColourMapSize()

void Ogre::TerrainGlobalOptions::setDefaultGlobalColourMapSize ( uint16  sz)
inline

Set the default size of the terrain global colour map for a new terrain.

Once created, this information will be stored with the terrain.

◆ setDefaultLayerTextureWorldSize()

void Ogre::TerrainGlobalOptions::setDefaultLayerTextureWorldSize ( Real  sz)
inline

Set the default world size for a layer 'splat' texture to cover.

◆ setDefaultMaterialGenerator()

void Ogre::TerrainGlobalOptions::setDefaultMaterialGenerator ( TerrainMaterialGeneratorPtr  gen)

Set the default material generator.

◆ setDefaultResourceGroup()

void Ogre::TerrainGlobalOptions::setDefaultResourceGroup ( const String grp)
inline

Set the default resource group to use to load / save terrains.

◆ setLayerBlendMapSize()

void Ogre::TerrainGlobalOptions::setLayerBlendMapSize ( uint16  sz)
inline

Sets the default size of blend maps for a new terrain.

This is the resolution of each blending layer for a new terrain. Once created, this information will be stored with the terrain.

◆ setLightMapDirection()

void Ogre::TerrainGlobalOptions::setLightMapDirection ( const Vector3 v)
inline

Set the shadow map light direction to use (world space).

◆ setLightMapSize()

void Ogre::TerrainGlobalOptions::setLightMapSize ( uint16  sz)
inline

Sets the default size of lightmaps for a new terrain.

◆ setMaxPixelError()

void Ogre::TerrainGlobalOptions::setMaxPixelError ( Real  pixerr)
inline

Set the maximum screen pixel error that should be allowed when rendering.

Note
This value can be varied dynamically and affects all existing terrains. It will be weighted by the LOD bias on viewports.

◆ setQueryFlags()

void Ogre::TerrainGlobalOptions::setQueryFlags ( uint32  flags)
inline

Set the default query flags for terrains.

Remarks
This applies to newly created terrains, after which they will maintain their own settings

◆ setRenderQueueGroup()

void Ogre::TerrainGlobalOptions::setRenderQueueGroup ( uint8  grp)
inline

Set the render queue group that terrains will be rendered into.

Remarks
This applies to newly created terrains, after which they will maintain their own queue group settings

◆ setSkirtSize()

void Ogre::TerrainGlobalOptions::setSkirtSize ( Real  skirtSz)
inline

method - the default size of 'skirts' used to hide terrain cracks (default 10)

Remarks
Changing this value only applies to Terrain instances loaded / reloaded afterwards.

◆ setUseRayBoxDistanceCalculation()

void Ogre::TerrainGlobalOptions::setUseRayBoxDistanceCalculation ( bool  rb)
inline

Sets whether to use an accurate ray / box intersection to determine distance from a terrain tile, or whether to use the simple distance from the tile centre.

Using ray/box intersection will result in higher detail terrain because the LOD calculation is more conservative, assuming the 'worst case scenario' of a large height difference at the edge of a tile. This is guaranteed to give you at least the max pixel error or better, but will often give you more detail than you need. Not using the ray/box method is cheaper but will only use the max pixel error as a guide, the actual error will vary above and below that. The default is not to use the ray/box approach.

◆ setUseVertexCompressionWhenAvailable()

void Ogre::TerrainGlobalOptions::setUseVertexCompressionWhenAvailable ( bool  enable)
inline

Set whether to allow vertex compression to be used when the material generator states that it supports it.

Note
You should only call this before creating any terrain instances. The default is true, so if a material generator supports compressed vertices, and so does the hardware (this basically means shader support), they will be used). However you can disable this in an emergency if required.

◆ setVisibilityFlags()

void Ogre::TerrainGlobalOptions::setVisibilityFlags ( uint32  flags)
inline

Set the visbility flags that terrains will be rendered with.

Remarks
This applies to newly created terrains, after which they will maintain their own settings

The documentation for this class was generated from the following file: