TSMesh Class Reference

#include <tsMesh.h>

Inheritance diagram for TSMesh:

Inheritance graph
[legend]
List of all members.

Material Methods

void setFade (F32 fade)
void clearFade ()
static void setMaterial (S32 matIndex, TSMaterialList *)
static void setOverrideFade (F32 fadeValue)
static F32 getOverrideFade ()

Lighting plug-in methods

static void registerLightPlugin (TSMeshLightPlugin *mlp)
static void unregisterLightPlugin (TSMeshLightPlugin *mlp)
static TSMeshLightPluginsmLightPlugin

Public Types

 StandardMeshType = 0
 types...
 SkinMeshType = 1
 DecalMeshType = 2
 SortedMeshType = 3
 NullMeshType = 4
 TypeMask = StandardMeshType|SkinMeshType|DecalMeshType|SortedMeshType|NullMeshType
 Billboard = BIT(31)
 flags (stored with meshType)...
 HasDetailTexture = BIT(30)
 BillboardZAxis = BIT(29)
 UseEncodedNormals = BIT(28)
 FlagMask = Billboard|BillboardZAxis|HasDetailTexture|UseEncodedNormals
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),
  FlagMask = Billboard|BillboardZAxis|HasDetailTexture|UseEncodedNormals
}

Public Member Functions

U32 getMeshType ()
void setFlags (U32 flag)
void clearFlags (U32 flag)
U32 getFlags (U32 flag=0xFFFFFFFF)
const Point3FgetNormals (S32 firstVert)
virtual void assemble (bool skip)
 persist methods...
virtual void disassemble ()
virtual GFXVertexBufferHandle<
GFXVertexPNTTB > & 
getVertexBuffer ()
void createVBIB ()
void createTangents ()
void findTangent (U32 index1, U32 index2, U32 index3, Point3F *tan0, Point3F *tan1)
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 vertex and 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 render ()
virtual void render (S32 frame, S32 matFrame, TSMaterialList *)
Collision Methods
virtual bool buildPolyList (S32 frame, AbstractPolyList *polyList, U32 &surfaceKey, TSMaterialList *materials)
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, TSMaterialList *materials)
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)
Scene state methods
static void setCamTrans (const MatrixF &trans)
static void setSceneState (SceneState *state)
static void setCubemap (GFXCubemap *cm)
static void setObject (SceneObject *obj)
static void setGlow (bool glow)
static void setRefract (bool refract)
static const MatrixFgetCamTrans ()

Public Attributes

S32 parentMesh
 index into shapes mesh list
S32 numFrames
S32 numMatFrames
S32 vertsPerFrame
FixedVector< Point3Fverts
FixedVector< Point3Fnorms
FixedVector< Point2Ftverts
FixedVector< TSDrawPrimitiveprimitives
FixedVector< U8encodedNorms
FixedVector< U16indices
Vector< Point3FinitialTangents
Vector< Point4Ftangents
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
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
static const F32 VISIBILITY_EPSILON
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< boolsmDataCopied
static const Point3F smU8ToNormalTable []

Protected Attributes

U32 meshType
Box3F mBounds
Point3F mCenter
F32 mRadius
F32 mVisibility
bool mDynamic
GFXVertexBufferHandle< GFXVertexPNTTB > mVB
GFXPrimitiveBufferHandle mPB

Static Protected Attributes

static F32 overrideFadeVal
static MatrixF smCamTrans
static SceneStatesmSceneState
static SceneObjectsmObject
static GFXCubemapsmCubemap
static bool smGlowPass
static bool smRefractPass

Friends

class TSShape

Member Enumeration Documentation

anonymous enum

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


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  ) 

virtual void TSMesh::render (  )  [virtual]

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

Reimplemented in TSSkinMesh, and TSSortedMesh.

static void TSMesh::setCamTrans ( const MatrixF trans  )  [inline, static]

static void TSMesh::setSceneState ( SceneState state  )  [inline, static]

static void TSMesh::setCubemap ( GFXCubemap cm  )  [inline, static]

static void TSMesh::setObject ( SceneObject obj  )  [inline, static]

static void TSMesh::setGlow ( bool  glow  )  [inline, static]

static void TSMesh::setRefract ( bool  refract  )  [inline, static]

static const MatrixF& TSMesh::getCamTrans (  )  [inline, static]

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

void TSMesh::setFade ( F32  fade  )  [inline]

void TSMesh::clearFade (  )  [inline]

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

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

static void TSMesh::registerLightPlugin ( TSMeshLightPlugin mlp  )  [static]

static void TSMesh::unregisterLightPlugin ( TSMeshLightPlugin mlp  )  [static]

virtual bool TSMesh::buildPolyList ( S32  frame,
AbstractPolyList polyList,
U32 surfaceKey,
TSMaterialList materials 
) [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,
TSMaterialList materials 
) [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]

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.

virtual GFXVertexBufferHandle<GFXVertexPNTTB>& TSMesh::getVertexBuffer (  )  [inline, virtual]

Reimplemented in TSSkinMesh.

void TSMesh::createVBIB (  ) 

void TSMesh::createTangents (  ) 

void TSMesh::findTangent ( U32  index1,
U32  index2,
U32  index3,
Point3F tan0,
Point3F tan1 
)

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 vertex and other info between meshes (and for skipping detail levels on load)

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


Friends And Related Function Documentation

friend class TSShape [friend]


Member Data Documentation

U32 TSMesh::meshType [protected]

Box3F TSMesh::mBounds [protected]

Point3F TSMesh::mCenter [protected]

F32 TSMesh::mRadius [protected]

F32 TSMesh::mVisibility [protected]

bool TSMesh::mDynamic [protected]

F32 TSMesh::overrideFadeVal [static, protected]

MatrixF TSMesh::smCamTrans [static, protected]

SceneState* TSMesh::smSceneState [static, protected]

SceneObject* TSMesh::smObject [static, protected]

GFXCubemap* TSMesh::smCubemap [static, protected]

bool TSMesh::smGlowPass [static, protected]

bool TSMesh::smRefractPass [static, protected]

GFXVertexBufferHandle<GFXVertexPNTTB> TSMesh::mVB [protected]

index into shapes mesh list

on load...optionally convert primitives to other form