AtlasGeomChunk Class Reference [Atlas Resource System]

#include <atlasGeomChunk.h>

Inheritance diagram for AtlasGeomChunk:

Inheritance graph
[legend]
List of all members.

Detailed Description

Atlas chunk subclass for geometry.


Collision

We optionally store collision information for this chunk's geometry.

void generateCollision ()
 Helper function to update our collision structures for this chunk.
U32 mColTreeDepth
ColNodemColTree
 The linearized quadtree for our collision info.
Point3FmColGeom
U16mColIndices
U16mColIndicesOffsets
U16mColIndicesBuffer
U32 mColOffsetCount
U32 mColIndexCount

Static Statistics

We track some statistics about the file IO we are doing.

static void dumpIOStatistics ()
static U32 smIndexBytesWritten
static U32 smVertexBytesWritten
static U32 smCollisionBytesWritten
static U32 smTotalBytesWritten
static U32 smChunksWritten

Public Types

typedef AtlasChunk Parent

Public Member Functions

 AtlasGeomChunk ()
virtual ~AtlasGeomChunk ()
virtual void write (Stream *s)
 Serialize this chunk to a stream.
virtual void read (Stream *s)
 Deserialize from a stream.
void generate (AtlasChunk *children[4])
 Given four children, (re)generate the data for this one.
virtual U32 getHeadSentinel ()
virtual U32 getTailSentinel ()
virtual void process ()
 Once the chunk has been loaded (in another thread), this is called in the main thread to prepare any complex resources.
void render ()
void calculatePoints (const Point3F &camPos, Point3F &outNearPos, Point3F &outFarPos, Point2F &outNearTC, Point2F &outFarTC)
 Calculate some useful information about our near/far points, used primarily for clipmaps.
AtlasDiscreteMeshcopyToDiscreteMesh ()
 Copy ourselves out to a discrete mesh for processing.
void copyFromDiscreteMesh (AtlasDiscreteMesh *adm)
 Update ourselves from a discrete mesh.
AtlasGeomChunkgenerateCopy (S32 reformat=-1)
Box3F getBounds ()
bool buildCollisionInfo (const Box3F &box, Convex *c, AbstractPolyList *poly, AtlasInstance *object)
void registerConvex (const U16 offset, Convex *convex, AtlasInstance *object, const Box3F &queryBox)

Public Attributes

Convex mConvexList
Raw data
Raw data buffers, which are loaded directly from the file. They require no additional processing; once loaded they are OK to use.

U32 mSkirtSkipCount
 Number of indices used for rendering "fake" geometry - ie, skirts, which are present solely to help hide LOD changes.
U32 mIndexCount
U16mIndex
U32 mVertCount
GFXAtlasVert2 * mVert
Box3F mBounds
 Bounds of this chunk; duplicated in stub so we can get to it w/o paging.
RectF mTCBounds
 Bounding box for this chunk's TC's.
Resource Handles
These are only instated when process() is called.

GFXVertexBufferHandle< GFXAtlasVert2 > mVB
GFXPrimitiveBufferHandle mPB

Classes

struct  ColNode
 A quadtree of ColNodes lets us do a quick broad filter against collision queries and efficiently reduce the number of triangles we have to individually check. More...


Member Typedef Documentation


Constructor & Destructor Documentation

AtlasGeomChunk::AtlasGeomChunk (  ) 

virtual AtlasGeomChunk::~AtlasGeomChunk (  )  [virtual]


Member Function Documentation

void AtlasGeomChunk::generateCollision (  ) 

Helper function to update our collision structures for this chunk.

virtual void AtlasGeomChunk::write ( Stream s  )  [virtual]

Serialize this chunk to a stream.

See also:
You probably want to use prepareDeferredWrite()

Reimplemented from AtlasChunk.

virtual void AtlasGeomChunk::read ( Stream s  )  [virtual]

Deserialize from a stream.

See also:
You probably want to use readFromStream()

Reimplemented from AtlasChunk.

void AtlasGeomChunk::generate ( AtlasChunk children[4]  )  [virtual]

Given four children, (re)generate the data for this one.

Their order starts at topleft, clockwise, 0123.

Reimplemented from AtlasChunk.

virtual U32 AtlasGeomChunk::getHeadSentinel (  )  [virtual]

Reimplemented from AtlasChunk.

virtual U32 AtlasGeomChunk::getTailSentinel (  )  [virtual]

Reimplemented from AtlasChunk.

virtual void AtlasGeomChunk::process (  )  [virtual]

Once the chunk has been loaded (in another thread), this is called in the main thread to prepare any complex resources.

(For instance, a texture or VB, that depend on access to GFX to initialize.)

Reimplemented from AtlasChunk.

void AtlasGeomChunk::render (  ) 

void AtlasGeomChunk::calculatePoints ( const Point3F camPos,
Point3F outNearPos,
Point3F outFarPos,
Point2F outNearTC,
Point2F outFarTC 
)

Calculate some useful information about our near/far points, used primarily for clipmaps.

AtlasDiscreteMesh* AtlasGeomChunk::copyToDiscreteMesh (  ) 

Copy ourselves out to a discrete mesh for processing.

void AtlasGeomChunk::copyFromDiscreteMesh ( AtlasDiscreteMesh adm  ) 

Update ourselves from a discrete mesh.

AtlasGeomChunk* AtlasGeomChunk::generateCopy ( S32  reformat = -1  ) 

Box3F AtlasGeomChunk::getBounds (  ) 

bool AtlasGeomChunk::buildCollisionInfo ( const Box3F box,
Convex c,
AbstractPolyList poly,
AtlasInstance object 
)

void AtlasGeomChunk::registerConvex ( const U16  offset,
Convex convex,
AtlasInstance object,
const Box3F queryBox 
)

static void AtlasGeomChunk::dumpIOStatistics (  )  [static]


Member Data Documentation

Number of indices used for rendering "fake" geometry - ie, skirts, which are present solely to help hide LOD changes.

They should be discarded when generating new LOD levels and so forth.

"Fake" geometry always lives at the end of the index buffer.

Draw this much less to not draw skirts.

GFXAtlasVert2* AtlasGeomChunk::mVert

Bounds of this chunk; duplicated in stub so we can get to it w/o paging.

Bounding box for this chunk's TC's.

The linearized quadtree for our collision info.

If NULL, there isn't any collision info.