Ogre::TerrainQuadTreeNode Class Reference
Components » Terrain

A node in a quad tree used to store a patch of terrain. More...

`#include <OgreTerrainQuadTreeNode.h>`

Inheritance diagram for Ogre::TerrainQuadTreeNode:
[legend]

## Classes

struct | LodLevel
class | Movable
| MovableObject implementation to provide the hook to the scene. More...
class | Rend
| Hook to the render queue. More...
struct | VertexDataRecord

## Public Types

typedef vector< LodLevel * >::type | LodLevelList

## Public Member Functions

| TerrainQuadTreeNode (Terrain *terrain, TerrainQuadTreeNode *parent, uint16 xoff, uint16 yoff, uint16 size, uint16 lod, uint16 depth, uint16 quadrant)
| Constructor. More...
virtual | ~TerrainQuadTreeNode ()
Renderable * | _getRenderable ()
| Returns the internal renderable object for this node. More...
void | assignVertexData (uint16 treeDepthStart, uint16 treeDepthEnd, uint16 resolution, uint sz)
| Assign vertex data to the tree, from a depth and at a given resolution. More...
bool | calculateCurrentLod (const Camera *cam, Real cFactor)
| Calculate appropriate LOD for this node and children. More...
void | finaliseDeltaValues (const Rect &rect)
| Promote the delta values calculated to the runtime ones (this must be called in the main thread). More...
const AxisAlignedBox & | getAABB () const
| Get the AABB (local coords) of this node. More...
uint16 | getBaseLod () const
| Get the base LOD level this node starts at (the highest LOD it handles) More...
Real | getBoundingRadius () const
| Get the bounding radius of this node. More...
TerrainQuadTreeNode * | getChild (unsigned short child) const
| Get child node. More...
int | getCurrentLod () const
| Get the current LOD index (only valid after calculateCurrentLod) More...
const Vector3 & | getLocalCentre () const
| Get the local centre of this node, relative to parent terrain centre. More...
uint16 | getLodCount () const
| Get the number of LOD levels this node can represent itself (only > 1 for leaf nodes) More...
const LodLevel * | getLodLevel (uint16 lod)
| Get the LodLevel information for a given lod. More...
float | getLodTransition () const
| Get the transition state between the current LOD and the next lower one (only valid after calculateCurrentLod) More...
Real | getMaxHeight () const
| Get the maximum height of the node. More...
Real | getMinHeight () const
| Get the minimum height of the node. More...
TerrainQuadTreeNode * | getParent () const
| Get parent node. More...
Terrain * | getTerrain () const
| Get ultimate parent terrain. More...
uint16 | getXOffset () const
| Get the horizontal offset into the main terrain data of this node. More...
uint16 | getYOffset () const
| Get the vertical offset into the main terrain data of this node. More...
bool | isLeaf () const
| Is this a leaf node (no children) More...
bool | isRenderedAtCurrentLod () const
| Returns whether this node is rendering itself at the current LOD level. More...
bool | isSelfOrChildRenderedAtCurrentLod () const
| Returns whether this node or its children are being rendered at the current LOD level. More...
void | load ()
| Load node and children (perform GPU tasks, will be render thread) More...
void | load (uint16 depthStart, uint16 depthEnd)
| Load node and children in a depth range (perform GPU tasks, will be render thread) More...
void | loadSelf ()
void | mergeIntoBounds (long x, long y, const Vector3 &pos)
| Merge a point (relative to terrain node) into the local bounds, and that of children if applicable. More...
void | notifyDelta (uint16 x, uint16 y, uint16 lod, Real delta)
| Notify the node (and children) of a height delta value. More...
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info More...
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new More...
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info More...
void * | operator new[] (size_t sz)
bool | pointIntersectsNode (long x, long y)
| Returns true if the given point is in the terrain area that this node references. More...
void | postDeltaCalculation (const Rect &rect)
| Notify the node (and children) that deltas have finished being calculated. More...
void | preDeltaCalculation (const Rect &rect)
| Notify the node (and children) that deltas are going to be calculated for a given range. More...
void | prepare ()
| Prepare node and children (perform CPU tasks, may be background thread) More...
void | prepare (StreamSerialiser &stream)
| Prepare node from a stream. More...
bool | rectContainsNode (const Rect &rect)
| Returns true if the given rectangle completely contains the terrain area that this node references. More...
bool | rectIntersectsNode (const Rect &rect)
| Returns true if the given rectangle overlaps the terrain area that this node references. More...
void | resetBounds (const Rect &rect)
| Reset the bounds of this node and all its children for the region given. More...
void | save (StreamSerialiser &stream)
| Save node to a stream. More...
void | setCurrentLod (int lod)
| Manually set the current LOD, intended for internal use only. More...
void | setLodTransition (float t)
| Manually set the current LOD transition state, intended for internal use only. More...
void | unload ()
| Unload node and children (perform GPU tasks, will be render thread) More...
void | unload (uint16 depthStart, uint16 depthEnd)
| Unload node and children in a depth range (perform GPU tasks, will be render thread) More...
void | unprepare ()
| Unprepare node and children (perform CPU tasks, may be background thread) More...
void | updateVertexData (bool positions, bool deltas, const Rect &rect, bool cpuData)
| Tell the node to update its vertex data for a given region. More...
void | useAncestorVertexData (TerrainQuadTreeNode *owner, uint16 treeDepthEnd, uint16 resolution)
| Tell a node that it should use an anscestor's vertex data. More...

