29 #ifndef __Ogre_TerrainQuadTreeNode_H__
30 #define __Ogre_TerrainQuadTreeNode_H__
42 class HardwareVertexBufferSharedPtr;
110 uint16 getLodCount()
const;
146 LodLevel() : gpuIndexData(0), maxHeightDelta(0), calcMaxHeightDelta(0),
147 lastTransitionDist(0), lastCFactor(0) {}
162 void preDeltaCalculation(
const Rect& rect);
169 void postDeltaCalculation(
const Rect& rect);
174 void finaliseDeltaValues(
const Rect& rect);
192 void updateVertexData(
bool positions,
bool deltas,
const Rect& rect,
bool cpuData);
202 void mergeIntoBounds(
long x,
long y,
const Vector3& pos);
206 void resetBounds(
const Rect& rect);
212 bool rectIntersectsNode(
const Rect& rect);
217 bool rectContainsNode(
const Rect& rect);
222 bool pointIntersectsNode(
long x,
long y);
227 Real getBoundingRadius()
const;
231 Real getMinHeight()
const;
233 Real getMaxHeight()
const;
240 bool calculateCurrentLod(
const Camera* cam,
Real cFactor);
245 bool isRenderedAtCurrentLod()
const;
247 bool isSelfOrChildRenderedAtCurrentLod()
const;
249 void setCurrentLod(
int lod);
253 void setLodTransition(
float t);
302 : cpuVertexData(0), gpuVertexData(0), resolution(res), size(sz),
303 treeLevels(lvls), gpuVertexDataDirty(false) {}
337 const String& getMovableType(
void)
const;
339 Real getBoundingRadius(
void)
const;
342 bool isVisible(
void)
const;
343 uint32 getVisibilityFlags(
void)
const;
344 uint32 getQueryFlags(
void)
const;
345 bool getCastShadows(
void)
const;
364 void getWorldTransforms(
Matrix4* xform)
const;
365 Real getSquaredViewDepth(
const Camera* cam)
const;
367 bool getCastsShadows(
void)
const;
380 void getWorldTransforms(
Matrix4* xform)
const;
381 Real getSquaredViewDepth(
const Camera* cam)
const;
383 bool getCastsShadows(
void)
const;
387 void createCpuVertexData();
392 void destroyCpuVertexData();
394 void createGpuVertexData();
395 void destroyGpuVertexData();
396 void updateGpuVertexData();
397 void createGpuIndexData();
398 void destroyGpuIndexData();
402 uint16 calcSkirtVertexIndex(
uint16 mainIndex,
bool isCol);
A viewpoint from which the scene will be rendered.
TerrainQuadTreeNode * mParent
Class encapsulating a standard 4x4 homogeneous matrix.
uint16 batchSize
Number of vertices rendered down one side (not including skirts)
float Real
Software floating point type.
VertexData * gpuVertexData
uint16 getXOffset() const
Get the horizontal offset into the main terrain data of this node.
The main containing class for a chunk of terrain.
IndexData * gpuIndexData
Index data on the gpu.
VertexDataRecord * mVertexDataRecord
uint16 skirtRowColSkip
The number of rows / cols to skip in between skirts.
Real calcMaxHeightDelta
Temp calc area for max height delta.
uint16 treeLevels
Number of quadtree levels (including this one) this data applies to.
Shared pointer implementation used to share index buffers.
A 3D box aligned with the x/y/z axes.
vector< LodLevel * >::type LodLevelList
Class representing an approach to rendering this particular Material.
Abstract class defining a movable object in a scene.
Class representing a node in the scene graph.
#define _OgreTerrainExport
Abstract class defining the interface all renderable objects must implement.
TerrainQuadTreeNode * mParent
Hook to the render queue.
uint16 resolution
resolution of the data compared to the base terrain data (NOT number of vertices!) ...
Real maxHeightDelta
Maximum delta height between this and the next lower lod.
unsigned short mMaterialLodIndex
uint16 getBaseLod() const
Get the base LOD level this node starts at (the highest LOD it handles)
static unsigned short DELTA_BUFFER
Buffer binding used for holding delta values.
int getCurrentLod() const
Get the current LOD index (only valid after calculateCurrentLod)
TerrainQuadTreeNode * mParent
float getLodTransition() const
Get the transition state between the current LOD and the next lower one (only valid after calculateCu...
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Summary class collecting together index data source information.
VertexDataRecord(uint16 res, uint16 sz, uint16 lvls)
TerrainQuadTreeNode * mChildWithMaxHeightDelta
The child with the largest height delta.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly...
static unsigned short POSITION_BUFFER
Buffer binding used for holding positions.
uint16 getYOffset() const
Get the vertical offset into the main terrain data of this node.
Utility class providing helper methods for reading / writing structured data held in a DataStream...
Standard 3-dimensional vector.
uint16 size
size of the data along one edge
Real lastCFactor
The cFactor value used to calculate transitionDist.
uint16 numSkirtRowsCols
Number of rows and columns of skirts.
Summary class collecting together vertex source information.
'New' rendering operation using vertex buffers.
VertexData * cpuVertexData
Real lastTransitionDist
The most recently calculated transition distance.
Class to manage the scene object rendering queue.
const Vector3 & getLocalCentre() const
Get the local centre of this node, relative to parent terrain centre.
MovableObject implementation to provide the hook to the scene.
bool gpuVertexDataDirty
Is the GPU vertex data out of date?
TerrainQuadTreeNode * mNodeWithVertexData
Specialisation of SharedPtr to allow SharedPtr to be assigned to MaterialPtr.
A node in a quad tree used to store a patch of terrain.
bool mSelfOrChildRendered
uint16 mSize
the number of vertices at the original terrain resolution this node encompasses