TSMesh Class Reference#include <tsMesh.h>
Inheritance diagram for TSMesh:
[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 Point3F * | getNormals (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) |
S32 * | 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 * | getSharedData8 (S32 parentMesh, S32 size, S8 **source, bool skip) |
| TSMesh () |
virtual | ~TSMesh () |
|
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 *) |
|
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) |
|
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) |
Box3F & | getBounds () |
Point3F & | getCenter () |
F32 | getRadius () |
virtual S32 | getNumPolys () |
U8 | encodeNormal (const Point3F &normal) |
const Point3F & | decodeNormal (U8 ncode) |
Static Public Member Functions |
static TSMesh * | assembleMesh (U32 meshType, bool skip) |
|
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< Point3F > | verts |
ToolVector< Point3F > | norms |
ToolVector< TSDrawPrimitive > | primitives |
ToolVector< U8 > | encodedNorms |
ToolVector< U16 > | indices |
ToolVector< U16 > | mergeIndices |
| the last so many verts merge with these verts to form the next detail level NOT IMPLEMENTED YET
|
Vector< UVList > | mUVs |
Point3F | billboardAxis |
| billboard data
|
|
Convex hulls are convex (no angles >= 180º) meshes used for collision |
Vector< Point3F > | planeNormals |
Vector< F32 > | planeConstants |
Vector< U32 > | planeMaterials |
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 |
|
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< Point3F > | smSaveVerts |
static Vector< Point3F > | smSaveNorms |
static Vector< Point2F > | smSaveTVerts |
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
- 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 |
) |
|
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::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::buildConvexHull |
( |
|
) |
[virtual] |
bool TSMesh::addToHull |
( |
U32 |
idx0, |
|
|
U32 |
idx1, |
|
|
U32 |
idx2 | |
|
) |
| | |
void TSMesh::computeBounds |
( |
|
) |
|
Box3F& TSMesh::getBounds |
( |
|
) |
[inline] |
Point3F& TSMesh::getCenter |
( |
|
) |
[inline] |
F32 TSMesh::getRadius |
( |
|
) |
[inline] |
virtual S32 TSMesh::getNumPolys |
( |
|
) |
[virtual] |
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] |
static TSMesh* TSMesh::assembleMesh |
( |
U32 |
meshType, |
|
|
bool |
skip | |
|
) |
| | [static] |
virtual void TSMesh::disassemble |
( |
|
) |
[virtual] |
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
index into shapes mesh list
the last so many verts merge with these verts to form the next detail level NOT IMPLEMENTED YET
on load...optionally convert primitives to other form
|