## Static Public Attributes

static unsigned short | DELTA_BUFFER
| Buffer binding used for holding delta values. More...
static unsigned short | POSITION_BUFFER
| Buffer binding used for holding positions. More...

## Protected Member Functions

uint16 | calcSkirtVertexIndex (uint16 mainIndex, bool isCol)
void | createCpuVertexData ()
void | createGpuIndexData ()
void | createGpuVertexData ()
void | destroyCpuVertexData ()
void | destroyGpuIndexData ()
void | destroyGpuVertexData ()
bool | getCastsShadows (void) const
const LightList & | getLights (void) const
const MaterialPtr & | getMaterial (void) const
void | getRenderOperation (RenderOperation &op)
Real | getSquaredViewDepth (const Camera *cam) const
Technique * | getTechnique (void) const
const VertexDataRecord * | getVertexDataRecord () const
void | getWorldTransforms (Matrix4 *xform) const
void | populateIndexData (uint16 batchSize, IndexData *destData)
void | updateGpuVertexData ()
void | updateRenderQueue (RenderQueue *queue)
void | updateVertexBuffer (HardwareVertexBufferSharedPtr &posbuf, HardwareVertexBufferSharedPtr &deltabuf, const Rect &rect)
void | visitRenderables (Renderable::Visitor *visitor, bool debugRenderables=false)
void | writeDeltaVertex (bool compress, uint16 x, uint16 y, float delta, float deltaThresh, float **ppDelta)
void | writePosVertex (bool compress, uint16 x, uint16 y, float height, const Vector3 &pos, float uvScale, float **ppPos)

## Protected Attributes

AxisAlignedBox | mAABB
| Relative to terrain centre. More...
uint16 | mBaseLod
uint16 | mBoundaryX
uint16 | mBoundaryY
Real | mBoundingRadius
| Relative to mLocalCentre. More...
TerrainQuadTreeNode * | mChildren [4]
TerrainQuadTreeNode * | mChildWithMaxHeightDelta
| 0-1 transition to lower LOD More...
int | mCurrentLod
| Relative to mLocalCentre. More...
uint16 | mDepth
Vector3 | mLocalCentre
SceneNode * | mLocalNode
LodLevelList | mLodLevels
float | mLodTransition
unsigned short | mMaterialLodIndex
| -1 = none (do not render) More...
Movable * | mMovable
TerrainQuadTreeNode * | mNodeWithVertexData
uint16 | mOffsetX
uint16 | mOffsetY
TerrainQuadTreeNode * | mParent
uint16 | mQuadrant
Rend * | mRend
bool | mSelfOrChildRendered
uint16 | mSize
| The number of vertices at the original terrain resolution this node encompasses. More...
Terrain * | mTerrain
VertexDataRecord * | mVertexDataRecord

