torque Torque Game Engine Documentation
TGE Version 1.5.2

TSMesh Class Reference

#include <tsMesh.h>

Inheritance diagram for TSMesh:

Inheritance graph
[legend]

Public Types

enum  {
  StandardMeshType = 0,
  SkinMeshType = 1,
  DecalMeshType = 2,
  SortedMeshType = 3,
  NullMeshType = 4,
  TypeMask = StandardMeshType|SkinMeshType|DecalMeshType|SortedMeshType|NullMeshType,
  Billboard = BIT(31),
  HasDetailTexture = BIT(30),
  BillboardZAxis = BIT(29),
  UseEncodedNormals = BIT(28),
  HasLightTexture = BIT(27),
  FlagMask = Billboard|BillboardZAxis|HasDetailTexture|UseEncodedNormals|HasLightTexture
}
enum  UVType {
  tUnknown = 0,
  tDiffuse,
  tLightmap
}

Public Member Functions

U32 getMeshType ()
void setFlags (U32 flag)
void clearFlags (U32 flag)
U32 getFlags (U32 flag=0xFFFFFFFF)
const Point3FgetNormals (S32 firstVert)
bool getUVs (U32 type, ToolVector< Point2F > &uvs)
bool setUVs (U32 type, ToolVector< Point2F > uvs)
void saveMergeVerts ()
 called by shapeinstance in setStatics
void restoreMergeVerts ()
 called by shapeinstance in clearStatics
