Go to the documentation of this file.
29 #ifndef __Ogre_TerrainQuadTreeNode_H__
30 #define __Ogre_TerrainQuadTreeNode_H__
42 class HardwareVertexBufferSharedPtr;
110 uint16 getLodCount()
const;
151 LodLevel() : batchSize(0), gpuIndexData(0), maxHeightDelta(0), calcMaxHeightDelta(0),
152 lastTransitionDist(0), lastCFactor(0) {}
167 void preDeltaCalculation(
const Rect& rect);
174 void postDeltaCalculation(
const Rect& rect);
179 void finaliseDeltaValues(
const Rect& rect);
197 void updateVertexData(
bool positions,
bool deltas,
const Rect& rect,
bool cpuData);
207 void mergeIntoBounds(
long x,
long y,
const Vector3& pos);
211 void resetBounds(
const Rect& rect);
217 bool rectIntersectsNode(
const Rect& rect);
222 bool rectContainsNode(
const Rect& rect);
227 bool pointIntersectsNode(
long x,
long y);
232 Real getBoundingRadius()
const;
236 Real getMinHeight()
const;
238 Real getMaxHeight()
const;
245 bool calculateCurrentLod(
const Camera* cam,
Real cFactor);
250 bool isRenderedAtCurrentLod()
const;
252 bool isSelfOrChildRenderedAtCurrentLod()
const;
254 void setCurrentLod(
int lod);
258 void setLodTransition(
float t);
308 : cpuVertexData(0), gpuVertexData(0), resolution(res), size(sz),
309 treeLevels(lvls), numSkirtRowsCols(0),
310 skirtRowColSkip(0), gpuVertexDataDirty(false) {}
344 const String& getMovableType(
void)
const;
346 Real getBoundingRadius(
void)
const;
349 bool isVisible(
void)
const;
350 uint32 getVisibilityFlags(
void)
const;
351 uint32 getQueryFlags(
void)
const;
352 bool getCastShadows(
void)
const;
371 void getWorldTransforms(
Matrix4* xform)
const;
372 Real getSquaredViewDepth(
const Camera* cam)
const;
374 bool getCastsShadows(
void)
const;
387 void getWorldTransforms(
Matrix4* xform)
const;
388 Real getSquaredViewDepth(
const Camera* cam)
const;
390 bool getCastsShadows(
void)
const;
394 void createCpuVertexData();
399 void destroyCpuVertexData();
401 void createGpuVertexData();
402 void destroyGpuVertexData();
403 void updateGpuVertexData();
404 void createGpuIndexData();
405 void destroyGpuIndexData();
408 void writePosVertex(
bool compress,
uint16 x,
uint16 y,
float height,
const Vector3& pos,
float uvScale,
float** ppPos);
409 void writeDeltaVertex(
bool compress,
uint16 x,
uint16 y,
float delta,
float deltaThresh,
float** ppDelta);
411 uint16 calcSkirtVertexIndex(
uint16 mainIndex,
bool isCol);
VertexData * cpuVertexData
uint16 getXOffset() const
Get the horizontal offset into the main terrain data of this node.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Real calcMaxHeightDelta
Temp calc area for max height delta.
A viewpoint from which the scene will be rendered.
VertexDataRecord * mVertexDataRecord
uint16 skirtRowColSkip
The number of rows / cols to skip in between skirts.
IndexData * gpuIndexData
Index data on the gpu.
TerrainQuadTreeNode * mParent
#define _OgreTerrainExport
int mCurrentLod
Relative to mLocalCentre.
uint16 batchSize
Number of vertices rendered down one side (not including skirts)
uint16 getBaseLod() const
Get the base LOD level this node starts at (the highest LOD it handles)
int getCurrentLod() const
Get the current LOD index (only valid after calculateCurrentLod)
The main containing class for a chunk of terrain.
Abstract class defining a movable object in a scene.
unsigned short mMaterialLodIndex
-1 = none (do not render)
VertexDataRecord(uint16 res, uint16 sz, uint16 lvls)
Class representing an approach to rendering this particular Material.
Real lastCFactor
The cFactor value used to calculate transitionDist.
Class representing a node in the scene graph.
A node in a quad tree used to store a patch of terrain.
bool mSelfOrChildRendered
Summary class collecting together vertex source information.
Class encapsulating a standard 4x4 homogeneous matrix.
Real maxHeightDelta
Maximum delta height between this and the next lower lod.
TerrainQuadTreeNode * mNodeWithVertexData
Shared pointer implementation used to share vertex buffers.
TerrainQuadTreeNode * mParent
uint16 numSkirtRowsCols
Number of rows and columns of skirts.
uint16 treeLevels
Number of quadtree levels (including this one) this data applies to.
A 3D box aligned with the x/y/z axes.
AxisAlignedBox mAABB
Relative to terrain centre.
uint16 getYOffset() const
Get the vertical offset into the main terrain data of this node.
Real lastTransitionDist
The most recently calculated transition distance.
MovableObject implementation to provide the hook to the scene.
Utility class providing helper methods for reading / writing structured data held in a DataStream.
const Vector3 & getLocalCentre() const
Get the local centre of this node, relative to parent terrain centre.
uint16 size
Size of the data along one edge.
Hook to the render queue.
vector< LodLevel * >::type LodLevelList
bool gpuVertexDataDirty
Is the GPU vertex data out of date?
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
uint16 resolution
Resolution of the data compared to the base terrain data (NOT number of vertices!)
static unsigned short DELTA_BUFFER
Buffer binding used for holding delta values.
Abstract class defining the interface all renderable objects must implement.
float Real
Software floating point type.
TerrainQuadTreeNode * mParent
VertexData * gpuVertexData
Summary class collecting together index data source information.
Real mBoundingRadius
Relative to mLocalCentre.
Standard 3-dimensional vector.
'New' rendering operation using vertex buffers.
Class to manage the scene object rendering queue.
static unsigned short POSITION_BUFFER
Buffer binding used for holding positions.
float getLodTransition() const
Get the transition state between the current LOD and the next lower one (only valid after calculateCu...
uint16 mSize
The number of vertices at the original terrain resolution this node encompasses.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15