## Friends

class | Movable
class | Rend

## Detailed Description

A node in a quad tree used to store a patch of terrain.

Remarks
  Algorithm overview:

  Our goal is to perform traditional chunked LOD with geomorphing. But, instead of just dividing the terrain into tiles, we will divide them into a hierarchy of tiles, a quadtree, where any level of the quadtree can be a rendered tile (to the exclusion of its children). The idea is to collect together children into a larger batch with their siblings as LOD decreases, to improve performance.

  The minBatchSize and maxBatchSize parameters on Terrain a key to defining this behaviour. Both values are expressed in vertices down one axis. maxBatchSize determines the number of tiles on one side of the terrain, which is numTiles = (terrainSize-1) / (maxBatchSize-1). This in turn determines the depth of the quad tree, which is sqrt(numTiles). The minBatchSize determines the 'floor' of how low the number of vertices can go in a tile before it has to be grouped together with its siblings to drop any lower. We also do not group a tile with its siblings unless all of them are at this minimum batch size, rather than trying to group them when they all end up on the same 'middle' LOD; this is for several reasons; firstly, tiles hitting the same 'middle' LOD is less likely and more transient if they have different levels of 'roughness', and secondly since we're sharing a vertex / index pool between all tiles, only grouping at the min level means that the number of combinations of buffer sizes for any one tile is greatly simplified, making it easier to pool data. To be more specific, any tile / quadtree node can only have log2(maxBatchSize-1) - log2(minBatchSize-1) + 1 LOD levels (and if you set them to the same value, LOD can only change by going up/down the quadtree). The numbers of vertices / indices in each of these levels is constant for the same (relative) LOD index no matter where you are in the tree, therefore buffers can potentially be reused more easily.

Definition at line 85 of file OgreTerrainQuadTreeNode.h.

## Member Typedef Documentation

## LodLevelList

typedef vector<LodLevel*>::type Ogre::TerrainQuadTreeNode::LodLevelList

Definition at line 154 of file OgreTerrainQuadTreeNode.h.

## Constructor & Destructor Documentation

## TerrainQuadTreeNode()

Ogre::TerrainQuadTreeNode::TerrainQuadTreeNode | ( | Terrain * | terrain,
|  | TerrainQuadTreeNode * | parent,
|  | uint16 | xoff,
|  | uint16 | yoff,
|  | uint16 | size,
|  | uint16 | lod,
|  | uint16 | depth,
|  | uint16 | quadrant
| ) |  |

Constructor.

Parameters

  terrain | The ultimate parent terrain
  parent | Optional parent node (in which case xoff, yoff are 0 and size must be entire terrain)
  xoff,yoff | Offsets from the start of the terrain data in 2D
  size | The size of the node in vertices at the highest LOD
  lod | The base LOD level
  depth | The depth that this node is at in the tree (or convenience)
  quadrant | The index of the quadrant (0, 1, 2, 3)

## ~TerrainQuadTreeNode()

virtual Ogre::TerrainQuadTreeNode::~TerrainQuadTreeNode | ( |  | ) |

virtual

## Member Function Documentation

## _getRenderable()

Renderable* Ogre::TerrainQuadTreeNode::_getRenderable | ( |  | ) |

Returns the internal renderable object for this node.

## assignVertexData()

void Ogre::TerrainQuadTreeNode::assignVertexData | ( | uint16 | treeDepthStart,
|  | uint16 | treeDepthEnd,
|  | uint16 | resolution,
|  | uint | sz
| ) |  |

Assign vertex data to the tree, from a depth and at a given resolution.

Parameters

  treeDepthStart | The first depth of tree that should use this data, owns the data
  treeDepthEnd | The end of the depth that should use this data (exclusive)
  resolution | The resolution of the data to use (compared to full terrain)
  sz | The size of the data along one edge

## calcSkirtVertexIndex()

uint16 Ogre::TerrainQuadTreeNode::calcSkirtVertexIndex | ( | uint16 | mainIndex,
|  | bool | isCol
| ) |  |

protected

## calculateCurrentLod()

bool Ogre::TerrainQuadTreeNode::calculateCurrentLod | ( | const Camera * | cam,
|  | Real | cFactor
| ) |  |

Calculate appropriate LOD for this node and children.

Parameters

  cam | The camera to be used (this should already be the LOD camera)
  cFactor | The cFactor which incorporates the viewport size, max pixel error and lod bias

Returns
  true if this node or any of its children were selected for rendering

## createCpuVertexData()

void Ogre::TerrainQuadTreeNode::createCpuVertexData | ( |  | ) |

protected

## createGpuIndexData()

void Ogre::TerrainQuadTreeNode::createGpuIndexData | ( |  | ) |

protected

## createGpuVertexData()

void Ogre::TerrainQuadTreeNode::createGpuVertexData | ( |  | ) |

protected

## destroyCpuVertexData()

void Ogre::TerrainQuadTreeNode::destroyCpuVertexData | ( |  | ) |

protected

## destroyGpuIndexData()

void Ogre::TerrainQuadTreeNode::destroyGpuIndexData | ( |  | ) |

protected

## destroyGpuVertexData()

void Ogre::TerrainQuadTreeNode::destroyGpuVertexData | ( |  | ) |

protected

## finaliseDeltaValues()

void Ogre::TerrainQuadTreeNode::finaliseDeltaValues | ( | const Rect & | rect | ) |

Promote the delta values calculated to the runtime ones (this must be called in the main thread).

## getAABB()

const AxisAlignedBox& Ogre::TerrainQuadTreeNode::getAABB | ( |  | ) | const

Get the AABB (local coords) of this node.

## getBaseLod()

uint16 Ogre::TerrainQuadTreeNode::getBaseLod | ( |  | ) | const

Get the base LOD level this node starts at (the highest LOD it handles)

Definition at line 108 of file OgreTerrainQuadTreeNode.h.

## getBoundingRadius()

Real Ogre::TerrainQuadTreeNode::getBoundingRadius | ( |  | ) | const

Get the bounding radius of this node.

## getCastsShadows()

bool Ogre::TerrainQuadTreeNode::getCastsShadows | ( | void |  | ) | const

protected

## getChild()

TerrainQuadTreeNode* Ogre::TerrainQuadTreeNode::getChild | ( | unsigned short | child | ) | const

Get child node.

## getCurrentLod()

int Ogre::TerrainQuadTreeNode::getCurrentLod | ( |  | ) | const

Get the current LOD index (only valid after calculateCurrentLod)

Definition at line 248 of file OgreTerrainQuadTreeNode.h.

## getLights()

const LightList& Ogre::TerrainQuadTreeNode::getLights | ( | void |  | ) | const

protected

## getLocalCentre()

const Vector3& Ogre::TerrainQuadTreeNode::getLocalCentre | ( |  | ) | const

Get the local centre of this node, relative to parent terrain centre.

Definition at line 234 of file OgreTerrainQuadTreeNode.h.

## getLodCount()

uint16 Ogre::TerrainQuadTreeNode::getLodCount | ( |  | ) | const

Get the number of LOD levels this node can represent itself (only > 1 for leaf nodes)

## getLodLevel()

const LodLevel* Ogre::TerrainQuadTreeNode::getLodLevel | ( | uint16 | lod | ) |

Get the LodLevel information for a given lod.

Parameters

  lod | The lod level index relative to this classes own list; if you want to use a global lod level, subtract getBaseLod() first. Higher LOD levels are lower detail.

## getLodTransition()

float Ogre::TerrainQuadTreeNode::getLodTransition | ( |  | ) | const

Get the transition state between the current LOD and the next lower one (only valid after calculateCurrentLod)

Definition at line 256 of file OgreTerrainQuadTreeNode.h.

## getMaterial()

const MaterialPtr& Ogre::TerrainQuadTreeNode::getMaterial | ( | void |  | ) | const

protected

## getMaxHeight()

Real Ogre::TerrainQuadTreeNode::getMaxHeight | ( |  | ) | const

Get the maximum height of the node.

## getMinHeight()

Real Ogre::TerrainQuadTreeNode::getMinHeight | ( |  | ) | const

Get the minimum height of the node.

## getParent()

TerrainQuadTreeNode* Ogre::TerrainQuadTreeNode::getParent | ( |  | ) | const

Get parent node.

## getRenderOperation()

void Ogre::TerrainQuadTreeNode::getRenderOperation | ( | RenderOperation & | op | ) |

protected

## getSquaredViewDepth()

Real Ogre::TerrainQuadTreeNode::getSquaredViewDepth | ( | const Camera * | cam | ) | const

protected

## getTechnique()

Technique* Ogre::TerrainQuadTreeNode::getTechnique | ( | void |  | ) | const

protected

## getTerrain()

Terrain* Ogre::TerrainQuadTreeNode::getTerrain | ( |  | ) | const

Get ultimate parent terrain.

## getVertexDataRecord()

const VertexDataRecord* Ogre::TerrainQuadTreeNode::getVertexDataRecord | ( |  | ) | const

protected

## getWorldTransforms()

void Ogre::TerrainQuadTreeNode::getWorldTransforms | ( | Matrix4 * | xform | ) | const

protected

## getXOffset()

uint16 Ogre::TerrainQuadTreeNode::getXOffset | ( |  | ) | const

Get the horizontal offset into the main terrain data of this node.

Definition at line 102 of file OgreTerrainQuadTreeNode.h.

## getYOffset()

uint16 Ogre::TerrainQuadTreeNode::getYOffset | ( |  | ) | const

Get the vertical offset into the main terrain data of this node.

Definition at line 104 of file OgreTerrainQuadTreeNode.h.

## isLeaf()

bool Ogre::TerrainQuadTreeNode::isLeaf | ( |  | ) | const

Is this a leaf node (no children)

## isRenderedAtCurrentLod()

bool Ogre::TerrainQuadTreeNode::isRenderedAtCurrentLod | ( |  | ) | const

Returns whether this node is rendering itself at the current LOD level.

## isSelfOrChildRenderedAtCurrentLod()

bool Ogre::TerrainQuadTreeNode::isSelfOrChildRenderedAtCurrentLod | ( |  | ) | const

Returns whether this node or its children are being rendered at the current LOD level.

## load() [1/2]

void Ogre::TerrainQuadTreeNode::load | ( |  | ) |

Load node and children (perform GPU tasks, will be render thread)

## load() [2/2]

void Ogre::TerrainQuadTreeNode::load | ( | uint16 | depthStart,
|  | uint16 | depthEnd
| ) |  |

Load node and children in a depth range (perform GPU tasks, will be render thread)

## loadSelf()

void Ogre::TerrainQuadTreeNode::loadSelf | ( |  | ) |

## mergeIntoBounds()

void Ogre::TerrainQuadTreeNode::mergeIntoBounds | ( | long | x,
|  | long | y,
|  | const Vector3 & | pos
| ) |  |

Merge a point (relative to terrain node) into the local bounds, and that of children if applicable.