void saveMergeNormals ()
 called by mesh at start of render (decals don't bother)
void restoreMergeNormals ()
 called by mesh at end of render
virtual void assemble (bool skip)
 persist methods...
virtual void disassemble ()
void convertToTris (S16 *primitiveDataIn, S32 *primitiveMatIn, S16 *indicesIn, S32 numPrimIn, S32 &numPrimOut, S32 &numIndicesOut, S32 *primitivesOut, S16 *indicesOut)
 convert primitives on load...
void convertToSingleStrip (S16 *primitiveDataIn, S32 *primitiveMatIn, S16 *indicesIn, S32 numPrimIn, S32 &numPrimOut, S32 &numIndicesOut, S32 *primitivesOut, S16 *indicesOut)
void leaveAsMultipleStrips (S16 *primitiveDataIn, S32 *primitiveMatIn, S16 *indicesIn, S32 numPrimIn, S32 &numPrimOut, S32 &numIndicesOut, S32 *primitivesOut, S16 *indicesOut)
S32getSharedData32 (S32 parentMesh, S32 size, S32 **source, bool skip)
 methods used during assembly to share vertexand other info between meshes (and for skipping detail levels on load)
S8getSharedData8 (S32 parentMesh, S32 size, S8 **source, bool skip)
 TSMesh ()
virtual ~TSMesh ()
Render Methods
virtual void fillVB (S32 vb, S32 frame, S32 matFrame, TSMaterialList *materials)
virtual void morphVB (S32 vb, S32 morph, S32 frame, S32 matFrame, TSMaterialList *materials)
virtual void renderVB (S32 frame, S32 matFrame, TSMaterialList *materials)
virtual void render (S32 frame, S32 matFrame, TSMaterialList *)
virtual void renderShadow (S32 frame, const MatrixF &mat, S32 dim, U32 *bits, TSMaterialList *)
void renderEnvironmentMap (S32 frame, S32 matFrame, TSMaterialList *)
void renderDetailMap (S32 frame, S32 matFrame, TSMaterialList *)
void renderFog (S32 frame, TSMaterialList *materials)
void renderLightMap (S32 frame, S32 matFrame, TSMaterialList *)
Collision Methods
virtual bool buildPolyList (S32 frame, AbstractPolyList *polyList, U32 &surfaceKey)
virtual bool getFeatures (S32 frame, const MatrixF &, const VectorF &, ConvexFeature *, U32 &surfaceKey)
virtual void support (S32 frame, const Point3F &v, F32 *currMaxDP, Point3F *currSupport)
virtual bool castRay (S32 frame, const Point3F &start, const Point3F &end, RayInfo *rayInfo)
virtual bool buildConvexHull ()
 returns false if not convex (still builds planes)
bool addToHull (U32 idx0, U32 idx1, U32 idx2)
Bounding Methods
calculate and get bounding information

void computeBounds ()
virtual void computeBounds (MatrixF &transform, Box3F &bounds, S32 frame=0, Point3F *center=NULL, F32 *radius=NULL)
void computeBounds (Point3F *, S32 numVerts, MatrixF &transform, Box3F &bounds, Point3F *center, F32 *radius)
Box3FgetBounds ()
Point3FgetCenter ()
F32 getRadius ()
virtual S32 getNumPolys ()
U8 encodeNormal (const Point3F &normal)
const Point3FdecodeNormal (U8 ncode)

Static Public Member Functions

static TSMeshassembleMesh (U32 meshType, bool skip)
Material Methods
static void initMaterials ()
static void resetMaterials ()
static void initEnvironmentMapMaterials ()
static void resetEnvironmentMapMaterials ()
static void initDetailMapMaterials ()
static void resetDetailMapMaterials ()
static void initLightMapMaterials ()
static void resetLightMapMaterials ()
static void setMaterial (S32 matIndex, TSMaterialList *)
static void setFade (F32 fadeValue)
static void clearFade ()
static void setOverrideFade (F32 fadeValue)
static F32 getOverrideFade ()

Data Fields

S32 parentMesh
 index into shapes mesh list
S32 numFrames
S32 numMatFrames
S32 vertsPerFrame
ToolVector< Point3Fverts
ToolVector< Point3Fnorms
ToolVector< TSDrawPrimitiveprimitives
ToolVector< U8encodedNorms
ToolVector< U16indices
ToolVector< U16mergeIndices
 the last so many verts merge with these verts to form the next detail level NOT IMPLEMENTED YET
Vector< UVListmUVs
Point3F billboardAxis
 billboard data
Convex Hull Data
Convex hulls are convex (no angles >= 180º) meshes used for collision

Vector< Point3FplaneNormals
Vector< F32planeConstants
Vector< U32planeMaterials
S32 planesPerFrame
S32 vbOffset
U32 mergeBufferStart

Static Public Attributes

static bool smUseTriangles
 on load...optionally convert primitives to other form
static bool smUseOneStrip
static S32 smMinStripSize
static bool smUseEncodedNormals
Assembly Variables
variables used during assembly (for skipping mesh detail levels on load and for sharing verts between meshes)

static Vector< Point3F * > smVertsList
static Vector< Point3F * > smNormsList
static Vector< U8 * > smEncodedNormsList
static Vector< Point2F * > smTVertsList
static Vector< bool > smDataCopied
static Vector< Point3FsmSaveVerts
static Vector< Point3FsmSaveNorms
static Vector< Point2FsmSaveTVerts
static const Point3F smU8ToNormalTable []

Protected Attributes

U32 meshType
Box3F mBounds
Point3F mCenter
F32 mRadius

Static Protected Attributes

static F32 overrideFadeVal

Data Structures

struct  UVList

Member Enumeration Documentation

anonymous enum

Enumerator:
StandardMeshType  types...
SkinMeshType 
DecalMeshType 
SortedMeshType 
NullMeshType 
TypeMask 
Billboard  flags (stored with meshType)...
HasDetailTexture 
BillboardZAxis 
UseEncodedNormals 
HasLightTexture 
FlagMask 

Enumerator:
tUnknown 
tDiffuse 
tLightmap 


Constructor & Destructor Documentation

TSMesh::TSMesh (  )  [inline]

virtual TSMesh::~TSMesh (  )  [virtual]


Member Function Documentation

U32 TSMesh::getMeshType (  )  [inline]

void TSMesh::setFlags ( U32  flag  )  [inline]

void TSMesh::clearFlags ( U32  flag  )  [inline]

U32 TSMesh::getFlags ( U32  flag = 0xFFFFFFFF  )  [inline]

const Point3F* TSMesh::getNormals ( S32  firstVert  ) 

bool TSMesh::getUVs ( U32  type,
ToolVector< Point2F > &  uvs 
)

bool TSMesh::setUVs ( U32  type,
ToolVector< Point2F uvs 
)

virtual void TSMesh::fillVB ( S32  vb,
S32  frame,
S32  matFrame,
TSMaterialList materials 
) [virtual]

virtual void TSMesh::morphVB ( S32  vb,
S32  morph,
S32  frame,
S32  matFrame,
TSMaterialList materials 
) [virtual]

virtual void TSMesh::renderVB ( S32  frame,
S32  matFrame,
TSMaterialList materials 
) [virtual]

virtual void TSMesh::render ( S32  frame,
S32  matFrame,
TSMaterialList  
) [virtual]

Reimplemented in TSSkinMesh, and TSSortedMesh.

virtual void TSMesh::renderShadow ( S32  frame,
const MatrixF mat,
S32  dim,
U32 bits,
TSMaterialList  
) [virtual]

Reimplemented in TSSkinMesh.

void TSMesh::renderEnvironmentMap ( S32  frame,
S32  matFrame,
TSMaterialList  
)

void TSMesh::renderDetailMap ( S32  frame,
S32  matFrame,
TSMaterialList  
)

void TSMesh::renderFog ( S32  frame,
TSMaterialList materials 
)

void TSMesh::renderLightMap ( S32  frame,
S32  matFrame,
TSMaterialList  
)

static void TSMesh::initMaterials (  )  [static]

static void TSMesh::resetMaterials (  )  [static]

static void TSMesh::initEnvironmentMapMaterials (  )  [static]

static void TSMesh::resetEnvironmentMapMaterials (  )  [static]

static void TSMesh::initDetailMapMaterials (  )  [static]

static void TSMesh::resetDetailMapMaterials (  )  [static]

static void TSMesh::initLightMapMaterials (  )  [static]

static void TSMesh::resetLightMapMaterials (  )  [static]

static void TSMesh::setMaterial ( S32  matIndex,
TSMaterialList  
) [static]

static void TSMesh::setFade ( F32  fadeValue  )  [static]

static void TSMesh::clearFade (  )  [static]

static void TSMesh::setOverrideFade ( F32  fadeValue  )  [inline, static]

static F32 TSMesh::getOverrideFade (  )  [inline, static]

virtual bool TSMesh::buildPolyList ( S32  frame,
AbstractPolyList polyList,
U32 surfaceKey 
) [virtual]

Reimplemented in TSSkinMesh, and TSSortedMesh.

virtual bool TSMesh::getFeatures ( S32  frame,
const MatrixF ,
const VectorF ,
ConvexFeature ,
U32 surfaceKey 
) [virtual]

virtual void TSMesh::support ( S32  frame,
const Point3F v,
F32 currMaxDP,
Point3F currSupport 
) [virtual]

virtual bool TSMesh::castRay ( S32  frame,
const Point3F start,
const Point3F end,
RayInfo rayInfo 
) [virtual]

Reimplemented in TSSkinMesh, and TSSortedMesh.

virtual bool TSMesh::buildConvexHull (  )  [virtual]

returns false if not convex (still builds planes)

Reimplemented in TSSkinMesh, and TSSortedMesh.

bool TSMesh::addToHull ( U32  idx0,
U32  idx1,
U32  idx2 
)

void TSMesh::computeBounds (  ) 

virtual void TSMesh::computeBounds ( MatrixF transform,
Box3F bounds,
S32  frame = 0,
Point3F center = NULL,
F32 radius = NULL 
) [virtual]

Reimplemented in TSSkinMesh.

void TSMesh::computeBounds ( Point3F ,
S32  numVerts,
MatrixF transform,
Box3F bounds,
Point3F center,
F32 radius 
)

Box3F& TSMesh::getBounds (  )  [inline]

Point3F& TSMesh::getCenter (  )  [inline]

F32 TSMesh::getRadius (  )  [inline]

virtual S32 TSMesh::getNumPolys (  )  [virtual]

Reimplemented in TSSortedMesh.

U8 TSMesh::encodeNormal ( const Point3F normal  ) 

const Point3F & TSMesh::decodeNormal ( U8  ncode  )  [inline]

void TSMesh::saveMergeVerts (  ) 

called by shapeinstance in setStatics

void TSMesh::restoreMergeVerts (  ) 

called by shapeinstance in clearStatics

void TSMesh::saveMergeNormals (  ) 

called by mesh at start of render (decals don't bother)

void TSMesh::restoreMergeNormals (  ) 

called by mesh at end of render

virtual void TSMesh::assemble ( bool  skip  )  [virtual]

persist methods...

Reimplemented in TSSkinMesh, and TSSortedMesh.

static TSMesh* TSMesh::assembleMesh ( U32  meshType,
bool  skip 
) [static]

virtual void TSMesh::disassemble (  )  [virtual]

Reimplemented in TSSkinMesh, and TSSortedMesh.

void TSMesh::convertToTris ( S16 primitiveDataIn,
S32 primitiveMatIn,
S16 indicesIn,
S32  numPrimIn,
S32 numPrimOut,
S32 numIndicesOut,
S32 primitivesOut,
S16 indicesOut 
)

convert primitives on load...

void TSMesh::convertToSingleStrip ( S16 primitiveDataIn,
S32 primitiveMatIn,
S16 indicesIn,
S32  numPrimIn,
S32 numPrimOut,
S32 numIndicesOut,
S32 primitivesOut,
S16 indicesOut 
)

void TSMesh::leaveAsMultipleStrips ( S16 primitiveDataIn,
S32 primitiveMatIn,
S16 indicesIn,
S32  numPrimIn,
S32 numPrimOut,
S32 numIndicesOut,
S32 primitivesOut,
S16 indicesOut 
)

S32* TSMesh::getSharedData32 ( S32  parentMesh,
S32  size,
S32 **  source,
bool  skip 
)

methods used during assembly to share vertexand other info between meshes (and for skipping detail levels on load)

S8* TSMesh::getSharedData8 ( S32  parentMesh,
S32  size,
S8 **  source,
bool  skip 
)


Field Documentation

U32 TSMesh::meshType [protected]

Box3F TSMesh::mBounds [protected]

Point3F TSMesh::mCenter [protected]

F32 TSMesh::mRadius [protected]

F32 TSMesh::overrideFadeVal [static, protected]

index into shapes mesh list

the last so many verts merge with these verts to form the next detail level NOT IMPLEMENTED YET

bool TSMesh::smUseTriangles [static]

on load...optionally convert primitives to other form

bool TSMesh::smUseOneStrip [static]

Vector<bool> TSMesh::smDataCopied [static]




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen