AtlasOldMesher Class Reference [Old Atlas Editor Code]

#include <atlasOldMesher.h>

List of all members.


Detailed Description

Helper class for generating and outputting chunk geometry for an Atlas terrain.


Public Types

typedef U16 VertIndex
typedef Vector< VertIndexVertHashBin
 Hash table for vertex lookups.

Public Member Functions

 AtlasOldMesher (AtlasOldActivationHeightfield *hf, S8 level)
 Create an Atlas chunk mesh helper instance.
 ~AtlasOldMesher ()
U32 getTriCount ()
void emitTri (VertIndex a, VertIndex b, VertIndex c)
void emitTri (Point2I a, Point2I b, Point2I c)
VertIndex getVertIndex (Point2I pos)
 Return an index for the given vertex on the heightfield.
VertIndex addSpecialVert (Point2I pos, S16 z)
 Emit a special vertex; these are generally used for skirts.
void updateBounds ()
void optimize ()
void writeVertex (Stream *s, Vert *vert, const S8 level)
void writeCollision (Stream *s)
void write (Stream *s, const S8 level, bool writeCollision)

Public Attributes

S16 mMinZ
S16 mMaxZ
Vector< VertHashBinmVertHash
Vector< VertIndexmSpecialVerts

Protected Types

 HashBinCount = 19
enum  { HashBinCount = 19 }

Protected Member Functions

Point3F getVertPos (const Vert &v)

Static Protected Member Functions

static const U32 generatePointHash (const Point2I &pos)

Protected Attributes

Box3F mBounds
 Bounds of this mesh.
Vector< VertmVerts
 The vertices of this mesh.
Vector< VertIndexmIndices
 The indices of this mesh.
Point3F mCompressionFactor
 Compression information, so we can write fixed point integers out.
AtlasOldActivationHeightfieldmHeight
 Pointer to the heightfield we're generating mesh data for.
S8 mLevel

Classes

struct  Vert
 Represents a vertex in our mesh. More...


Member Typedef Documentation

Hash table for vertex lookups.


Member Enumeration Documentation

anonymous enum [protected]

Enumerator:
HashBinCount 


Constructor & Destructor Documentation

AtlasOldMesher::AtlasOldMesher ( AtlasOldActivationHeightfield hf,
S8  level 
)

Create an Atlas chunk mesh helper instance.

Parameters:
hf Heightfield we're generating data for, used to get heights of vertices and calculate morph info, etc.
level Level we're generating for. Necessary so we know how much to morph.

AtlasOldMesher::~AtlasOldMesher (  ) 


Member Function Documentation

static const U32 AtlasOldMesher::generatePointHash ( const Point2I pos  )  [inline, static, protected]

Point3F AtlasOldMesher::getVertPos ( const Vert v  )  [protected]

U32 AtlasOldMesher::getTriCount (  )  [inline]

void AtlasOldMesher::emitTri ( VertIndex  a,
VertIndex  b,
VertIndex  c 
) [inline]

void AtlasOldMesher::emitTri ( Point2I  a,
Point2I  b,
Point2I  c 
) [inline]

VertIndex AtlasOldMesher::getVertIndex ( Point2I  pos  ) 

Return an index for the given vertex on the heightfield.

This will emit the vertex if necessary, or recycle it if it already exists.

VertIndex AtlasOldMesher::addSpecialVert ( Point2I  pos,
S16  z 
)

Emit a special vertex; these are generally used for skirts.

void AtlasOldMesher::updateBounds (  ) 

void AtlasOldMesher::optimize (  ) 

void AtlasOldMesher::writeVertex ( Stream s,
Vert vert,
const S8  level 
)

void AtlasOldMesher::writeCollision ( Stream s  ) 

void AtlasOldMesher::write ( Stream s,
const S8  level,
bool  writeCollision 
)


Member Data Documentation

Bounds of this mesh.

The vertices of this mesh.

The indices of this mesh.

We store a trilist and cook into a tristrip.

Note:
We're l33t like that.

Actually, this isn't true atm. We just store a trilist. Tristrip comes later in the milestone path.

Compression information, so we can write fixed point integers out.

Pointer to the heightfield we're generating mesh data for.