Parameters

  x,y | The point on the terrain to which this position corresponds (affects which nodes update their bounds)
  pos | The position relative to the terrain centre

## notifyDelta()

void Ogre::TerrainQuadTreeNode::notifyDelta | ( | uint16 | x,
|  | uint16 | y,
|  | uint16 | lod,
|  | Real | delta
| ) |  |

Notify the node (and children) of a height delta value.

## operator delete() [1/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) |

inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

## operator delete() [2/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  |

inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

## operator delete() [3/3]

template<class Alloc >

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

inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

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

template<class Alloc >

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

inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

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

template<class Alloc >

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

inherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

## operator new() [1/3]

template<class Alloc >

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

inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

## operator new() [2/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) |

inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

## operator new() [3/3]

template<class Alloc >

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

inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

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

template<class Alloc >

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

inherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

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

template<class Alloc >

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

inherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

## pointIntersectsNode()

bool Ogre::TerrainQuadTreeNode::pointIntersectsNode | ( | long | x,
|  | long | y
| ) |  |

Returns true if the given point is in the terrain area that this node references.

Parameters

  x,y | The point in top-level terrain coords

## populateIndexData()

void Ogre::TerrainQuadTreeNode::populateIndexData | ( | uint16 | batchSize,
|  | IndexData * | destData
| ) |  |

protected

## postDeltaCalculation()

void Ogre::TerrainQuadTreeNode::postDeltaCalculation | ( | const Rect & | rect | ) |

Notify the node (and children) that deltas have finished being calculated.

## preDeltaCalculation()

void Ogre::TerrainQuadTreeNode::preDeltaCalculation | ( | const Rect & | rect | ) |

Notify the node (and children) that deltas are going to be calculated for a given range.

Remarks
  Based on this call, we can know whether or not to reset the max height.

## prepare() [1/2]

void Ogre::TerrainQuadTreeNode::prepare | ( |  | ) |

Prepare node and children (perform CPU tasks, may be background thread)

## prepare() [2/2]

void Ogre::TerrainQuadTreeNode::prepare | ( | StreamSerialiser & | stream | ) |

Prepare node from a stream.

## rectContainsNode()

bool Ogre::TerrainQuadTreeNode::rectContainsNode | ( | const Rect & | rect | ) |

Returns true if the given rectangle completely contains the terrain area that this node references.

Parameters

  rect | The region in top-level terrain coords

## rectIntersectsNode()

bool Ogre::TerrainQuadTreeNode::rectIntersectsNode | ( | const Rect & | rect | ) |

Returns true if the given rectangle overlaps the terrain area that this node references.

Parameters

  rect | The region in top-level terrain coords

## resetBounds()

void Ogre::TerrainQuadTreeNode::resetBounds | ( | const Rect & | rect | ) |

Reset the bounds of this node and all its children for the region given.

Parameters

  rect | The region for which bounds should be reset, in top-level terrain coords

## save()

void Ogre::TerrainQuadTreeNode::save | ( | StreamSerialiser & | stream | ) |

Save node to a stream.

## setCurrentLod()

void Ogre::TerrainQuadTreeNode::setCurrentLod | ( | int | lod | ) |

Manually set the current LOD, intended for internal use only.

## setLodTransition()

void Ogre::TerrainQuadTreeNode::setLodTransition | ( | float | t | ) |

Manually set the current LOD transition state, intended for internal use only.

## unload() [1/2]

void Ogre::TerrainQuadTreeNode::unload | ( |  | ) |

Unload node and children (perform GPU tasks, will be render thread)

## unload() [2/2]

void Ogre::TerrainQuadTreeNode::unload | ( | uint16 | depthStart,
|  | uint16 | depthEnd
| ) |  |

Unload node and children in a depth range (perform GPU tasks, will be render thread)

## unprepare()

