# Ogre::TerrainGlobalOptions Class Reference
[Terrain]

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

`#include <OgreTerrain.h>`

Inheritance diagram for Ogre::TerrainGlobalOptions:
[legend]

List of all members.

## Public Member Functions

| TerrainGlobalOptions ()
virtual | ~TerrainGlobalOptions ()
Real | getSkirtSize ()
| The default size of 'skirts' used to hide terrain cracks (default 10).
void | setSkirtSize (Real skirtSz)
| method - the default size of 'skirts' used to hide terrain cracks (default 10)
const Vector3 & | getLightMapDirection ()
| Get the shadow map light direction to use (world space).
void | setLightMapDirection (const Vector3 &v)
| Set the shadow map light direction to use (world space).
const ColourValue & | getCompositeMapAmbient ()
| Get the composite map ambient light to use.
void | setCompositeMapAmbient (const ColourValue &c)
| Set the composite map ambient light to use.
const ColourValue & | getCompositeMapDiffuse ()
| Get the composite map iffuse light to use.
void | setCompositeMapDiffuse (const ColourValue &c)
| Set the composite map diffuse light to use.
Real | getCompositeMapDistance ()
| Get the distance at which to start using a composite map if present.
void | setCompositeMapDistance (Real c)
| Set the distance at which to start using a composite map if present.
bool | getCastsDynamicShadows ()
| Whether the terrain will be able to cast shadows (texture shadows only are supported, and you must be using depth shadow maps).
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).
Real | getMaxPixelError ()
| Get the maximum screen pixel error that should be allowed when rendering.
void | setMaxPixelError (Real pixerr)
| Set the maximum screen pixel error that should be allowed when rendering.
uint8 | getRenderQueueGroup (void)
| Get the render queue group that this terrain will be rendered into.
void | setRenderQueueGroup (uint8 grp)
| Set the render queue group that terrains will be rendered into.
uint32 | getVisibilityFlags (void)
| Get the visbility flags that terrains will be rendered with.
void | setVisibilityFlags (uint32 flags)
| Set the visbility flags that terrains will be rendered with.
void | setQueryFlags (uint32 flags)
| Set the default query flags for terrains.
uint32 | getQueryFlags (void)
| Get the default query flags for terrains.
void | addQueryFlags (uint32 flags)
| As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.
void | removeQueryFlags (uint32 flags)
bool | getUseRayBoxDistanceCalculation ()
| 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.
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.
TerrainMaterialGeneratorPtr | getDefaultMaterialGenerator ()
| Get the default material generator.
void | setDefaultMaterialGenerator (TerrainMaterialGeneratorPtr gen)
| Set the default material generator.
uint16 | getLayerBlendMapSize ()
| Get the default size of the blend maps for a new terrain.
void | setLayerBlendMapSize (uint16 sz)
| Sets the default size of blend maps for a new terrain.
Real | getDefaultLayerTextureWorldSize ()
| Get the default world size for a layer 'splat' texture to cover.
void | setDefaultLayerTextureWorldSize (Real sz)
| Set the default world size for a layer 'splat' texture to cover.
uint16 | getDefaultGlobalColourMapSize ()
| Get the default size of the terrain global colour map for a new terrain.
void | setDefaultGlobalColourMapSize (uint16 sz)
| Set the default size of the terrain global colour map for a new terrain.
uint16 | getLightMapSize ()
| Get the default size of the lightmaps for a new terrain.
void | setLightMapSize (uint16 sz)
| Sets the default size of lightmaps for a new terrain.
uint16 | getCompositeMapSize ()
| Get the default size of the composite maps for a new terrain.
void | setCompositeMapSize (uint16 sz)
| Sets the default size of composite maps for a new terrain.
void | setDefaultResourceGroup (const String &grp)
| Set the default resource group to use to load / save terrains.
const String & | getDefaultResourceGroup ()
| Get the default resource group to use to load / save terrains.
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info
void * | operator new[] (size_t sz)
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 *)

## Static Public Member Functions

static TerrainGlobalOptions & | getSingleton (void)
| Override standard Singleton retrieval.
static TerrainGlobalOptions * | getSingletonPtr (void)
| Override standard Singleton retrieval.

## Protected Attributes

