TerrCell

Engine/source/terrain/terrCell.h

The TerrCell is a single quadrant of the terrain geometry quadtree.

More...

Public User Defined

Debug Rendering.

Protected Attributes

The bounding box of this cell in TerrainBlock object space.

The child cells of this one.

A list of all empty vertices for this cell.

bool

Indicates if this cell has any empty squares.

bool

Whether this cell is fully contained inside interior zones.

The level of this cell within the quadtree (of cells) where zero is the root and one is a direct child of the root, etc.

The material used to render the cell.

This bit flag tells us which materials effect this cell and is used for optimizing rendering.

The OBB of this cell in world space.

The handle to the static primitive buffer for this cell.

The bounding radius of this cell.

The terrain this cell is based on.

Triangle count for our own primitive buffer, if any.

GFXVertexBufferHandle< TerrVertex >

The handle to the static vertex buffer which holds the vertices for this cell.

The zone overlap for this cell.

Protected Static Attributes

Protected Functions

Public Functions

cullCells(const SceneRenderState * state, const Point3F & objLodPos, Vector< TerrCell * > * outCells)

Deletes the materials for this cell and all its children.

Returns the object space sphere bounds.

Returns a bit vector of what zones overlap this cell.

bool

Return true if this is a leaf cell, i.e. a cell without children.

Forces the loading of the materials for this cell and all its child cells.

updateGrid(const RectI & gridRect, bool opacityOnly)

Update the world-space OBBs used for culling.

Public Static Functions

Initializes a primitive buffer for rendering any cell.

init(TerrainBlock * terrain)

Detailed Description

The TerrCell is a single quadrant of the terrain geometry quadtree.

Public User Defined

renderBounds()

Debug Rendering.

Renders the debug bounds for this cell.

Protected Attributes

Box3F mBounds 

The bounding box of this cell in TerrainBlock object space.

TerrCell * mChildren [4]

The child cells of this one.

Vector< U32 > mEmptyVertexList 

A list of all empty vertices for this cell.

bool mHasEmpty 

Indicates if this cell has any empty squares.

bool mIsInteriorOnly 

Whether this cell is fully contained inside interior zones.

U32 mLevel 

The level of this cell within the quadtree (of cells) where zero is the root and one is a direct child of the root, etc.

TerrainCellMaterial * mMaterial 

The material used to render the cell.

U64 mMaterials 

This bit flag tells us which materials effect this cell and is used for optimizing rendering.

see:

TerrainFile::mMaterialAlphaMap

OrientedBox3F mOBB 

The OBB of this cell in world space.

Point2I mPoint 
GFXPrimitiveBufferHandle mPrimBuffer 

The handle to the static primitive buffer for this cell.

It is only used if this cell has any empty squares

F32 mRadius 

The bounding radius of this cell.

U32 mSize 
TerrainBlock * mTerrain 

The terrain this cell is based on.

U32 mTriCount 

Triangle count for our own primitive buffer, if any.

GFXVertexBufferHandle< TerrVertex > mVertexBuffer 

The handle to the static vertex buffer which holds the vertices for this cell.

BitVector mZoneOverlap 

The zone overlap for this cell.

note:

The bit for the outdoor zone is never set.

Point3F * zode_vertexBuffer 

Protected Static Attributes

const U32 smMinCellSize 
const U32 smPBSize 
const U32 smTriCount 
const U32 smVBSize 
const U32 smVBStride 

Statics used in VB and PB generation.

Protected Functions

_init(TerrainBlock * terrain, const Point2I & point, U32 size, U32 level)

_isVertIndexEmpty(U32 index)

_updateBounds()

_updateMaterials()

_updateOBB()

Update mOBB from the current terrain transform state.

_updatePrimitiveBuffer()

_updateVertexBuffer()

createZodiacVertexBuffer()

Public Functions

TerrCell()

~TerrCell()

cullCells(const SceneRenderState * state, const Point3F & objLodPos, Vector< TerrCell * > * outCells)

deleteMaterials()

Deletes the materials for this cell and all its children.

They will be recreate on the next request.

deleteZodiacVertexBuffer()

getBounds()

getDistanceTo(const Point3F & pt)

getMaterial()

getMaterials()

getPoint()

getRenderPrimitive(GFXPrimitive * prim, GFXVertexBufferHandleBase * vertBuff, GFXPrimitiveBufferHandle * primBuff)

getSize()

getSphereBounds()

Returns the object space sphere bounds.

getSqDistanceTo(const Point3F & pt)

getZodiacVertexBuffer()

getZoneOverlap()

Returns a bit vector of what zones overlap this cell.

isLeaf()

Return true if this is a leaf cell, i.e. a cell without children.

preloadMaterials()

Forces the loading of the materials for this cell and all its child cells.

updateGrid(const RectI & gridRect, bool opacityOnly)

updateOBBs()

Update the world-space OBBs used for culling.

updateZoning(const SceneZoneSpaceManager * zoneManager)

Public Static Functions

createPrimBuffer(GFXPrimitiveBufferHandle * primBuffer)

Initializes a primitive buffer for rendering any cell.

createZodiacPrimBuffer(U16 ** primBuffer)

init(TerrainBlock * terrain)