The main containing class for a chunk of terrain. More...
#include <OgreTerrain.h>
Classes | |
class | DefaultGpuBufferAllocator |
Standard implementation of a buffer allocator which re-uses buffers. More... | |
struct | DerivedDataRequest |
A data holder for communicating with the background derived data update. More... | |
struct | DerivedDataResponse |
A data holder for communicating with the background derived data update. More... | |
class | GpuBufferAllocator |
Interface used to by the Terrain instance to allocate GPU buffers. More... | |
struct | ImportData |
Structure encapsulating import data that you may use to bootstrap the terrain without loading from a native data stream. More... | |
struct | LayerInstance |
An instance of a layer, with specific texture names. More... | |
Public Types | |
enum | Alignment { ALIGN_X_Z = 0, ALIGN_X_Y = 1, ALIGN_Y_Z = 2 } |
The alignment of the terrain. More... | |
enum | NeighbourIndex { NEIGHBOUR_EAST = 0, NEIGHBOUR_NORTHEAST = 1, NEIGHBOUR_NORTH = 2, NEIGHBOUR_NORTHWEST = 3, NEIGHBOUR_WEST = 4, NEIGHBOUR_SOUTHWEST = 5, NEIGHBOUR_SOUTH = 6, NEIGHBOUR_SOUTHEAST = 7, NEIGHBOUR_COUNT = 8 } |
Neighbour index enumeration - indexed anticlockwise from East like angles. More... | |
enum | Space { WORLD_SPACE = 0, LOCAL_SPACE = 1, TERRAIN_SPACE = 2, POINT_SPACE = 3 } |
Enumeration of relative spaces that you might want to use to address the terrain. More... | |
typedef vector< Real >::type | RealVector |
typedef vector< LayerInstance > ::type | LayerInstanceList |
Public Member Functions | |
Terrain (SceneManager *sm) | |
Constructor. | |
virtual | ~Terrain () |
SceneManager * | getSceneManager () const |
void | setGpuBufferAllocator (GpuBufferAllocator *alloc) |
Tell this instance to use the given GpuBufferAllocator. | |
GpuBufferAllocator * | getGpuBufferAllocator () |
Get the current buffer allocator. | |
void | convertPosition (Space inSpace, const Vector3 &inPos, Space outSpace, Vector3 &outPos) const |
Convert a position from one space to another with respect to this terrain. | |
Vector3 | convertPosition (Space inSpace, const Vector3 &inPos, Space outSpace) const |
Convert a position from one space to another with respect to this terrain. | |
void | convertDirection (Space inSpace, const Vector3 &inDir, Space outSpace, Vector3 &outDir) const |
Convert a direction from one space to another with respect to this terrain. | |
Vector3 | convertDirection (Space inSpace, const Vector3 &inDir, Space outSpace) const |
Convert a direction from one space to another with respect to this terrain. | |
void | setResourceGroup (const String &resGroup) |
Set the resource group to use when loading / saving. | |
const String & | getResourceGroup () const |
Get the resource group to use when loading / saving. | |
const String & | _getDerivedResourceGroup () const |
Get the final resource group to use when loading / saving. | |
void | save (const String &filename) |
Save terrain data in native form to a standalone file. | |
void | save (StreamSerialiser &stream) |
Save terrain data in native form to a serializing stream. | |
bool | prepare (const String &filename) |
Prepare the terrain from a standalone file. | |
bool | prepare (StreamSerialiser &stream) |
Prepare terrain data from saved data. | |
bool | prepare (const ImportData &importData) |
Prepare the terrain from some import data rather than loading from native data. | |
void | load (const String &filename) |
Prepare and load the terrain in one simple call from a standalone file. | |
void | load (StreamSerialiser &stream) |
Prepare and load the terrain in one simple call from a stream. | |
void | load () |
Load the terrain based on the data already populated via prepare methods. | |
bool | isLoaded () const |
Return whether the terrain is loaded. | |
bool | isModified () const |
Returns whether this terrain has been modified since it was first loaded / defined. | |
bool | isHeightDataModified () const |
Returns whether terrain heights have been modified since the terrain was first loaded / defined. | |
void | unload () |
Unload the terrain and free GPU resources. | |
void | unprepare () |
Free CPU resources created during prepare methods. | |
float * | getHeightData () const |
Get a pointer to all the height data for this terrain. | |
float * | getHeightData (long x, long y) const |
Get a pointer to the height data for a given point. | |
float | getHeightAtPoint (long x, long y) const |
Get the height data for a given terrain point. | |
void | setHeightAtPoint (long x, long y, float h) |
Set the height data for a given terrain point. | |
float | getHeightAtTerrainPosition (Real x, Real y) |
Get the height data for a given terrain position. | |
float | getHeightAtWorldPosition (Real x, Real y, Real z) |
Get the height data for a given world position (projecting the point down on to the terrain). | |
float | getHeightAtWorldPosition (const Vector3 &pos) |
Get the height data for a given world position (projecting the point down on to the terrain). | |
const float * | getDeltaData () |
Get a pointer to all the delta data for this terrain. | |
const float * | getDeltaData (long x, long y) |
Get a pointer to the delta data for a given point. | |
void | getPoint (long x, long y, Vector3 *outpos) |
Get a Vector3 of the world-space point on the terrain, aligned as per options. | |
void | getPointFromSelfOrNeighbour (long x, long y, Vector3 *outpos) |
Get a Vector3 of the world-space point on the terrain, aligned as per options. | |
void | getPoint (long x, long y, float height, Vector3 *outpos) |
Get a Vector3 of the world-space point on the terrain, supplying the height data manually (can be more optimal). | |
void | getPointTransform (Matrix4 *outXform) const |
Get a transform which converts Vector4(xindex, yindex, height, 1) into an object-space position including scalings and alignment. | |
void | getTerrainVector (const Vector3 &inVec, Vector3 *outVec) |
Translate a vector from world space to local terrain space based on the alignment options. | |
void | getTerrainVectorAlign (const Vector3 &inVec, Alignment align, Vector3 *outVec) |
Translate a vector from world space to local terrain space based on a specified alignment. | |
void | getTerrainVector (Real x, Real y, Real z, Vector3 *outVec) |
Translate a vector from world space to local terrain space based on the alignment options. | |
void | getTerrainVectorAlign (Real x, Real y, Real z, Alignment align, Vector3 *outVec) |
Translate a vector from world space to local terrain space based on a specified alignment. | |
void | getVector (const Vector3 &inVec, Vector3 *outVec) |
Translate a vector into world space based on the alignment options. | |
void | getVectorAlign (const Vector3 &inVec, Alignment align, Vector3 *outVec) |
Translate a vector into world space based on a specified alignment. | |
void | getVector (Real x, Real y, Real z, Vector3 *outVec) |
Translate a vector into world space based on the alignment options. | |
void | getVectorAlign (Real x, Real y, Real z, Alignment align, Vector3 *outVec) |
Translate a vector into world space based on a specified alignment. | |
void | getPosition (const Vector3 &TSpos, Vector3 *outWSpos) |
Convert a position from terrain basis space to world space. | |
void | getPosition (Real x, Real y, Real z, Vector3 *outWSpos) |
Convert a position from terrain basis space to world space. | |
void | getTerrainPosition (const Vector3 &WSpos, Vector3 *outTSpos) |
Convert a position from world space to terrain basis space. | |
void | getTerrainPosition (Real x, Real y, Real z, Vector3 *outTSpos) |
Convert a position from world space to terrain basis space. | |
void | getPositionAlign (const Vector3 &TSpos, Alignment align, Vector3 *outWSpos) |
Convert a position from terrain basis space to world space based on a specified alignment. | |
void | getPositionAlign (Real x, Real y, Real z, Alignment align, Vector3 *outWSpos) |
Convert a position from terrain basis space to world space based on a specified alignment. | |
void | getTerrainPositionAlign (const Vector3 &WSpos, Alignment align, Vector3 *outTSpos) |
Convert a position from world space to terrain basis space based on a specified alignment. | |
void | getTerrainPositionAlign (Real x, Real y, Real z, Alignment align, Vector3 *outTSpos) |
Convert a position from world space to terrain basis space based on a specified alignment. | |
Alignment | getAlignment () const |
Get the alignment of the terrain. | |
uint16 | getSize () const |
Get the size of the terrain in vertices along one side. | |
void | setSize (uint16 newSize) |
Set the size of terrain in vertices along one side. | |
uint16 | getMaxBatchSize () const |
Get the maximum size in vertices along one side of a batch. | |
uint16 | getMinBatchSize () const |
Get the minimum size in vertices along one side of a batch. | |
Real | getWorldSize () const |
Get the size of the terrain in world units. | |
void | setWorldSize (Real newWorldSize) |
Set the world size of terrain. | |
uint8 | getLayerCount () const |
Get the number of layers in this terrain. | |
const TerrainLayerDeclaration & | getLayerDeclaration () const |
Get the declaration which describes the layers in this terrain. | |
void | addLayer (Real worldSize=0, const StringVector *textureNames=0) |
Add a new layer to this terrain. | |
void | addLayer (uint8 index, Real worldSize=0, const StringVector *textureNames=0) |
Add a new layer to this terrain at a specific index. | |
void | removeLayer (uint8 index) |
Remove a layer from the terrain. | |
void | replaceLayer (uint8 index, bool keepBlends, Real worldSize=0, const StringVector *textureNames=0) |
Replace an existing terrain layer, optionally preserving all other layer blend maps. | |
uint8 | getMaxLayers () const |
Get the maximum number of layers supported with the current options. | |
Real | getLayerWorldSize (uint8 index) const |
How large an area in world space the texture in a terrain layer covers before repeating. | |
void | setLayerWorldSize (uint8 index, Real size) |
How large an area in world space the texture in a terrain layer covers before repeating. | |
Real | getLayerUVMultiplier (uint8 index) const |
Get the layer UV multiplier. | |
const String & | getLayerTextureName (uint8 layerIndex, uint8 samplerIndex) const |
Get the name of the texture bound to a given index within a given layer. | |
void | setLayerTextureName (uint8 layerIndex, uint8 samplerIndex, const String &textureName) |
Set the name of the texture bound to a given index within a given layer. | |
uint16 | getLayerBlendMapSize () const |
Get the requested size of the blend maps used to blend between layers for this terrain. | |
uint16 | getLightmapSize () const |
Get the requested size of lightmap for this terrain. | |
const TexturePtr & | getLightmap () const |
Get access to the lightmap, if enabled (as requested by the material generator). | |
uint16 | getCompositeMapSize () const |
Get the requested size of composite map for this terrain. | |
const TexturePtr & | getCompositeMap () const |
Get access to the composite map, if enabled (as requested by the material generator). | |
const Vector3 & | getPosition () const |
Get the world position of the terrain centre. | |
void | setPosition (const Vector3 &pos) |
Set the position of the terrain centre in world coordinates. | |
SceneNode * | _getRootSceneNode () const |
Get the root scene node for the terrain (internal use only). | |
void | dirty () |
Mark the entire terrain as dirty. | |
void | dirtyRect (const Rect &rect) |
Mark a region of the terrain as dirty. | |
void | _dirtyCompositeMapRect (const Rect &rect) |
Mark a region of the terrain composite map as dirty. | |
void | dirtyLightmapRect (const Rect &rect) |
Mark a region of the lightmap as dirty. | |
void | dirtyLightmap () |
Mark a the entire lightmap as dirty. | |
void | update (bool synchronous=false) |
Trigger the update process for the terrain. | |
void | updateGeometry () |
Performs an update on the terrain geometry based on the dirty region. | |
void | updateDerivedData (bool synchronous=false, uint8 typeMask=0xFF) |
Updates derived data for the terrain (LOD, lighting) to reflect changed height data, in a separate thread if threading is enabled (OGRE_THREAD_SUPPORT). | |
void | updateCompositeMap () |
Performs an update on the terrain composite map based on its dirty region. | |
void | updateCompositeMapWithDelay (Real delay=2) |
Performs an update on the terrain composite map based on its dirty region, but only at a maximum frequency. | |
Real | getSkirtSize () const |
The default size of 'skirts' used to hide terrain cracks (default 10, set for new Terrain using TerrainGlobalOptions). | |
uint16 | getNumLodLevels () const |
Get the total number of LOD levels in the terrain. | |
uint16 | getNumLodLevelsPerLeaf () const |
Get the number of LOD levels in a leaf of the terrain quadtree. | |
Rect | calculateHeightDeltas (const Rect &rect) |
Calculate (or recalculate) the delta values of heights between a vertex in its recorded position, and the place it will end up in the LOD in which it is removed. | |
void | finaliseHeightDeltas (const Rect &rect, bool cpuData) |
Finalise the height deltas. | |
PixelBox * | calculateNormals (const Rect &rect, Rect &outFinalRect) |
Calculate (or recalculate) the normals on the terrain. | |
void | finaliseNormals (const Rect &rect, PixelBox *normalsBox) |
Finalise the normals. | |
PixelBox * | calculateLightmap (const Rect &rect, const Rect &extraTargetRect, Rect &outFinalRect) |
Calculate (or recalculate) the terrain lightmap. | |
void | finaliseLightmap (const Rect &rect, PixelBox *lightmapBox) |
Finalise the lightmap. | |
uint16 | getResolutionAtLod (uint16 lodLevel) |
Gets the resolution of the entire terrain (down one edge) at a given LOD level. | |
std::pair< bool, Vector3 > | rayIntersects (const Ray &ray, bool cascadeToNeighbours=false, Real distanceLimit=0) |
Test for intersection of a given ray with the terrain. | |
const AxisAlignedBox & | getAABB () const |
Get the AABB (local coords) of the entire terrain. | |
AxisAlignedBox | getWorldAABB () const |
Get the AABB (world coords) of the entire terrain. | |
Real | getMinHeight () const |
Get the minimum height of the terrain. | |
Real | getMaxHeight () const |
Get the maximum height of the terrain. | |
Real | getBoundingRadius () const |
Get the bounding radius of the entire terrain. | |
const MaterialPtr & | getMaterial () const |
Get the material being used for the terrain. | |
const MaterialPtr & | _getMaterial () const |
Internal getting of material. | |
const MaterialPtr & | getCompositeMapMaterial () const |
Get the material being used for the terrain composite map. | |
const MaterialPtr & | _getCompositeMapMaterial () const |
Internal getting of material for the terrain composite map. | |
const String & | getMaterialName () const |
Get the name of the material being used for the terrain. | |
void | preFindVisibleObjects (SceneManager *source, SceneManager::IlluminationRenderStage irs, Viewport *v) |
Overridden from SceneManager::Listener. | |
void | sceneManagerDestroyed (SceneManager *source) |
Overridden from SceneManager::Listener. | |
uint8 | getRenderQueueGroup (void) const |
Get the render queue group that this terrain will be rendered into. | |
void | setRenderQueueGroup (uint8 grp) |
Set the render queue group that this terrain will be rendered into. | |
uint32 | getVisibilityFlags (void) const |
Get the visibility flags for this terrain. | |
void | setVisibilityFlags (uint32 flags) |
Set the visibility flags for this terrain. | |
uint32 | getQueryFlags (void) const |
Get the query flags for this terrain. | |
void | setQueryFlags (uint32 flags) |
Set the query flags for this terrain. | |
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) |
TerrainLayerBlendMap * | getLayerBlendMap (uint8 layerIndex) |
Retrieve the layer blending map for a given layer, which may be used to edit the blending information for that layer. | |
uint8 | getBlendTextureIndex (uint8 layerIndex) const |
Get the index of the blend texture that a given layer uses. | |
uint8 | getBlendTextureCount () const |
Get the number of blend textures in use. | |
uint8 | getBlendTextureCount (uint8 numLayers) const |
Get the number of blend textures needed for a given number of layers. | |
const String & | getBlendTextureName (uint8 textureIndex) const |
Get the name of the packed blend texture at a specific index. | |
void | setGlobalColourMapEnabled (bool enabled, uint16 size=0) |
Set whether a global colour map is enabled. | |
bool | getGlobalColourMapEnabled () const |
Get whether a global colour map is enabled on this terrain. | |
uint16 | getGlobalColourMapSize () const |
Get the size of the global colour map (if used). | |
const TexturePtr & | getGlobalColourMap () const |
Get access to the global colour map, if enabled. | |
void | widenRectByVector (const Vector3 &vec, const Rect &inRect, Rect &outRect) |
Widen a rectangular area of terrain to take into account an extrusion vector. | |
void | widenRectByVector (const Vector3 &vec, const Rect &inRect, Real minHeight, Real maxHeight, Rect &outRect) |
Widen a rectangular area of terrain to take into account an extrusion vector, but specify the min / max heights to extrude manually. | |
void | freeTemporaryResources () |
Free as many resources as possible for optimal run-time memory use. | |
const TexturePtr & | getLayerBlendTexture (uint8 index) |
Get a blend texture with a given index. | |
std::pair< uint8, uint8 > | getLayerBlendTextureIndex (uint8 layerIndex) |
Get the texture index and colour channel of the blend information for a given layer. | |
void | _setMorphRequired (bool morph) |
Request internal implementation options for the terrain material to use, in this case vertex morphing information. | |
bool | _getMorphRequired () const |
Get whether LOD morphing is needed. | |
void | _setNormalMapRequired (bool normalMap) |
Request internal implementation options for the terrain material to use, in this case a terrain-wide normal map. | |
void | _setLightMapRequired (bool lightMap, bool shadowsOnly=false) |
Request internal implementation options for the terrain material to use, in this case a terrain-wide normal map. | |
void | _setCompositeMapRequired (bool compositeMap) |
Request internal implementation options for the terrain material to use, in this case a terrain-wide composite map. | |
bool | _getUseVertexCompression () const |
Whether we're using vertex compression or not. | |
bool | canHandleRequest (const WorkQueue::Request *req, const WorkQueue *srcQ) |
WorkQueue::RequestHandler override. | |
WorkQueue::Response * | handleRequest (const WorkQueue::Request *req, const WorkQueue *srcQ) |
WorkQueue::RequestHandler override. | |
bool | canHandleResponse (const WorkQueue::Response *res, const WorkQueue *srcQ) |
WorkQueue::ResponseHandler override. | |
void | handleResponse (const WorkQueue::Response *res, const WorkQueue *srcQ) |
WorkQueue::ResponseHandler override. | |
uint16 | getLODLevelWhenVertexEliminated (long x, long y) |
Utility method, get the first LOD Level at which this vertex is no longer included. | |
uint16 | getLODLevelWhenVertexEliminated (long rowOrColulmn) |
Utility method, get the first LOD Level at which this vertex is no longer included. | |
TerrainQuadTreeNode * | getQuadTree () |
Get the top level of the quad tree which is used to divide up the terrain. | |
TexturePtr | getTerrainNormalMap () const |
Get the (global) normal map texture. | |
Terrain * | getNeighbour (NeighbourIndex index) |
Retrieve the terrain's neighbour, or null if not present. | |
void | setNeighbour (NeighbourIndex index, Terrain *neighbour, bool recalculate=false, bool notifyOther=true) |
Set a terrain's neighbour, or null to detach one. | |
void | notifyNeighbours () |
Tell this instance to notify all neighbours that will be affected by a height change that has taken place. | |
void | neighbourModified (NeighbourIndex index, const Rect &edgerect, const Rect &shadowrect) |
Notify that a neighbour has just finished updating and that this change affects this tile. | |
Terrain * | raySelectNeighbour (const Ray &ray, Real distanceLimit=0) |
Utility method to pick a neighbour based on a ray. | |
void | _dumpTextures (const String &prefix, const String &suffix) |
Dump textures to files. | |
bool | isDerivedDataUpdateInProgress () const |
Query whether a derived data update is in progress or not. | |
virtual void | preUpdateSceneGraph (SceneManager *source, Camera *camera) |
Called prior to updating the scene graph in this SceneManager. | |
virtual void | postUpdateSceneGraph (SceneManager *source, Camera *camera) |
Called after updating the scene graph in this SceneManager. | |
virtual void | postFindVisibleObjects (SceneManager *source, IlluminationRenderStage irs, Viewport *v) |
Called after searching for visible objects in this SceneManager. | |
virtual void | shadowTexturesUpdated (size_t numberOfShadowTextures) |
Event raised after all shadow textures have been rendered into for all queues / targets but before any other geometry has been rendered (including main scene geometry and any additional shadow receiver passes). | |
virtual void | shadowTextureCasterPreViewProj (Light *light, Camera *camera, size_t iteration) |
This event occurs just before the view & projection matrices are set for rendering into a shadow texture. | |
virtual void | shadowTextureReceiverPreViewProj (Light *light, Frustum *frustum) |
This event occurs just before the view & projection matrices are set for re-rendering a shadow receiver. | |
virtual bool | sortLightsAffectingFrustum (LightList &lightList) |
Hook to allow the listener to override the ordering of lights for the entire frustum. | |
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 size_t | _getNumIndexesForBatchSize (uint16 batchSize) |
Utility method to get the number of indexes required to render a given batch. | |
static void | _populateIndexBuffer (uint16 *pIndexes, uint16 batchSize, uint16 vdatasize, size_t vertexIncrement, uint16 xoffset, uint16 yoffset, uint16 numSkirtRowsCols, uint16 skirtRowColSkip) |
Utility method to populate a (locked) index buffer. | |
static uint16 | _calcSkirtVertexIndex (uint16 mainIndex, uint16 vdatasize, bool isCol, uint16 numSkirtRowsCols, uint16 skirtRowColSkip) |
Utility method to calculate the skirt index for a given original vertex index. | |
static NeighbourIndex | getOppositeNeighbour (NeighbourIndex index) |
Get the opposite neighbour relationship (useful for finding the neighbour index from the perspective of the tile the other side of the boundary). | |
static NeighbourIndex | getNeighbourIndex (long offsetx, long offsety) |
Get the neighbour enum for a given offset in a grid (signed). | |
static void | convertWorldToTerrainAxes (Alignment align, const Vector3 &worldVec, Vector3 *terrainVec) |
Utility method to convert axes from world space to terrain space (xy terrain, z up). | |
static void | convertTerrainToWorldAxes (Alignment align, const Vector3 &terrainVec, Vector3 *worldVec) |
Utility method to convert axes from terrain space (xy terrain, z up) tp world space. | |
static void | writeLayerDeclaration (const TerrainLayerDeclaration &decl, StreamSerialiser &ser) |
Utility method to write a layer declaration to a stream. | |
static bool | readLayerDeclaration (StreamSerialiser &ser, TerrainLayerDeclaration &targetdecl) |
Utility method to read a layer declaration from a stream. | |
static void | writeLayerInstanceList (const Terrain::LayerInstanceList &lst, StreamSerialiser &ser) |
Utility method to write a layer instance list to a stream. | |
static bool | readLayerInstanceList (StreamSerialiser &ser, size_t numSamplers, Terrain::LayerInstanceList &targetlst) |
Utility method to read a layer instance list from a stream. | |
Static Public Attributes | |
static const uint32 | TERRAIN_CHUNK_ID |
static const uint16 | TERRAIN_CHUNK_VERSION |
static const uint16 | TERRAIN_MAX_BATCH_SIZE |
static const uint32 | TERRAINLAYERDECLARATION_CHUNK_ID |
static const uint16 | TERRAINLAYERDECLARATION_CHUNK_VERSION |
static const uint32 | TERRAINLAYERSAMPLER_CHUNK_ID |
static const uint16 | TERRAINLAYERSAMPLER_CHUNK_VERSION |
static const uint32 | TERRAINLAYERSAMPLERELEMENT_CHUNK_ID |
static const uint16 | TERRAINLAYERSAMPLERELEMENT_CHUNK_VERSION |
static const uint32 | TERRAINLAYERINSTANCE_CHUNK_ID |
static const uint16 | TERRAINLAYERINSTANCE_CHUNK_VERSION |
static const uint32 | TERRAINDERIVEDDATA_CHUNK_ID |
static const uint16 | TERRAINDERIVEDDATA_CHUNK_VERSION |
static const size_t | LOD_MORPH_CUSTOM_PARAM |
static const uint8 | DERIVED_DATA_DELTAS |
static const uint8 | DERIVED_DATA_NORMALS |
static const uint8 | DERIVED_DATA_LIGHTMAP |
static const uint8 | DERIVED_DATA_ALL |
static const uint16 | WORKQUEUE_DERIVED_DATA_REQUEST |
Protected Types | |
typedef vector< uint8 * >::type | BytePointerList |
typedef vector< TexturePtr >::type | TexturePtrList |
Protected Member Functions | |
void | freeCPUResources () |
void | freeGPUResources () |
void | determineLodLevels () |
void | distributeVertexData () |
void | updateBaseScale () |
void | createGPUBlendTextures () |
void | createLayerBlendMaps () |
void | createOrDestroyGPUNormalMap () |
void | createOrDestroyGPUColourMap () |
void | createOrDestroyGPULightmap () |
void | createOrDestroyGPUCompositeMap () |
void | waitForDerivedProcesses () |
void | convertSpace (Space inSpace, const Vector3 &inVec, Space outSpace, Vector3 &outVec, bool translation) const |
Vector3 | convertWorldToTerrainAxes (const Vector3 &inVec) const |
Vector3 | convertTerrainToWorldAxes (const Vector3 &inVec) const |
void | getPointAlign (long x, long y, Alignment align, Vector3 *outpos) |
Get a Vector3 of the world-space point on the terrain, aligned Y-up always. | |
void | getPointAlign (long x, long y, float height, Alignment align, Vector3 *outpos) |
Get a Vector3 of the world-space point on the terrain, supplying the height data manually (can be more optimal). | |
void | calculateCurrentLod (Viewport *vp) |
std::pair< bool, Vector3 > | checkQuadIntersection (int x, int y, const Ray &ray) |
Test a single quad of the terrain for ray intersection. | |
void | deleteBlendMaps (uint8 lowIndex) |
Delete blend maps for all layers >= lowIndex. | |
void | shiftUpGPUBlendChannels (uint8 index) |
Shift/slide all GPU blend texture channels > index up one slot. Blend data may shift into the next texture. | |
void | shiftDownGPUBlendChannels (uint8 index) |
Shift/slide all GPU blend texture channels > index down one slot. Blend data may shift into the previous texture. | |
void | copyBlendTextureChannel (uint8 srcIndex, uint8 srcChannel, uint8 destIndex, uint8 destChannel) |
Copy a GPU blend channel from one source to another. Source and Dest are not required to be in the same texture. | |
void | clearGPUBlendChannel (uint8 index, uint channel) |
Reset a blend channel back to full black. | |
void | copyGlobalOptions () |
void | checkLayers (bool includeGPUResources) |
void | checkDeclaration () |
void | deriveUVMultipliers () |
PixelFormat | getBlendTextureFormat (uint8 textureIndex, uint8 numLayers) |
void | updateDerivedDataImpl (const Rect &rect, const Rect &lightmapExtraRect, bool synchronous, uint8 typeMask) |
void | getEdgeRect (NeighbourIndex index, long range, Rect *outRect) |
void | getNeighbourEdgeRect (NeighbourIndex index, const Rect &inRect, Rect *outRect) |
void | getNeighbourPoint (NeighbourIndex index, long x, long y, long *outx, long *outy) |
void | getNeighbourPointOverflow (long x, long y, NeighbourIndex *outindex, long *outx, long *outy) |
size_t | getPositionBufVertexSize () const |
size_t | getDeltaBufVertexSize () const |
Protected Attributes | |
uint16 | mWorkQueueChannel |
SceneManager * | mSceneMgr |
SceneNode * | mRootNode |
String | mResourceGroup |
bool | mIsLoaded |
bool | mModified |
bool | mHeightDataModified |
float * | mHeightData |
The height data (world coords relative to mPos). | |
float * | mDeltaData |
The delta information defining how a vertex moves before it is removed at a lower LOD. | |
Alignment | mAlign |
Real | mWorldSize |
uint16 | mSize |
uint16 | mMaxBatchSize |
uint16 | mMinBatchSize |
Vector3 | mPos |
TerrainQuadTreeNode * | mQuadTree |
uint16 | mNumLodLevels |
uint16 | mNumLodLevelsPerLeafNode |
uint16 | mTreeDepth |
Real | mBase |
Base position in world space, relative to mPos. | |
Real | mScale |
Relationship between one point on the terrain and world size. | |
TerrainLayerDeclaration | mLayerDecl |
LayerInstanceList | mLayers |
RealVector | mLayerUVMultiplier |
Real | mSkirtSize |
uint8 | mRenderQueueGroup |
uint32 | mVisibilityFlags |
uint32 | mQueryFlags |
Rect | mDirtyGeometryRect |
Rect | mDirtyDerivedDataRect |
Rect | mDirtyGeometryRectForNeighbours |
Rect | mDirtyLightmapFromNeighboursRect |
bool | mDerivedDataUpdateInProgress |
uint8 | mDerivedUpdatePendingMask |
String | mMaterialName |
MaterialPtr | mMaterial |
TerrainMaterialGeneratorPtr | mMaterialGenerator |
unsigned long long int | mMaterialGenerationCount |
bool | mMaterialDirty |
bool | mMaterialParamsDirty |
uint16 | mLayerBlendMapSize |
uint16 | mLayerBlendMapSizeActual |
BytePointerList | mCpuBlendMapStorage |
Staging post for blend map data. | |
TexturePtrList | mBlendTextureList |
TerrainLayerBlendMapList | mLayerBlendMapList |
uint16 | mGlobalColourMapSize |
bool | mGlobalColourMapEnabled |
TexturePtr | mColourMap |
uint8 * | mCpuColourMapStorage |
uint16 | mLightmapSize |
uint16 | mLightmapSizeActual |
TexturePtr | mLightmap |
uint8 * | mCpuLightmapStorage |
uint16 | mCompositeMapSize |
uint16 | mCompositeMapSizeActual |
TexturePtr | mCompositeMap |
uint8 * | mCpuCompositeMapStorage |
Rect | mCompositeMapDirtyRect |
unsigned long | mCompositeMapUpdateCountdown |
unsigned long | mLastMillis |
bool | mCompositeMapDirtyRectLightmapUpdate |
true if the updates included lightmap changes (widen) | |
MaterialPtr | mCompositeMapMaterial |
bool | mLodMorphRequired |
bool | mNormalMapRequired |
bool | mLightMapRequired |
bool | mLightMapShadowsOnly |
bool | mCompositeMapRequired |
TexturePtr | mTerrainNormalMap |
Texture storing normals for the whole terrrain. | |
PixelBox * | mCpuTerrainNormalMap |
Pending data. | |
const Camera * | mLastLODCamera |
unsigned long | mLastLODFrame |
int | mLastViewportHeight |
Terrain * | mNeighbours [NEIGHBOUR_COUNT] |
GpuBufferAllocator * | mCustomGpuBufferAllocator |
DefaultGpuBufferAllocator | mDefaultGpuBufferAllocator |
Static Protected Attributes | |
static NameGenerator | msBlendTextureGenerator |
static NameGenerator | msNormalMapNameGenerator |
static NameGenerator | msLightmapNameGenerator |
static NameGenerator | msCompositeMapNameGenerator |
The main containing class for a chunk of terrain.
Name | Type | Description |
Terrain orientation | uint8 | The orientation of the terrain; XZ = 0, XY = 1, YZ = 2 |
Terrain size | uint16 | The number of vertices along one side of the terrain |
Terrain world size | Real | The world size of one side of the terrain |
Max batch size | uint16 | The maximum batch size in vertices along one side |
Min batch size | uint16 | The minimum batch size in vertices along one side |
Position | Vector3 | The location of the centre of the terrain |
Height data | float[size*size] | List of floating point heights |
LayerDeclaration | LayerDeclaration* | The layer declaration for this terrain (see below) |
Layer count | uint8 | The number of layers in this terrain |
LayerInstance list | LayerInstance* | A number of LayerInstance definitions based on layer count (see below) |
Layer blend map size | uint16 | The size of the layer blend maps as stored in this file |
Packed blend texture data | uint8* | layerCount-1 sets of blend texture data interleaved as either RGB or RGBA depending on layer count |
Optional derived map data | TerrainDerivedMap list | 0 or more sets of map data derived from the original terrain |
Delta data | float[size*size] | At each vertex, delta information for the LOD at which this vertex disappears |
Quadtree delta data | float[quadtrees*lods] | At each quadtree node, for each lod a record of the max delta value in the region |
Name | Type | Description |
TerrainLayerSampler Count | uint8 | Number of samplers in this declaration |
TerrainLayerSampler List | TerrainLayerSampler* | List of TerrainLayerSampler structures |
Sampler Element Count | uint8 | Number of sampler elements in this declaration |
TerrainLayerSamplerElement List | TerrainLayerSamplerElement* | List of TerrainLayerSamplerElement structures |
Name | Type | Description |
Alias | String | Alias name of this sampler |
Format | uint8 | Desired pixel format |
Name | Type | Description |
Source | uint8 | Sampler source index |
Semantic | uint8 | Semantic interpretation of this element |
Element start | uint8 | Start of this element in the sampler |
Element count | uint8 | Number of elements in the sampler used by this entry |
Name | Type | Description |
World size | Real | The world size of this layer (determines UV scaling) |
Texture list | String* | List of texture names corresponding to the number of samplers in the layer declaration |
Name | Type | Description |
Derived data type name | String | Name of the derived data type ('normalmap', 'lightmap', 'colourmap', 'compositemap') |
Size | uint16 | Size of the data along one edge |
Data | varies based on type | The data |
Definition at line 258 of file OgreTerrain.h.
typedef vector<uint8*>::type Ogre::Terrain::BytePointerList [protected] |
Definition at line 1757 of file OgreTerrain.h.
typedef vector<LayerInstance>::type Ogre::Terrain::LayerInstanceList |
Definition at line 299 of file OgreTerrain.h.
typedef vector<Real>::type Ogre::Terrain::RealVector |
Definition at line 285 of file OgreTerrain.h.
typedef vector<TexturePtr>::type Ogre::Terrain::TexturePtrList [protected] |
Definition at line 1760 of file OgreTerrain.h.
The alignment of the terrain.
ALIGN_X_Z |
Terrain is in the X/Z plane. |
ALIGN_X_Y |
Terrain is in the X/Y plane. |
ALIGN_Y_Z |
Terrain is in the Y/Z plane. |
Definition at line 302 of file OgreTerrain.h.
Neighbour index enumeration - indexed anticlockwise from East like angles.
NEIGHBOUR_EAST | |
NEIGHBOUR_NORTHEAST | |
NEIGHBOUR_NORTH | |
NEIGHBOUR_NORTHWEST | |
NEIGHBOUR_WEST | |
NEIGHBOUR_SOUTHWEST | |
NEIGHBOUR_SOUTH | |
NEIGHBOUR_SOUTHEAST | |
NEIGHBOUR_COUNT |
Definition at line 487 of file OgreTerrain.h.
enum Ogre::Terrain::Space |
Enumeration of relative spaces that you might want to use to address the terrain.
Definition at line 504 of file OgreTerrain.h.
Ogre::Terrain::Terrain | ( | SceneManager * | sm | ) |
Constructor.
sm | The SceneManager to use. |
virtual Ogre::Terrain::~Terrain | ( | ) | [virtual] |
static uint16 Ogre::Terrain::_calcSkirtVertexIndex | ( | uint16 | mainIndex, | |
uint16 | vdatasize, | |||
bool | isCol, | |||
uint16 | numSkirtRowsCols, | |||
uint16 | skirtRowColSkip | |||
) | [static] |
Utility method to calculate the skirt index for a given original vertex index.
void Ogre::Terrain::_dirtyCompositeMapRect | ( | const Rect & | rect | ) |
Mark a region of the terrain composite map as dirty.
Dump textures to files.
const MaterialPtr& Ogre::Terrain::_getCompositeMapMaterial | ( | ) | const |
Internal getting of material for the terrain composite map.
Definition at line 1307 of file OgreTerrain.h.
const String& Ogre::Terrain::_getDerivedResourceGroup | ( | ) | const |
Get the final resource group to use when loading / saving.
const MaterialPtr& Ogre::Terrain::_getMaterial | ( | ) | const |
Internal getting of material.
Definition at line 1303 of file OgreTerrain.h.
bool Ogre::Terrain::_getMorphRequired | ( | ) | const |
Get whether LOD morphing is needed.
Definition at line 1453 of file OgreTerrain.h.
static size_t Ogre::Terrain::_getNumIndexesForBatchSize | ( | uint16 | batchSize | ) | [static] |
Utility method to get the number of indexes required to render a given batch.
SceneNode* Ogre::Terrain::_getRootSceneNode | ( | ) | const |
Get the root scene node for the terrain (internal use only).
bool Ogre::Terrain::_getUseVertexCompression | ( | ) | const |
Whether we're using vertex compression or not.
static void Ogre::Terrain::_populateIndexBuffer | ( | uint16 * | pIndexes, | |
uint16 | batchSize, | |||
uint16 | vdatasize, | |||
size_t | vertexIncrement, | |||
uint16 | xoffset, | |||
uint16 | yoffset, | |||
uint16 | numSkirtRowsCols, | |||
uint16 | skirtRowColSkip | |||
) | [static] |
Utility method to populate a (locked) index buffer.
pIndexes | Pointer to an index buffer to populate | |
batchSize | The number of vertices down one side of the batch | |
vdatasize | The number of vertices down one side of the vertex data being referenced | |
vertexIncrement | The number of vertices to increment for each new indexed row / column | |
xoffset | The x offset from the start of the vertex data being referenced | |
yoffset | The y offset from the start of the vertex data being referenced | |
numSkirtRowsCols | Number of rows and columns of skirts | |
skirtRowColSkip | The number of rows / cols to skip in between skirts |
void Ogre::Terrain::_setCompositeMapRequired | ( | bool | compositeMap | ) |
Request internal implementation options for the terrain material to use, in this case a terrain-wide composite map.
The TerrainMaterialGenerator should call this method to specify the options it would like to use when creating a material. Not all the data is guaranteed to be up to date on return from this method - for example some maps may be generated in the background. However, on return from this method all the features that are requested will be referenceable by materials, the data may just take a few frames to be fully populated.
compositeMap | Whether a terrain-wide composite map is needed. A composite map is a texture with all of the blending and lighting baked in, such that at distance this texture can be used as an approximation of the multi-layer blended material. It is actually up to the material generator to render this composite map, because obviously precisely what it looks like depends on what the main material looks like. For this reason, the composite map is one piece of derived terrain data that is always calculated in the render thread, and usually on the GPU. It is expected that if this option is requested, the material generator will use it to construct distant LOD techniques. |
void Ogre::Terrain::_setLightMapRequired | ( | bool | lightMap, | |
bool | shadowsOnly = false | |||
) |
Request internal implementation options for the terrain material to use, in this case a terrain-wide normal map.
The TerrainMaterialGenerator should call this method to specify the options it would like to use when creating a material. Not all the data is guaranteed to be up to date on return from this method - for example some maps may be generated in the background. However, on return from this method all the features that are requested will be referenceable by materials, the data may just take a few frames to be fully populated.
lightMap | Whether a terrain-wide lightmap including precalculated lighting is required (light direction in TerrainGlobalOptions) | |
shadowsOnly | If true, the lightmap contains only shadows, no directional lighting intensity |
void Ogre::Terrain::_setMorphRequired | ( | bool | morph | ) |
Request internal implementation options for the terrain material to use, in this case vertex morphing information.
The TerrainMaterialGenerator should call this method to specify the options it would like to use when creating a material. Not all the data is guaranteed to be up to date on return from this method - for example som maps may be generated in the background. However, on return from this method all the features that are requested will be referenceable by materials, the data may just take a few frames to be fully populated.
morph | Whether LOD morphing information is required to be calculated |
Definition at line 1451 of file OgreTerrain.h.
void Ogre::Terrain::_setNormalMapRequired | ( | bool | normalMap | ) |
Request internal implementation options for the terrain material to use, in this case a terrain-wide normal map.
The TerrainMaterialGenerator should call this method to specify the options it would like to use when creating a material. Not all the data is guaranteed to be up to date on return from this method - for example some maps may be generated in the background. However, on return from this method all the features that are requested will be referenceable by materials, the data may just take a few frames to be fully populated.
normalMap | Whether a terrain-wide normal map is requested. This is usually mutually exclusive with the lightmap option. |
void Ogre::Terrain::addLayer | ( | uint8 | index, | |
Real | worldSize = 0 , |
|||
const StringVector * | textureNames = 0 | |||
) |
Add a new layer to this terrain at a specific index.
index | The index at which to insert this layer (existing layers are shifted forwards) | |
worldSize | The size of the texture in this layer in world units. Default to zero to use the default | |
textureNames | A list of textures to assign to the samplers in this layer. Leave blank to provide these later. |
void Ogre::Terrain::addLayer | ( | Real | worldSize = 0 , |
|
const StringVector * | textureNames = 0 | |||
) |
Add a new layer to this terrain.
worldSize | The size of the texture in this layer in world units. Default to zero to use the default | |
textureNames | A list of textures to assign to the samplers in this layer. Leave blank to provide these later. |
void Ogre::Terrain::addQueryFlags | ( | uint32 | flags | ) |
As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.
Definition at line 1340 of file OgreTerrain.h.
void Ogre::Terrain::calculateCurrentLod | ( | Viewport * | vp | ) | [protected] |
Calculate (or recalculate) the delta values of heights between a vertex in its recorded position, and the place it will end up in the LOD in which it is removed.
rect | Rectangle describing the area in which heights have altered |
PixelBox* Ogre::Terrain::calculateLightmap | ( | const Rect & | rect, | |
const Rect & | extraTargetRect, | |||
Rect & | outFinalRect | |||
) |
Calculate (or recalculate) the terrain lightmap.
rect | Rectangle describing the area of heights that were changed | |
extraTargetRect | Rectangle describing a target area of the terrain that needs to be calculated additionally (e.g. from a neighbour) | |
outFinalRect | Output rectangle describing the area updated in the lightmap |
bool Ogre::Terrain::canHandleRequest | ( | const WorkQueue::Request * | req, | |
const WorkQueue * | srcQ | |||
) | [virtual] |
WorkQueue::RequestHandler override.
Reimplemented from Ogre::WorkQueue::RequestHandler.
bool Ogre::Terrain::canHandleResponse | ( | const WorkQueue::Response * | res, | |
const WorkQueue * | srcQ | |||
) | [virtual] |
WorkQueue::ResponseHandler override.
Reimplemented from Ogre::WorkQueue::ResponseHandler.
void Ogre::Terrain::checkDeclaration | ( | ) | [protected] |
void Ogre::Terrain::checkLayers | ( | bool | includeGPUResources | ) | [protected] |
std::pair<bool, Vector3> Ogre::Terrain::checkQuadIntersection | ( | int | x, | |
int | y, | |||
const Ray & | ray | |||
) | [protected] |
Test a single quad of the terrain for ray intersection.
Reset a blend channel back to full black.
Vector3 Ogre::Terrain::convertDirection | ( | Space | inSpace, | |
const Vector3 & | inDir, | |||
Space | outSpace | |||
) | const |
Convert a direction from one space to another with respect to this terrain.
inSpace | The space that inDir is expressed as | |
inDir | The incoming direction | |
outSpace | The space which outDir should be expressed as |
void Ogre::Terrain::convertDirection | ( | Space | inSpace, | |
const Vector3 & | inDir, | |||
Space | outSpace, | |||
Vector3 & | outDir | |||
) | const |
Convert a direction from one space to another with respect to this terrain.
inSpace | The space that inDir is expressed as | |
inDir | The incoming direction | |
outSpace | The space which outDir should be expressed as | |
outDir | The output direction to be populated |
Vector3 Ogre::Terrain::convertPosition | ( | Space | inSpace, | |
const Vector3 & | inPos, | |||
Space | outSpace | |||
) | const |
Convert a position from one space to another with respect to this terrain.
inSpace | The space that inPos is expressed as | |
inPos | The incoming position | |
outSpace | The space which outPos should be expressed as |
void Ogre::Terrain::convertPosition | ( | Space | inSpace, | |
const Vector3 & | inPos, | |||
Space | outSpace, | |||
Vector3 & | outPos | |||
) | const |
Convert a position from one space to another with respect to this terrain.
inSpace | The space that inPos is expressed as | |
inPos | The incoming position | |
outSpace | The space which outPos should be expressed as | |
outPos | The output position to be populated |
void Ogre::Terrain::convertSpace | ( | Space | inSpace, | |
const Vector3 & | inVec, | |||
Space | outSpace, | |||
Vector3 & | outVec, | |||
bool | translation | |||
) | const [protected] |
static void Ogre::Terrain::convertTerrainToWorldAxes | ( | Alignment | align, | |
const Vector3 & | terrainVec, | |||
Vector3 * | worldVec | |||
) | [static] |
Utility method to convert axes from terrain space (xy terrain, z up) tp world space.
static void Ogre::Terrain::convertWorldToTerrainAxes | ( | Alignment | align, | |
const Vector3 & | worldVec, | |||
Vector3 * | terrainVec | |||
) | [static] |
Utility method to convert axes from world space to terrain space (xy terrain, z up).
void Ogre::Terrain::copyBlendTextureChannel | ( | uint8 | srcIndex, | |
uint8 | srcChannel, | |||
uint8 | destIndex, | |||
uint8 | destChannel | |||
) | [protected] |
Copy a GPU blend channel from one source to another. Source and Dest are not required to be in the same texture.
void Ogre::Terrain::copyGlobalOptions | ( | ) | [protected] |
void Ogre::Terrain::createGPUBlendTextures | ( | ) | [protected] |
void Ogre::Terrain::createLayerBlendMaps | ( | ) | [protected] |
void Ogre::Terrain::createOrDestroyGPUColourMap | ( | ) | [protected] |
void Ogre::Terrain::createOrDestroyGPUCompositeMap | ( | ) | [protected] |
void Ogre::Terrain::createOrDestroyGPULightmap | ( | ) | [protected] |
void Ogre::Terrain::createOrDestroyGPUNormalMap | ( | ) | [protected] |
void Ogre::Terrain::deleteBlendMaps | ( | uint8 | lowIndex | ) | [protected] |
Delete blend maps for all layers >= lowIndex.
void Ogre::Terrain::deriveUVMultipliers | ( | ) | [protected] |
void Ogre::Terrain::determineLodLevels | ( | ) | [protected] |
void Ogre::Terrain::dirty | ( | ) |
Mark the entire terrain as dirty.
By marking a section of the terrain as dirty, you are stating that you have changed the height data within this rectangle. This rectangle will be merged with any existing outstanding changes. To finalise the changes, you must call update(), updateGeometry(), or updateDerivedData().
void Ogre::Terrain::dirtyLightmap | ( | ) |
Mark a the entire lightmap as dirty.
void Ogre::Terrain::dirtyLightmapRect | ( | const Rect & | rect | ) |
Mark a region of the lightmap as dirty.
void Ogre::Terrain::dirtyRect | ( | const Rect & | rect | ) |
Mark a region of the terrain as dirty.
By marking a section of the terrain as dirty, you are stating that you have changed the height data within this rectangle. This rectangle will be merged with any existing outstanding changes. To finalise the changes, you must call update(), updateGeometry(), or updateDerivedData().
rect | A rectangle expressed in vertices describing the dirty region; left < right, top < bottom, left & top are inclusive, right & bottom exclusive |
void Ogre::Terrain::distributeVertexData | ( | ) | [protected] |
void Ogre::Terrain::finaliseHeightDeltas | ( | const Rect & | rect, | |
bool | cpuData | |||
) |
Finalise the height deltas.
Calculated height deltas are kept in a separate calculation field to make them safe to perform in a background thread. This call promotes those calculations to the runtime values, and must be called in the main thread.
rect | Rectangle describing the area to finalise | |
cpuData | When updating vertex data, update the CPU copy (background) |
Finalise the lightmap.
Calculating lightmaps is kept in a separate calculation area to make it safe to perform in a background thread. This call promotes those calculations to the runtime values, and must be called in the main thread.
Finalise the normals.
Calculated normals are kept in a separate calculation area to make them safe to perform in a background thread. This call promotes those calculations to the runtime values, and must be called in the main thread.
void Ogre::Terrain::freeCPUResources | ( | ) | [protected] |
void Ogre::Terrain::freeGPUResources | ( | ) | [protected] |
void Ogre::Terrain::freeTemporaryResources | ( | ) |
Free as many resources as possible for optimal run-time memory use.
const AxisAlignedBox& Ogre::Terrain::getAABB | ( | ) | const |
Get the AABB (local coords) of the entire terrain.
Alignment Ogre::Terrain::getAlignment | ( | ) | const |
Get the alignment of the terrain.
Get the number of blend textures needed for a given number of layers.
uint8 Ogre::Terrain::getBlendTextureCount | ( | ) | const |
Get the number of blend textures in use.
PixelFormat Ogre::Terrain::getBlendTextureFormat | ( | uint8 | textureIndex, | |
uint8 | numLayers | |||
) | [protected] |
Get the index of the blend texture that a given layer uses.
layerIndex | The layer index, must be >= 1 and less than the number of layers |
Get the name of the packed blend texture at a specific index.
textureIndex | This is the blend texture index, not the layer index (multiple layers will share a blend texture) |
Real Ogre::Terrain::getBoundingRadius | ( | ) | const |
Get the bounding radius of the entire terrain.
const TexturePtr& Ogre::Terrain::getCompositeMap | ( | ) | const |
Get access to the composite map, if enabled (as requested by the material generator).
Definition at line 1075 of file OgreTerrain.h.
const MaterialPtr& Ogre::Terrain::getCompositeMapMaterial | ( | ) | const |
Get the material being used for the terrain composite map.
uint16 Ogre::Terrain::getCompositeMapSize | ( | ) | const |
Get the requested size of composite map for this terrain.
Note that where hardware limits this, the actual texture may be lower resolution. This option is derived from TerrainGlobalOptions when the terrain is created.
Definition at line 1072 of file OgreTerrain.h.
size_t Ogre::Terrain::getDeltaBufVertexSize | ( | ) | const [protected] |
const float* Ogre::Terrain::getDeltaData | ( | long | x, | |
long | y | |||
) |
Get a pointer to the delta data for a given point.
const float* Ogre::Terrain::getDeltaData | ( | ) |
Get a pointer to all the delta data for this terrain.
void Ogre::Terrain::getEdgeRect | ( | NeighbourIndex | index, | |
long | range, | |||
Rect * | outRect | |||
) | [protected] |
const TexturePtr& Ogre::Terrain::getGlobalColourMap | ( | ) | const |
Get access to the global colour map, if enabled.
Definition at line 1397 of file OgreTerrain.h.
bool Ogre::Terrain::getGlobalColourMapEnabled | ( | ) | const |
Get whether a global colour map is enabled on this terrain.
Definition at line 1393 of file OgreTerrain.h.
uint16 Ogre::Terrain::getGlobalColourMapSize | ( | ) | const |
Get the size of the global colour map (if used).
Definition at line 1395 of file OgreTerrain.h.
GpuBufferAllocator* Ogre::Terrain::getGpuBufferAllocator | ( | ) |
Get the current buffer allocator.
float Ogre::Terrain::getHeightAtPoint | ( | long | x, | |
long | y | |||
) | const |
Get the height data for a given terrain point.
x,y | Discrete coordinates in terrain vertices, values from 0 to size-1, left/right bottom/top |
Get the height data for a given terrain position.
x,y | Position in terrain space, values from 0 to 1 left/right bottom/top |
float Ogre::Terrain::getHeightAtWorldPosition | ( | const Vector3 & | pos | ) |
Get the height data for a given world position (projecting the point down on to the terrain).
pos | Position in world space. Positions will be clamped to the edge of the terrain |
Get the height data for a given world position (projecting the point down on to the terrain).
x,y,z | Position in world space. Positions will be clamped to the edge of the terrain |
float* Ogre::Terrain::getHeightData | ( | long | x, | |
long | y | |||
) | const |
Get a pointer to the height data for a given point.
float* Ogre::Terrain::getHeightData | ( | ) | const |
Get a pointer to all the height data for this terrain.
TerrainLayerBlendMap* Ogre::Terrain::getLayerBlendMap | ( | uint8 | layerIndex | ) |
Retrieve the layer blending map for a given layer, which may be used to edit the blending information for that layer.
layerIndex | The layer index, which should be 1 or higher (since the bottom layer has no blending). |
uint16 Ogre::Terrain::getLayerBlendMapSize | ( | ) | const |
Get the requested size of the blend maps used to blend between layers for this terrain.
Note that where hardware limits this, the actual blend maps may be lower resolution. This option is derived from TerrainGlobalOptions when the terrain is created.
Definition at line 1055 of file OgreTerrain.h.
const TexturePtr& Ogre::Terrain::getLayerBlendTexture | ( | uint8 | index | ) |
Get a blend texture with a given index.
index | The blend texture index (note: not layer index; derive the texture index from getLayerBlendTextureIndex) |
Get the texture index and colour channel of the blend information for a given layer.
layerIndex | The index of the layer (1 or higher, layer 0 has no blend data) |
uint8 Ogre::Terrain::getLayerCount | ( | ) | const |
Get the number of layers in this terrain.
Definition at line 971 of file OgreTerrain.h.
const TerrainLayerDeclaration& Ogre::Terrain::getLayerDeclaration | ( | ) | const |
Get the declaration which describes the layers in this terrain.
Definition at line 974 of file OgreTerrain.h.
Get the name of the texture bound to a given index within a given layer.
See the LayerDeclaration for a list of sampelrs within a layer.
layerIndex | The layer index. | |
samplerIndex | The sampler index within a layer |
Get the layer UV multiplier.
index | The layer index. |
How large an area in world space the texture in a terrain layer covers before repeating.
index | The layer index. |
const TexturePtr& Ogre::Terrain::getLightmap | ( | ) | const |
Get access to the lightmap, if enabled (as requested by the material generator).
Definition at line 1065 of file OgreTerrain.h.
uint16 Ogre::Terrain::getLightmapSize | ( | ) | const |
Get the requested size of lightmap for this terrain.
Note that where hardware limits this, the actual lightmap may be lower resolution. This option is derived from TerrainGlobalOptions when the terrain is created.
Definition at line 1062 of file OgreTerrain.h.
uint16 Ogre::Terrain::getLODLevelWhenVertexEliminated | ( | long | rowOrColulmn | ) |
Utility method, get the first LOD Level at which this vertex is no longer included.
uint16 Ogre::Terrain::getLODLevelWhenVertexEliminated | ( | long | x, | |
long | y | |||
) |
Utility method, get the first LOD Level at which this vertex is no longer included.
const MaterialPtr& Ogre::Terrain::getMaterial | ( | ) | const |
Get the material being used for the terrain.
const String& Ogre::Terrain::getMaterialName | ( | ) | const |
Get the name of the material being used for the terrain.
Definition at line 1310 of file OgreTerrain.h.
uint16 Ogre::Terrain::getMaxBatchSize | ( | ) | const |
Get the maximum size in vertices along one side of a batch.
Real Ogre::Terrain::getMaxHeight | ( | ) | const |
Get the maximum height of the terrain.
uint8 Ogre::Terrain::getMaxLayers | ( | ) | const |
Get the maximum number of layers supported with the current options.
uint16 Ogre::Terrain::getMinBatchSize | ( | ) | const |
Get the minimum size in vertices along one side of a batch.
Real Ogre::Terrain::getMinHeight | ( | ) | const |
Get the minimum height of the terrain.
Terrain* Ogre::Terrain::getNeighbour | ( | NeighbourIndex | index | ) |
Retrieve the terrain's neighbour, or null if not present.
index | The index of the neighbour |
void Ogre::Terrain::getNeighbourEdgeRect | ( | NeighbourIndex | index, | |
const Rect & | inRect, | |||
Rect * | outRect | |||
) | [protected] |
static NeighbourIndex Ogre::Terrain::getNeighbourIndex | ( | long | offsetx, | |
long | offsety | |||
) | [static] |
Get the neighbour enum for a given offset in a grid (signed).
void Ogre::Terrain::getNeighbourPoint | ( | NeighbourIndex | index, | |
long | x, | |||
long | y, | |||
long * | outx, | |||
long * | outy | |||
) | [protected] |
void Ogre::Terrain::getNeighbourPointOverflow | ( | long | x, | |
long | y, | |||
NeighbourIndex * | outindex, | |||
long * | outx, | |||
long * | outy | |||
) | [protected] |
uint16 Ogre::Terrain::getNumLodLevels | ( | ) | const |
Get the total number of LOD levels in the terrain.
Definition at line 1213 of file OgreTerrain.h.
uint16 Ogre::Terrain::getNumLodLevelsPerLeaf | ( | ) | const |
Get the number of LOD levels in a leaf of the terrain quadtree.
Definition at line 1216 of file OgreTerrain.h.
static NeighbourIndex Ogre::Terrain::getOppositeNeighbour | ( | NeighbourIndex | index | ) | [static] |
Get the opposite neighbour relationship (useful for finding the neighbour index from the perspective of the tile the other side of the boundary).
void Ogre::Terrain::getPoint | ( | long | x, | |
long | y, | |||
float | height, | |||
Vector3 * | outpos | |||
) |
Get a Vector3 of the world-space point on the terrain, supplying the height data manually (can be more optimal).
void Ogre::Terrain::getPoint | ( | long | x, | |
long | y, | |||
Vector3 * | outpos | |||
) |
Get a Vector3 of the world-space point on the terrain, aligned as per options.
void Ogre::Terrain::getPointAlign | ( | long | x, | |
long | y, | |||
float | height, | |||
Alignment | align, | |||
Vector3 * | outpos | |||
) | [protected] |
Get a Vector3 of the world-space point on the terrain, supplying the height data manually (can be more optimal).
Get a Vector3 of the world-space point on the terrain, aligned Y-up always.
void Ogre::Terrain::getPointFromSelfOrNeighbour | ( | long | x, | |
long | y, | |||
Vector3 * | outpos | |||
) |
Get a Vector3 of the world-space point on the terrain, aligned as per options.
Cascades into neighbours if out of bounds.
void Ogre::Terrain::getPointTransform | ( | Matrix4 * | outXform | ) | const |
Get a transform which converts Vector4(xindex, yindex, height, 1) into an object-space position including scalings and alignment.
const Vector3& Ogre::Terrain::getPosition | ( | ) | const |
Get the world position of the terrain centre.
Definition at line 1078 of file OgreTerrain.h.
Convert a position from terrain basis space to world space.
x,y,z | Terrain space position, where (0,0) is the bottom-left of the terrain, and (1,1) is the top-right. The Z coordinate is in absolute height units. |
outWSpos | World space output position (setup according to current alignment). |
Convert a position from terrain basis space to world space.
TSpos | Terrain space position, where (0,0) is the bottom-left of the terrain, and (1,1) is the top-right. The Z coordinate is in absolute height units. |
outWSpos | World space output position (setup according to current alignment). |
void Ogre::Terrain::getPositionAlign | ( | Real | x, | |
Real | y, | |||
Real | z, | |||
Alignment | align, | |||
Vector3 * | outWSpos | |||
) |
Convert a position from terrain basis space to world space based on a specified alignment.
x,y,z | Terrain space position, where (0,0) is the bottom-left of the terrain, and (1,1) is the top-right. The Z coordinate is in absolute height units. | |
outWSpos | World space output position (setup according to alignment). |
Convert a position from terrain basis space to world space based on a specified alignment.
TSpos | Terrain space position, where (0,0) is the bottom-left of the terrain, and (1,1) is the top-right. The Z coordinate is in absolute height units. | |
outWSpos | World space output position (setup according to alignment). |
size_t Ogre::Terrain::getPositionBufVertexSize | ( | ) | const [protected] |
TerrainQuadTreeNode* Ogre::Terrain::getQuadTree | ( | ) |
Get the top level of the quad tree which is used to divide up the terrain.
Definition at line 1525 of file OgreTerrain.h.
uint32 Ogre::Terrain::getQueryFlags | ( | void | ) | const |
Get the query flags for this terrain.
Definition at line 1333 of file OgreTerrain.h.
uint8 Ogre::Terrain::getRenderQueueGroup | ( | void | ) | const |
Get the render queue group that this terrain will be rendered into.
Definition at line 1319 of file OgreTerrain.h.
Gets the resolution of the entire terrain (down one edge) at a given LOD level.
const String& Ogre::Terrain::getResourceGroup | ( | ) | const |
Get the resource group to use when loading / saving.
If this is blank, the default in TerrainGlobalOptions will be used.
Definition at line 663 of file OgreTerrain.h.
SceneManager* Ogre::Terrain::getSceneManager | ( | ) | const |
Definition at line 501 of file OgreTerrain.h.
uint16 Ogre::Terrain::getSize | ( | ) | const |
Get the size of the terrain in vertices along one side.
Real Ogre::Terrain::getSkirtSize | ( | ) | const |
The default size of 'skirts' used to hide terrain cracks (default 10, set for new Terrain using TerrainGlobalOptions).
Definition at line 1210 of file OgreTerrain.h.
TexturePtr Ogre::Terrain::getTerrainNormalMap | ( | ) | const |
Get the (global) normal map texture.
Definition at line 1528 of file OgreTerrain.h.
Convert a position from world space to terrain basis space.
x,y,z | World space position (setup according to current alignment). | |
outTSpos | Terrain space output position, where (0,0) is the bottom-left of the terrain, and (1,1) is the top-right. The Z coordinate is in absolute height units. |
Convert a position from world space to terrain basis space.
WSpos | World space position (setup according to current alignment). | |
outTSpos | Terrain space output position, where (0,0) is the bottom-left of the terrain, and (1,1) is the top-right. The Z coordinate is in absolute height units. |
void Ogre::Terrain::getTerrainPositionAlign | ( | Real | x, | |
Real | y, | |||
Real | z, | |||
Alignment | align, | |||
Vector3 * | outTSpos | |||
) |
Convert a position from world space to terrain basis space based on a specified alignment.
x,y,z | World space position (setup according to alignment). | |
outTSpos | Terrain space output position, where (0,0) is the bottom-left of the terrain, and (1,1) is the top-right. The Z coordinate is in absolute height units. |
void Ogre::Terrain::getTerrainPositionAlign | ( | const Vector3 & | WSpos, | |
Alignment | align, | |||
Vector3 * | outTSpos | |||
) |
Convert a position from world space to terrain basis space based on a specified alignment.
WSpos | World space position (setup according to alignment). | |
outTSpos | Terrain space output position, where (0,0) is the bottom-left of the terrain, and (1,1) is the top-right. The Z coordinate is in absolute height units. |
Translate a vector from world space to local terrain space based on the alignment options.
x,y,z | The vector in basis space, where x/y represents the terrain plane and z represents the up vector |
Translate a vector from world space to local terrain space based on the alignment options.
inVec | The vector in basis space, where x/y represents the terrain plane and z represents the up vector |
void Ogre::Terrain::getTerrainVectorAlign | ( | Real | x, | |
Real | y, | |||
Real | z, | |||
Alignment | align, | |||
Vector3 * | outVec | |||
) |
Translate a vector from world space to local terrain space based on a specified alignment.
x,y,z | The vector in world space, where x/y represents the terrain plane and z represents the up vector |
void Ogre::Terrain::getTerrainVectorAlign | ( | const Vector3 & | inVec, | |
Alignment | align, | |||
Vector3 * | outVec | |||
) |
Translate a vector from world space to local terrain space based on a specified alignment.
inVec | The vector in basis space, where x/y represents the terrain plane and z represents the up vector |
Translate a vector into world space based on the alignment options.
x,y,z | The vector in basis space, where x/y represents the terrain plane and z represents the up vector |
Translate a vector into world space based on the alignment options.
inVec | The vector in basis space, where x/y represents the terrain plane and z represents the up vector |
Translate a vector into world space based on a specified alignment.
x,y,z | The vector in basis space, where x/y represents the terrain plane and z represents the up vector |
Translate a vector into world space based on a specified alignment.
inVec | The vector in basis space, where x/y represents the terrain plane and z represents the up vector |
uint32 Ogre::Terrain::getVisibilityFlags | ( | void | ) | const |
Get the visibility flags for this terrain.
Definition at line 1326 of file OgreTerrain.h.
AxisAlignedBox Ogre::Terrain::getWorldAABB | ( | ) | const |
Get the AABB (world coords) of the entire terrain.
Real Ogre::Terrain::getWorldSize | ( | ) | const |
Get the size of the terrain in world units.
WorkQueue::Response* Ogre::Terrain::handleRequest | ( | const WorkQueue::Request * | req, | |
const WorkQueue * | srcQ | |||
) | [virtual] |
WorkQueue::RequestHandler override.
Implements Ogre::WorkQueue::RequestHandler.
void Ogre::Terrain::handleResponse | ( | const WorkQueue::Response * | res, | |
const WorkQueue * | srcQ | |||
) | [virtual] |
WorkQueue::ResponseHandler override.
Implements Ogre::WorkQueue::ResponseHandler.
bool Ogre::Terrain::isDerivedDataUpdateInProgress | ( | ) | const |
Query whether a derived data update is in progress or not.
Definition at line 1600 of file OgreTerrain.h.
bool Ogre::Terrain::isHeightDataModified | ( | ) | const |
Returns whether terrain heights have been modified since the terrain was first loaded / defined.
Definition at line 745 of file OgreTerrain.h.
bool Ogre::Terrain::isLoaded | ( | void | ) | const |
Return whether the terrain is loaded.
Definition at line 732 of file OgreTerrain.h.
bool Ogre::Terrain::isModified | ( | ) | const |
Returns whether this terrain has been modified since it was first loaded / defined.
Definition at line 738 of file OgreTerrain.h.
void Ogre::Terrain::load | ( | ) |
Load the terrain based on the data already populated via prepare methods.
void Ogre::Terrain::load | ( | StreamSerialiser & | stream | ) |
Prepare and load the terrain in one simple call from a stream.
void Ogre::Terrain::load | ( | const String & | filename | ) |
Prepare and load the terrain in one simple call from a standalone file.
void Ogre::Terrain::neighbourModified | ( | NeighbourIndex | index, | |
const Rect & | edgerect, | |||
const Rect & | shadowrect | |||
) |
Notify that a neighbour has just finished updating and that this change affects this tile.
index | The neighbour index (from this tile's perspective) | |
edgerect | The area at the edge of this tile that needs height / normal recalculation (may be null) | |
shadowrect | The area on this tile where shadows need recalculating (may be null) |
void Ogre::Terrain::notifyNeighbours | ( | ) |
Tell this instance to notify all neighbours that will be affected by a height change that has taken place.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr, | |
const char * | , | |||
int | , | |||
const char * | ||||
) | [inherited] |
Definition at line 107 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr, | |
void * | ||||
) | [inherited] |
Definition at line 101 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | [inherited] |
Definition at line 95 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr, | |
const char * | , | |||
int | , | |||
const char * | ||||
) | [inherited] |
Definition at line 118 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | [inherited] |
Definition at line 112 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz, | |
void * | ptr | |||
) | [inherited] |
placement operator new
Definition at line 78 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | [inherited] |
Definition at line 72 of file OgreMemoryAllocatedObject.h.
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.
void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | [inherited] |
Definition at line 90 of file OgreMemoryAllocatedObject.h.
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.
virtual void Ogre::SceneManager::Listener::postFindVisibleObjects | ( | SceneManager * | source, | |
IlluminationRenderStage | irs, | |||
Viewport * | v | |||
) | [virtual, inherited] |
Called after searching for visible objects in this SceneManager.
source | The SceneManager instance raising this event. | |
irs | The stage of illumination being dealt with. IRS_NONE for a regular render, IRS_RENDER_TO_TEXTURE for a shadow caster render. | |
v | The viewport being updated. You can get the camera from here. |
Reimplemented in Ogre::RTShader::ShaderGenerator::SGSceneManagerListener.
Definition at line 266 of file OgreSceneManager.h.
virtual void Ogre::SceneManager::Listener::postUpdateSceneGraph | ( | SceneManager * | source, | |
Camera * | camera | |||
) | [virtual, inherited] |
Called after updating the scene graph in this SceneManager.
source | The SceneManager instance raising this event. | |
camera | The camera being updated. |
Definition at line 240 of file OgreSceneManager.h.
void Ogre::Terrain::preFindVisibleObjects | ( | SceneManager * | source, | |
SceneManager::IlluminationRenderStage | irs, | |||
Viewport * | v | |||
) | [virtual] |
Overridden from SceneManager::Listener.
Reimplemented from Ogre::SceneManager::Listener.
bool Ogre::Terrain::prepare | ( | const ImportData & | importData | ) |
Prepare the terrain from some import data rather than loading from native data.
bool Ogre::Terrain::prepare | ( | StreamSerialiser & | stream | ) |
Prepare terrain data from saved data.
bool Ogre::Terrain::prepare | ( | const String & | filename | ) |
Prepare the terrain from a standalone file.
virtual void Ogre::SceneManager::Listener::preUpdateSceneGraph | ( | SceneManager * | source, | |
Camera * | camera | |||
) | [virtual, inherited] |
Called prior to updating the scene graph in this SceneManager.
source | The SceneManager instance raising this event. | |
camera | The camera being updated. |
Definition at line 231 of file OgreSceneManager.h.
std::pair<bool, Vector3> Ogre::Terrain::rayIntersects | ( | const Ray & | ray, | |
bool | cascadeToNeighbours = false , |
|||
Real | distanceLimit = 0 | |||
) |
Test for intersection of a given ray with the terrain.
If the ray hits the terrain, the point of intersection is returned.
ray | The ray to test for intersection | |
cascadeToNeighbours | Whether the ray will be projected onto neighbours if no intersection is found | |
distanceLimit | The distance from the ray origin at which we will stop looking, 0 indicates no limit |
Utility method to pick a neighbour based on a ray.
ray | The ray in world space | |
distanceLimit | Limit beyond which we want to ignore neighbours (0 for infinite) |
static bool Ogre::Terrain::readLayerDeclaration | ( | StreamSerialiser & | ser, | |
TerrainLayerDeclaration & | targetdecl | |||
) | [static] |
Utility method to read a layer declaration from a stream.
static bool Ogre::Terrain::readLayerInstanceList | ( | StreamSerialiser & | ser, | |
size_t | numSamplers, | |||
Terrain::LayerInstanceList & | targetlst | |||
) | [static] |
Utility method to read a layer instance list from a stream.
void Ogre::Terrain::removeLayer | ( | uint8 | index | ) |
Remove a layer from the terrain.
void Ogre::Terrain::removeQueryFlags | ( | uint32 | flags | ) |
Definition at line 1343 of file OgreTerrain.h.
void Ogre::Terrain::replaceLayer | ( | uint8 | index, | |
bool | keepBlends, | |||
Real | worldSize = 0 , |
|||
const StringVector * | textureNames = 0 | |||
) |
Replace an existing terrain layer, optionally preserving all other layer blend maps.
index | The 0 based index of the terrain layer to replace | |
keepBlends | True to keep using the existing blend maps. False to reset the blend map for the layer. Irrelevant if index == 0 | |
worldSize | The size of the texture in this layer in world units. Default to zero to use the default | |
textureNames | A list of textures to assign to the samplers in this layer. Leave blank to provide these later. |
void Ogre::Terrain::save | ( | StreamSerialiser & | stream | ) |
Save terrain data in native form to a serializing stream.
void Ogre::Terrain::save | ( | const String & | filename | ) |
Save terrain data in native form to a standalone file.
filename | The name of the file to save to. If this is a filename with no path elements, then it is saved in the first writeable location available in the resource group you have chosen to use for this terrain. If the filename includes path specifiers then it is saved directly instead (but note that it may not be reloadable via the resource system if the location is not on the path). |
void Ogre::Terrain::sceneManagerDestroyed | ( | SceneManager * | source | ) | [virtual] |
Overridden from SceneManager::Listener.
Reimplemented from Ogre::SceneManager::Listener.
void Ogre::Terrain::setGlobalColourMapEnabled | ( | bool | enabled, | |
uint16 | size = 0 | |||
) |
Set whether a global colour map is enabled.
enabled | Whether the global colour map is enabled or not | |
size | The resolution of the colour map. A value of zero means 'no change' and the default is set in TerrainGlobalOptions. |
void Ogre::Terrain::setGpuBufferAllocator | ( | GpuBufferAllocator * | alloc | ) |
Tell this instance to use the given GpuBufferAllocator.
void Ogre::Terrain::setHeightAtPoint | ( | long | x, | |
long | y, | |||
float | h | |||
) |
Set the height data for a given terrain point.
x,y | Discrete coordinates in terrain vertices, values from 0 to size-1, left/right bottom/top | |
h | The new height |
void Ogre::Terrain::setLayerTextureName | ( | uint8 | layerIndex, | |
uint8 | samplerIndex, | |||
const String & | textureName | |||
) |
Set the name of the texture bound to a given index within a given layer.
See the LayerDeclaration for a list of sampelrs within a layer.
index | The layer index. | |
size | The world size of the texture before repeating | |
textureName | The name of the texture to use |
How large an area in world space the texture in a terrain layer covers before repeating.
index | The layer index. | |
size | The world size of the texture before repeating |
void Ogre::Terrain::setNeighbour | ( | NeighbourIndex | index, | |
Terrain * | neighbour, | |||
bool | recalculate = false , |
|||
bool | notifyOther = true | |||
) |
Set a terrain's neighbour, or null to detach one.
index | The index of the neighbour | |
neighbour | The terrain instance to become the neighbour, or null to reset. | |
recalculate | If true, this terrain instance will recalculate elements that could be affected by the connection of this tile (e.g. matching heights, calcaulting normals, calculating shadows crossing the boundary). If false, this terrain's state is assumed to be up to date already (e.g. was calculated with this tile present before and the state saved). | |
notifyOther | Whether the neighbour should also be notified (recommended to leave this at the default so relationships are up to date before background updates are triggered) |
void Ogre::Terrain::setPosition | ( | const Vector3 & | pos | ) |
Set the position of the terrain centre in world coordinates.
void Ogre::Terrain::setQueryFlags | ( | uint32 | flags | ) |
Set the query flags for this terrain.
Definition at line 1337 of file OgreTerrain.h.
void Ogre::Terrain::setRenderQueueGroup | ( | uint8 | grp | ) |
Set the render queue group that this terrain will be rendered into.
Definition at line 1323 of file OgreTerrain.h.
void Ogre::Terrain::setResourceGroup | ( | const String & | resGroup | ) |
Set the resource group to use when loading / saving.
resGroup | Resource group name - you can set this to blank to use the default in TerrainGlobalOptions. |
Definition at line 658 of file OgreTerrain.h.
void Ogre::Terrain::setSize | ( | uint16 | newSize | ) |
Set the size of terrain in vertices along one side.
newSize | the new size of the terrain |
void Ogre::Terrain::setVisibilityFlags | ( | uint32 | flags | ) |
Set the visibility flags for this terrain.
Definition at line 1330 of file OgreTerrain.h.
void Ogre::Terrain::setWorldSize | ( | Real | newWorldSize | ) |
Set the world size of terrain.
newWorldSize | the new world size of the terrain |
virtual void Ogre::SceneManager::Listener::shadowTextureCasterPreViewProj | ( | Light * | light, | |
Camera * | camera, | |||
size_t | iteration | |||
) | [virtual, inherited] |
This event occurs just before the view & projection matrices are set for rendering into a shadow texture.
light | Pointer to the light for which shadows are being rendered | |
camera | Pointer to the camera being used to render | |
iteration | For lights that use multiple shadow textures, the iteration number |
Reimplemented in Ogre::RTShader::ShaderGenerator::SGSceneManagerListener.
Definition at line 300 of file OgreSceneManager.h.
virtual void Ogre::SceneManager::Listener::shadowTextureReceiverPreViewProj | ( | Light * | light, | |
Frustum * | frustum | |||
) | [virtual, inherited] |
This event occurs just before the view & projection matrices are set for re-rendering a shadow receiver.
light | Pointer to the light for which shadows are being rendered | |
frustum | Pointer to the projection frustum being used to project the shadow texture |
Reimplemented in Ogre::RTShader::ShaderGenerator::SGSceneManagerListener.
Definition at line 317 of file OgreSceneManager.h.
virtual void Ogre::SceneManager::Listener::shadowTexturesUpdated | ( | size_t | numberOfShadowTextures | ) | [virtual, inherited] |
Event raised after all shadow textures have been rendered into for all queues / targets but before any other geometry has been rendered (including main scene geometry and any additional shadow receiver passes).
numberOfShadowTextures | The number of shadow textures in use |
Reimplemented in Ogre::RTShader::ShaderGenerator::SGSceneManagerListener.
Definition at line 284 of file OgreSceneManager.h.
void Ogre::Terrain::shiftDownGPUBlendChannels | ( | uint8 | index | ) | [protected] |
Shift/slide all GPU blend texture channels > index down one slot. Blend data may shift into the previous texture.
void Ogre::Terrain::shiftUpGPUBlendChannels | ( | uint8 | index | ) | [protected] |
Shift/slide all GPU blend texture channels > index up one slot. Blend data may shift into the next texture.
virtual bool Ogre::SceneManager::Listener::sortLightsAffectingFrustum | ( | LightList & | lightList | ) | [virtual, inherited] |
Hook to allow the listener to override the ordering of lights for the entire frustum.
lightList | The list of lights within range of the frustum which you may sort. |
Definition at line 343 of file OgreSceneManager.h.
void Ogre::Terrain::unload | ( | ) |
Unload the terrain and free GPU resources.
void Ogre::Terrain::unprepare | ( | ) |
Free CPU resources created during prepare methods.
void Ogre::Terrain::update | ( | bool | synchronous = false |
) |
Trigger the update process for the terrain.
You can also separate the timing of updating the geometry, LOD and the lighting information if you want, by calling updateGeometry() and updateDerivedData() separately.
synchronous | If true, all updates will happen immediately and not in a separate thread. |
void Ogre::Terrain::updateBaseScale | ( | ) | [protected] |
void Ogre::Terrain::updateCompositeMap | ( | ) |
Performs an update on the terrain composite map based on its dirty region.
void Ogre::Terrain::updateCompositeMapWithDelay | ( | Real | delay = 2 |
) |
Performs an update on the terrain composite map based on its dirty region, but only at a maximum frequency.
void Ogre::Terrain::updateDerivedData | ( | bool | synchronous = false , |
|
uint8 | typeMask = 0xFF | |||
) |
Updates derived data for the terrain (LOD, lighting) to reflect changed height data, in a separate thread if threading is enabled (OGRE_THREAD_SUPPORT).
If threading is enabled, on return from this method the derived data will not necessarily be updated immediately, the calculation may be done in the background. Only one update will run in the background at once. This derived data can typically survive being out of sync for a few frames which is why it is not done synchronously
synchronous | If true, the update will happen immediately and not in a separate thread. | |
typeMask | Mask indicating the types of data we should generate |
void Ogre::Terrain::updateDerivedDataImpl | ( | const Rect & | rect, | |
const Rect & | lightmapExtraRect, | |||
bool | synchronous, | |||
uint8 | typeMask | |||
) | [protected] |
void Ogre::Terrain::updateGeometry | ( | ) |
Performs an update on the terrain geometry based on the dirty region.
void Ogre::Terrain::waitForDerivedProcesses | ( | ) | [protected] |
void Ogre::Terrain::widenRectByVector | ( | const Vector3 & | vec, | |
const Rect & | inRect, | |||
Real | minHeight, | |||
Real | maxHeight, | |||
Rect & | outRect | |||
) |
Widen a rectangular area of terrain to take into account an extrusion vector, but specify the min / max heights to extrude manually.
vec | A vector in world space | |
inRect | Input rectangle | |
minHeight,maxHeight | The extents of the height to extrude | |
inRect | Output rectangle |
Widen a rectangular area of terrain to take into account an extrusion vector.
vec | A vector in world space | |
inRect | Input rectangle | |
inRect | Output rectangle |
static void Ogre::Terrain::writeLayerDeclaration | ( | const TerrainLayerDeclaration & | decl, | |
StreamSerialiser & | ser | |||
) | [static] |
Utility method to write a layer declaration to a stream.
static void Ogre::Terrain::writeLayerInstanceList | ( | const Terrain::LayerInstanceList & | lst, | |
StreamSerialiser & | ser | |||
) | [static] |
Utility method to write a layer instance list to a stream.
const uint8 Ogre::Terrain::DERIVED_DATA_ALL [static] |
Definition at line 1166 of file OgreTerrain.h.
const uint8 Ogre::Terrain::DERIVED_DATA_DELTAS [static] |
Definition at line 1163 of file OgreTerrain.h.
const uint8 Ogre::Terrain::DERIVED_DATA_LIGHTMAP [static] |
Definition at line 1165 of file OgreTerrain.h.
const uint8 Ogre::Terrain::DERIVED_DATA_NORMALS [static] |
Definition at line 1164 of file OgreTerrain.h.
const size_t Ogre::Terrain::LOD_MORPH_CUSTOM_PARAM [static] |
Definition at line 283 of file OgreTerrain.h.
Alignment Ogre::Terrain::mAlign [protected] |
Definition at line 1687 of file OgreTerrain.h.
Real Ogre::Terrain::mBase [protected] |
Base position in world space, relative to mPos.
Definition at line 1698 of file OgreTerrain.h.
TexturePtrList Ogre::Terrain::mBlendTextureList [protected] |
Definition at line 1761 of file OgreTerrain.h.
TexturePtr Ogre::Terrain::mColourMap [protected] |
Definition at line 1766 of file OgreTerrain.h.
TexturePtr Ogre::Terrain::mCompositeMap [protected] |
Definition at line 1776 of file OgreTerrain.h.
Rect Ogre::Terrain::mCompositeMapDirtyRect [protected] |
Definition at line 1778 of file OgreTerrain.h.
bool Ogre::Terrain::mCompositeMapDirtyRectLightmapUpdate [protected] |
true if the updates included lightmap changes (widen)
Definition at line 1782 of file OgreTerrain.h.
MaterialPtr Ogre::Terrain::mCompositeMapMaterial [mutable, protected] |
Definition at line 1783 of file OgreTerrain.h.
bool Ogre::Terrain::mCompositeMapRequired [protected] |
Definition at line 1795 of file OgreTerrain.h.
uint16 Ogre::Terrain::mCompositeMapSize [protected] |
Definition at line 1774 of file OgreTerrain.h.
uint16 Ogre::Terrain::mCompositeMapSizeActual [protected] |
Definition at line 1775 of file OgreTerrain.h.
unsigned long Ogre::Terrain::mCompositeMapUpdateCountdown [protected] |
Definition at line 1779 of file OgreTerrain.h.
BytePointerList Ogre::Terrain::mCpuBlendMapStorage [protected] |
Staging post for blend map data.
Definition at line 1759 of file OgreTerrain.h.
uint8* Ogre::Terrain::mCpuColourMapStorage [protected] |
Definition at line 1767 of file OgreTerrain.h.
uint8* Ogre::Terrain::mCpuCompositeMapStorage [protected] |
Definition at line 1777 of file OgreTerrain.h.
uint8* Ogre::Terrain::mCpuLightmapStorage [protected] |
Definition at line 1772 of file OgreTerrain.h.
PixelBox* Ogre::Terrain::mCpuTerrainNormalMap [protected] |
Pending data.
Definition at line 1800 of file OgreTerrain.h.
Definition at line 1808 of file OgreTerrain.h.
Definition at line 1809 of file OgreTerrain.h.
float* Ogre::Terrain::mDeltaData [protected] |
The delta information defining how a vertex moves before it is removed at a lower LOD.
Definition at line 1686 of file OgreTerrain.h.
bool Ogre::Terrain::mDerivedDataUpdateInProgress [protected] |
Definition at line 1714 of file OgreTerrain.h.
uint8 Ogre::Terrain::mDerivedUpdatePendingMask [protected] |
Definition at line 1715 of file OgreTerrain.h.
Rect Ogre::Terrain::mDirtyDerivedDataRect [protected] |
Definition at line 1711 of file OgreTerrain.h.
Rect Ogre::Terrain::mDirtyGeometryRect [protected] |
Definition at line 1710 of file OgreTerrain.h.
Rect Ogre::Terrain::mDirtyGeometryRectForNeighbours [protected] |
Definition at line 1712 of file OgreTerrain.h.
Rect Ogre::Terrain::mDirtyLightmapFromNeighboursRect [protected] |
Definition at line 1713 of file OgreTerrain.h.
bool Ogre::Terrain::mGlobalColourMapEnabled [protected] |
Definition at line 1765 of file OgreTerrain.h.
uint16 Ogre::Terrain::mGlobalColourMapSize [protected] |
Definition at line 1764 of file OgreTerrain.h.
float* Ogre::Terrain::mHeightData [protected] |
The height data (world coords relative to mPos).
Definition at line 1684 of file OgreTerrain.h.
bool Ogre::Terrain::mHeightDataModified [protected] |
Definition at line 1681 of file OgreTerrain.h.
bool Ogre::Terrain::mIsLoaded [protected] |
Definition at line 1679 of file OgreTerrain.h.
const Camera* Ogre::Terrain::mLastLODCamera [protected] |
Definition at line 1802 of file OgreTerrain.h.
unsigned long Ogre::Terrain::mLastLODFrame [protected] |
Definition at line 1803 of file OgreTerrain.h.
unsigned long Ogre::Terrain::mLastMillis [protected] |
Definition at line 1780 of file OgreTerrain.h.
int Ogre::Terrain::mLastViewportHeight [protected] |
Definition at line 1804 of file OgreTerrain.h.
Definition at line 1762 of file OgreTerrain.h.
uint16 Ogre::Terrain::mLayerBlendMapSize [protected] |
Definition at line 1755 of file OgreTerrain.h.
uint16 Ogre::Terrain::mLayerBlendMapSizeActual [protected] |
Definition at line 1756 of file OgreTerrain.h.
TerrainLayerDeclaration Ogre::Terrain::mLayerDecl [protected] |
Definition at line 1701 of file OgreTerrain.h.
LayerInstanceList Ogre::Terrain::mLayers [protected] |
Definition at line 1702 of file OgreTerrain.h.
RealVector Ogre::Terrain::mLayerUVMultiplier [protected] |
Definition at line 1703 of file OgreTerrain.h.
TexturePtr Ogre::Terrain::mLightmap [protected] |
Definition at line 1771 of file OgreTerrain.h.
bool Ogre::Terrain::mLightMapRequired [protected] |
Definition at line 1793 of file OgreTerrain.h.
bool Ogre::Terrain::mLightMapShadowsOnly [protected] |
Definition at line 1794 of file OgreTerrain.h.
uint16 Ogre::Terrain::mLightmapSize [protected] |
Definition at line 1769 of file OgreTerrain.h.
uint16 Ogre::Terrain::mLightmapSizeActual [protected] |
Definition at line 1770 of file OgreTerrain.h.
bool Ogre::Terrain::mLodMorphRequired [protected] |
Definition at line 1791 of file OgreTerrain.h.
MaterialPtr Ogre::Terrain::mMaterial [mutable, protected] |
Definition at line 1749 of file OgreTerrain.h.
bool Ogre::Terrain::mMaterialDirty [mutable, protected] |
Definition at line 1752 of file OgreTerrain.h.
unsigned long long int Ogre::Terrain::mMaterialGenerationCount [mutable, protected] |
Definition at line 1751 of file OgreTerrain.h.
TerrainMaterialGeneratorPtr Ogre::Terrain::mMaterialGenerator [mutable, protected] |
Definition at line 1750 of file OgreTerrain.h.
String Ogre::Terrain::mMaterialName [protected] |
Definition at line 1748 of file OgreTerrain.h.
bool Ogre::Terrain::mMaterialParamsDirty [mutable, protected] |
Definition at line 1753 of file OgreTerrain.h.
uint16 Ogre::Terrain::mMaxBatchSize [protected] |
Definition at line 1690 of file OgreTerrain.h.
uint16 Ogre::Terrain::mMinBatchSize [protected] |
Definition at line 1691 of file OgreTerrain.h.
bool Ogre::Terrain::mModified [protected] |
Definition at line 1680 of file OgreTerrain.h.
Terrain* Ogre::Terrain::mNeighbours[NEIGHBOUR_COUNT] [protected] |
Definition at line 1806 of file OgreTerrain.h.
bool Ogre::Terrain::mNormalMapRequired [protected] |
Definition at line 1792 of file OgreTerrain.h.
uint16 Ogre::Terrain::mNumLodLevels [protected] |
Definition at line 1694 of file OgreTerrain.h.
uint16 Ogre::Terrain::mNumLodLevelsPerLeafNode [protected] |
Definition at line 1695 of file OgreTerrain.h.
Vector3 Ogre::Terrain::mPos [protected] |
Definition at line 1692 of file OgreTerrain.h.
TerrainQuadTreeNode* Ogre::Terrain::mQuadTree [protected] |
Definition at line 1693 of file OgreTerrain.h.
uint32 Ogre::Terrain::mQueryFlags [protected] |
Definition at line 1708 of file OgreTerrain.h.
uint8 Ogre::Terrain::mRenderQueueGroup [protected] |
Definition at line 1706 of file OgreTerrain.h.
String Ogre::Terrain::mResourceGroup [protected] |
Definition at line 1678 of file OgreTerrain.h.
SceneNode* Ogre::Terrain::mRootNode [protected] |
Definition at line 1677 of file OgreTerrain.h.
NameGenerator Ogre::Terrain::msBlendTextureGenerator [static, protected] |
Definition at line 1786 of file OgreTerrain.h.
Real Ogre::Terrain::mScale [protected] |
Relationship between one point on the terrain and world size.
Definition at line 1700 of file OgreTerrain.h.
SceneManager* Ogre::Terrain::mSceneMgr [protected] |
Definition at line 1676 of file OgreTerrain.h.
NameGenerator Ogre::Terrain::msCompositeMapNameGenerator [static, protected] |
Definition at line 1789 of file OgreTerrain.h.
uint16 Ogre::Terrain::mSize [protected] |
Definition at line 1689 of file OgreTerrain.h.
Real Ogre::Terrain::mSkirtSize [protected] |
Definition at line 1705 of file OgreTerrain.h.
NameGenerator Ogre::Terrain::msLightmapNameGenerator [static, protected] |
Definition at line 1788 of file OgreTerrain.h.
NameGenerator Ogre::Terrain::msNormalMapNameGenerator [static, protected] |
Definition at line 1787 of file OgreTerrain.h.
TexturePtr Ogre::Terrain::mTerrainNormalMap [protected] |
Texture storing normals for the whole terrrain.
Definition at line 1797 of file OgreTerrain.h.
uint16 Ogre::Terrain::mTreeDepth [protected] |
Definition at line 1696 of file OgreTerrain.h.
uint32 Ogre::Terrain::mVisibilityFlags [protected] |
Definition at line 1707 of file OgreTerrain.h.
uint16 Ogre::Terrain::mWorkQueueChannel [protected] |
Definition at line 1675 of file OgreTerrain.h.
Real Ogre::Terrain::mWorldSize [protected] |
Definition at line 1688 of file OgreTerrain.h.
const uint32 Ogre::Terrain::TERRAIN_CHUNK_ID [static] |
Definition at line 268 of file OgreTerrain.h.
const uint16 Ogre::Terrain::TERRAIN_CHUNK_VERSION [static] |
Definition at line 269 of file OgreTerrain.h.
const uint16 Ogre::Terrain::TERRAIN_MAX_BATCH_SIZE [static] |
Definition at line 270 of file OgreTerrain.h.
const uint32 Ogre::Terrain::TERRAINDERIVEDDATA_CHUNK_ID [static] |
Definition at line 280 of file OgreTerrain.h.
const uint16 Ogre::Terrain::TERRAINDERIVEDDATA_CHUNK_VERSION [static] |
Definition at line 281 of file OgreTerrain.h.
const uint32 Ogre::Terrain::TERRAINLAYERDECLARATION_CHUNK_ID [static] |
Definition at line 272 of file OgreTerrain.h.
const uint16 Ogre::Terrain::TERRAINLAYERDECLARATION_CHUNK_VERSION [static] |
Definition at line 273 of file OgreTerrain.h.
const uint32 Ogre::Terrain::TERRAINLAYERINSTANCE_CHUNK_ID [static] |
Definition at line 278 of file OgreTerrain.h.
const uint16 Ogre::Terrain::TERRAINLAYERINSTANCE_CHUNK_VERSION [static] |
Definition at line 279 of file OgreTerrain.h.
const uint32 Ogre::Terrain::TERRAINLAYERSAMPLER_CHUNK_ID [static] |
Definition at line 274 of file OgreTerrain.h.
const uint16 Ogre::Terrain::TERRAINLAYERSAMPLER_CHUNK_VERSION [static] |
Definition at line 275 of file OgreTerrain.h.
const uint32 Ogre::Terrain::TERRAINLAYERSAMPLERELEMENT_CHUNK_ID [static] |
Definition at line 276 of file OgreTerrain.h.
const uint16 Ogre::Terrain::TERRAINLAYERSAMPLERELEMENT_CHUNK_VERSION [static] |
Definition at line 277 of file OgreTerrain.h.
const uint16 Ogre::Terrain::WORKQUEUE_DERIVED_DATA_REQUEST [static] |
Definition at line 1515 of file OgreTerrain.h.
Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri May 25 23:42:00 2012