Real | mSkirtSize
Vector3 | mLightMapDir
bool | mCastsShadows
Real | mMaxPixelError
uint8 | mRenderQueueGroup
uint32 | mVisibilityFlags
uint32 | mQueryFlags
bool | mUseRayBoxDistanceCalculation
TerrainMaterialGeneratorPtr | mDefaultMaterialGenerator
uint16 | mLayerBlendMapSize
Real | mDefaultLayerTextureWorldSize
uint16 | mDefaultGlobalColourMapSize
uint16 | mLightmapSize
uint16 | mCompositeMapSize
ColourValue | mCompositeMapAmbient
ColourValue | mCompositeMapDiffuse
Real | mCompositeMapDistance
String | mResourceGroup

## Static Protected Attributes

static TerrainGlobalOptions * | ms_Singleton

## 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.

Definition at line 1810 of file OgreTerrain.h.

## Constructor & Destructor Documentation

Ogre::TerrainGlobalOptions::TerrainGlobalOptions | ( |  | ) |

virtual Ogre::TerrainGlobalOptions::~TerrainGlobalOptions | ( |  | ) | `[virtual]`

Definition at line 1835 of file OgreTerrain.h.

## Member Function Documentation

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

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

Definition at line 1914 of file OgreTerrain.h.

bool Ogre::TerrainGlobalOptions::getCastsDynamicShadows | ( |  | ) |

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

Definition at line 1869 of file OgreTerrain.h.

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

Get the composite map ambient light to use.

Definition at line 1853 of file OgreTerrain.h.

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

Get the composite map iffuse light to use.

Definition at line 1857 of file OgreTerrain.h.

Real Ogre::TerrainGlobalOptions::getCompositeMapDistance | ( |  | ) |

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

Definition at line 1861 of file OgreTerrain.h.

uint16 Ogre::TerrainGlobalOptions::getCompositeMapSize | ( |  | ) |

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

Definition at line 1984 of file OgreTerrain.h.

uint16 Ogre::TerrainGlobalOptions::getDefaultGlobalColourMapSize | ( |  | ) |

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

Definition at line 1966 of file OgreTerrain.h.

Real Ogre::TerrainGlobalOptions::getDefaultLayerTextureWorldSize | ( |  | ) |

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

Definition at line 1958 of file OgreTerrain.h.

TerrainMaterialGeneratorPtr Ogre::TerrainGlobalOptions::getDefaultMaterialGenerator | ( |  | ) |

Get the default material generator.

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

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

Definition at line 1996 of file OgreTerrain.h.

uint16 Ogre::TerrainGlobalOptions::getLayerBlendMapSize | ( |  | ) |

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

Definition at line 1948 of file OgreTerrain.h.

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

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

Definition at line 1849 of file OgreTerrain.h.

uint16 Ogre::TerrainGlobalOptions::getLightMapSize | ( |  | ) |

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

Definition at line 1976 of file OgreTerrain.h.

Real Ogre::TerrainGlobalOptions::getMaxPixelError | ( |  | ) |

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

Definition at line 1879 of file OgreTerrain.h.

uint32 Ogre::TerrainGlobalOptions::getQueryFlags | ( | void |  | ) |

Get the default query flags for terrains.

Definition at line 1911 of file OgreTerrain.h.

uint8 Ogre::TerrainGlobalOptions::getRenderQueueGroup | ( | void |  | ) |

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

Definition at line 1889 of file OgreTerrain.h.

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.

Reimplemented from Ogre::Singleton< TerrainGlobalOptions >.

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.

Reimplemented from Ogre::Singleton< TerrainGlobalOptions >.

Real Ogre::TerrainGlobalOptions::getSkirtSize | ( |  | ) |

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

Definition at line 1841 of file OgreTerrain.h.

bool Ogre::TerrainGlobalOptions::getUseRayBoxDistanceCalculation | ( |  | ) |

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.

Definition at line 1923 of file OgreTerrain.h.

uint32 Ogre::TerrainGlobalOptions::getVisibilityFlags | ( | void |  | ) |

Get the visbility flags that terrains will be rendered with.

Definition at line 1897 of file OgreTerrain.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |  |
| ) |  |  | `[inherited]`

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | `[inherited]`

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | `[inherited]`

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | `[inherited]`

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr |
| ) |  |  | `[inherited]`

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | `[inherited]`

Definition at line 90 of file OgreMemoryAllocatedObject.h.

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

Definition at line 1917 of file OgreTerrain.h.

void Ogre::TerrainGlobalOptions::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).

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

Definition at line 1876 of file OgreTerrain.h.

void Ogre::TerrainGlobalOptions::setCompositeMapAmbient | ( | const ColourValue & | c | ) |

Set the composite map ambient light to use.

Definition at line 1855 of file OgreTerrain.h.

void Ogre::TerrainGlobalOptions::setCompositeMapDiffuse | ( | const ColourValue & | c | ) |

Set the composite map diffuse light to use.

Definition at line 1859 of file OgreTerrain.h.

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

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

Definition at line 1863 of file OgreTerrain.h.

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

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

Definition at line 1988 of file OgreTerrain.h.

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

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

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

Definition at line 1971 of file OgreTerrain.h.

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

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

Definition at line 1962 of file OgreTerrain.h.

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

Set the default material generator.

void Ogre::TerrainGlobalOptions::setDefaultResourceGroup | ( | const String & | grp | ) |

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

Definition at line 1992 of file OgreTerrain.h.

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

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.

Definition at line 1954 of file OgreTerrain.h.

void Ogre::TerrainGlobalOptions::setLightMapDirection | ( | const Vector3 & | v | ) |

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

Definition at line 1851 of file OgreTerrain.h.

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

Sets the default size of lightmaps for a new terrain.

Definition at line 1980 of file OgreTerrain.h.

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

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.

Definition at line 1886 of file OgreTerrain.h.

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

Set the default query flags for terrains.

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

Definition at line 1908 of file OgreTerrain.h.

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

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

Definition at line 1894 of file OgreTerrain.h.

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

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.

Definition at line 1847 of file OgreTerrain.h.

void Ogre::TerrainGlobalOptions::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.

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.

Definition at line 1936 of file OgreTerrain.h.

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

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

Definition at line 1902 of file OgreTerrain.h.

## Member Data Documentation

bool Ogre::TerrainGlobalOptions::mCastsShadows `[protected]`

Definition at line 1816 of file OgreTerrain.h.

ColourValue Ogre::TerrainGlobalOptions::mCompositeMapAmbient `[protected]`

Definition at line 1828 of file OgreTerrain.h.

ColourValue Ogre::TerrainGlobalOptions::mCompositeMapDiffuse `[protected]`

Definition at line 1829 of file OgreTerrain.h.

Real Ogre::TerrainGlobalOptions::mCompositeMapDistance `[protected]`

Definition at line 1830 of file OgreTerrain.h.

uint16 Ogre::TerrainGlobalOptions::mCompositeMapSize `[protected]`

Definition at line 1827 of file OgreTerrain.h.

uint16 Ogre::TerrainGlobalOptions::mDefaultGlobalColourMapSize `[protected]`

Definition at line 1825 of file OgreTerrain.h.

Real Ogre::TerrainGlobalOptions::mDefaultLayerTextureWorldSize `[protected]`

Definition at line 1824 of file OgreTerrain.h.

TerrainMaterialGeneratorPtr Ogre::TerrainGlobalOptions::mDefaultMaterialGenerator `[protected]`

Definition at line 1822 of file OgreTerrain.h.

uint16 Ogre::TerrainGlobalOptions::mLayerBlendMapSize `[protected]`

Definition at line 1823 of file OgreTerrain.h.

Vector3 Ogre::TerrainGlobalOptions::mLightMapDir `[protected]`

Definition at line 1815 of file OgreTerrain.h.

uint16 Ogre::TerrainGlobalOptions::mLightmapSize `[protected]`

Definition at line 1826 of file OgreTerrain.h.

Real Ogre::TerrainGlobalOptions::mMaxPixelError `[protected]`

Definition at line 1817 of file OgreTerrain.h.

uint32 Ogre::TerrainGlobalOptions::mQueryFlags `[protected]`

Definition at line 1820 of file OgreTerrain.h.

uint8 Ogre::TerrainGlobalOptions::mRenderQueueGroup `[protected]`

Definition at line 1818 of file OgreTerrain.h.

String Ogre::TerrainGlobalOptions::mResourceGroup `[protected]`

Definition at line 1831 of file OgreTerrain.h.

TerrainGlobalOptions * Ogre::Singleton< TerrainGlobalOptions >::ms_Singleton `[static, protected, inherited]`

Definition at line 75 of file OgreSingleton.h.

Real Ogre::TerrainGlobalOptions::mSkirtSize `[protected]`

Definition at line 1814 of file OgreTerrain.h.

bool Ogre::TerrainGlobalOptions::mUseRayBoxDistanceCalculation `[protected]`

Definition at line 1821 of file OgreTerrain.h.

uint32 Ogre::TerrainGlobalOptions::mVisibilityFlags `[protected]`

Definition at line 1819 of file OgreTerrain.h.

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

- OgreTerrain.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Wed Nov 3 2010 19:25:04