void Ogre::TerrainQuadTreeNode::unprepare | ( |  | ) |

Unprepare node and children (perform CPU tasks, may be background thread)

## updateGpuVertexData()

void Ogre::TerrainQuadTreeNode::updateGpuVertexData | ( |  | ) |

protected

## updateRenderQueue()

void Ogre::TerrainQuadTreeNode::updateRenderQueue | ( | RenderQueue * | queue | ) |

protected

## updateVertexBuffer()

void Ogre::TerrainQuadTreeNode::updateVertexBuffer | ( | HardwareVertexBufferSharedPtr & | posbuf,
|  | HardwareVertexBufferSharedPtr & | deltabuf,
|  | const Rect & | rect
| ) |  |

protected

## updateVertexData()

void Ogre::TerrainQuadTreeNode::updateVertexData | ( | bool | positions,
|  | bool | deltas,
|  | const Rect & | rect,
|  | bool | cpuData
| ) |  |

Tell the node to update its vertex data for a given region.

## useAncestorVertexData()

void Ogre::TerrainQuadTreeNode::useAncestorVertexData | ( | TerrainQuadTreeNode * | owner,
|  | uint16 | treeDepthEnd,
|  | uint16 | resolution
| ) |  |

Tell a node that it should use an anscestor's vertex data.

Parameters

  treeDepthEnd | The end of the depth that should use this data (exclusive)
  resolution | The resolution of the data to use

## visitRenderables()

void Ogre::TerrainQuadTreeNode::visitRenderables | ( | Renderable::Visitor * | visitor,
|  | bool | debugRenderables = `false`
| ) |  |

protected

## writeDeltaVertex()

void Ogre::TerrainQuadTreeNode::writeDeltaVertex | ( | bool | compress,
|  | uint16 | x,
|  | uint16 | y,
|  | float | delta,
|  | float | deltaThresh,
|  | float ** | ppDelta
| ) |  |

protected

## writePosVertex()

void Ogre::TerrainQuadTreeNode::writePosVertex | ( | bool | compress,
|  | uint16 | x,
|  | uint16 | y,
|  | float | height,
|  | const Vector3 & | pos,
|  | float | uvScale,
|  | float ** | ppPos
| ) |  |

protected

## Friends And Related Function Documentation

## Movable

friend class Movable

friend

Definition at line 356 of file OgreTerrainQuadTreeNode.h.

## Rend

friend class Rend

friend

Definition at line 378 of file OgreTerrainQuadTreeNode.h.

## Member Data Documentation

## DELTA_BUFFER

unsigned short Ogre::TerrainQuadTreeNode::DELTA_BUFFER

static

Buffer binding used for holding delta values.

Definition at line 263 of file OgreTerrainQuadTreeNode.h.

## mAABB

AxisAlignedBox Ogre::TerrainQuadTreeNode::mAABB

protected

Relative to terrain centre.

Definition at line 281 of file OgreTerrainQuadTreeNode.h.

## mBaseLod

uint16 Ogre::TerrainQuadTreeNode::mBaseLod

protected

Definition at line 277 of file OgreTerrainQuadTreeNode.h.

## mBoundaryX

uint16 Ogre::TerrainQuadTreeNode::mBoundaryX

protected

Definition at line 274 of file OgreTerrainQuadTreeNode.h.

## mBoundaryY

uint16 Ogre::TerrainQuadTreeNode::mBoundaryY

protected

Definition at line 274 of file OgreTerrainQuadTreeNode.h.

## mBoundingRadius

Real Ogre::TerrainQuadTreeNode::mBoundingRadius

protected

Relative to mLocalCentre.

Definition at line 282 of file OgreTerrainQuadTreeNode.h.

## mChildren

TerrainQuadTreeNode* Ogre::TerrainQuadTreeNode::mChildren[4]

protected

Definition at line 270 of file OgreTerrainQuadTreeNode.h.

## mChildWithMaxHeightDelta

TerrainQuadTreeNode* Ogre::TerrainQuadTreeNode::mChildWithMaxHeightDelta

protected

0-1 transition to lower LOD

The child with the largest height delta

Definition at line 287 of file OgreTerrainQuadTreeNode.h.

## mCurrentLod

int Ogre::TerrainQuadTreeNode::mCurrentLod

protected

Relative to mLocalCentre.

Definition at line 283 of file OgreTerrainQuadTreeNode.h.

## mDepth

uint16 Ogre::TerrainQuadTreeNode::mDepth

protected

Definition at line 278 of file OgreTerrainQuadTreeNode.h.

## mLocalCentre

Vector3 Ogre::TerrainQuadTreeNode::mLocalCentre

protected

Definition at line 280 of file OgreTerrainQuadTreeNode.h.

## mLocalNode

SceneNode* Ogre::TerrainQuadTreeNode::mLocalNode

protected

Definition at line 357 of file OgreTerrainQuadTreeNode.h.

## mLodLevels

LodLevelList Ogre::TerrainQuadTreeNode::mLodLevels

protected

Definition at line 271 of file OgreTerrainQuadTreeNode.h.

## mLodTransition

float Ogre::TerrainQuadTreeNode::mLodTransition

protected

Definition at line 285 of file OgreTerrainQuadTreeNode.h.

## mMaterialLodIndex

unsigned short Ogre::TerrainQuadTreeNode::mMaterialLodIndex

protected

-1 = none (do not render)

Definition at line 284 of file OgreTerrainQuadTreeNode.h.

## mMovable

Movable* Ogre::TerrainQuadTreeNode::mMovable

protected

Definition at line 355 of file OgreTerrainQuadTreeNode.h.

## mNodeWithVertexData

TerrainQuadTreeNode* Ogre::TerrainQuadTreeNode::mNodeWithVertexData

protected

Definition at line 313 of file OgreTerrainQuadTreeNode.h.

## mOffsetX

uint16 Ogre::TerrainQuadTreeNode::mOffsetX

protected

Definition at line 273 of file OgreTerrainQuadTreeNode.h.

## mOffsetY

uint16 Ogre::TerrainQuadTreeNode::mOffsetY

protected

Definition at line 273 of file OgreTerrainQuadTreeNode.h.

## mParent

TerrainQuadTreeNode* Ogre::TerrainQuadTreeNode::mParent

protected

Definition at line 269 of file OgreTerrainQuadTreeNode.h.

## mQuadrant

uint16 Ogre::TerrainQuadTreeNode::mQuadrant

protected

Definition at line 279 of file OgreTerrainQuadTreeNode.h.

## mRend

Rend* Ogre::TerrainQuadTreeNode::mRend

protected

Definition at line 377 of file OgreTerrainQuadTreeNode.h.

## mSelfOrChildRendered

bool Ogre::TerrainQuadTreeNode::mSelfOrChildRendered

protected

Definition at line 288 of file OgreTerrainQuadTreeNode.h.

## mSize

uint16 Ogre::TerrainQuadTreeNode::mSize

protected

The number of vertices at the original terrain resolution this node encompasses.

Definition at line 276 of file OgreTerrainQuadTreeNode.h.

## mTerrain

Terrain* Ogre::TerrainQuadTreeNode::mTerrain

protected

Definition at line 268 of file OgreTerrainQuadTreeNode.h.

## mVertexDataRecord

VertexDataRecord* Ogre::TerrainQuadTreeNode::mVertexDataRecord

protected

Definition at line 314 of file OgreTerrainQuadTreeNode.h.

## POSITION_BUFFER

unsigned short Ogre::TerrainQuadTreeNode::POSITION_BUFFER

static

Buffer binding used for holding positions.

Definition at line 261 of file OgreTerrainQuadTreeNode.h.

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

- OgreTerrainQuadTreeNode.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.