TSShape Class Reference#include <tsShape.h>
Inheritance diagram for TSShape:
[legend]
Detailed Description
TSShape stores generic data for a 3space model.
TSShape and TSShapeInstance act in conjunction to allow the rendering and manipulation of a three dimensional model.
- Note:
- The material lists are the only thing that is not loaded in TSShape. instead, they are loaded in TSShapeInstance because of a former restriction on the resource manager where only one file could be opened at a time. The resource manager restriction has been resolved, but the material lists are still loaded in TSShapeInstance.
- See also:
- TSShapeInstance for a further discussion of the 3space system.
|
Persist Helper Functions |
static TSShapeAlloc | alloc |
void | fixEndian (S32 *, S16 *, S8 *, S32, S32, S32) |
Public Types |
enum | {
UniformScale = BIT(0),
AlignedScale = BIT(1),
ArbitraryScale = BIT(2),
Blend = BIT(3),
Cyclic = BIT(4),
MakePath = BIT(5),
IflInit = BIT(6),
HasTranslucency = BIT(7),
AnyScale = UniformScale | AlignedScale | ArbitraryScale
} |
Public Member Functions |
| TSShape () |
| ~TSShape () |
void | init () |
void | initMaterialList () |
| you can swap in a new material list, but call this if you do
|
bool | preloadMaterialList () |
| called to preload and validate the materials in the mat list
|
void | clearDynamicData () |
void | setupBillboardDetails (TSShapeInstance *) |
bool | getSequencesConstructed () const |
void | setSequencesConstructed (const bool c) |
void | computeAccelerator (S32 dl) |
| build LOS collision detail
|
bool | buildConvexHull (S32 dl) const |
void | computeBounds (S32 dl, Box3F &bounds) const |
bool | checkSkip (S32 meshNum, S32 &curObject, S32 &curDecal, S32 skipDL) |
| mem buffer transfer helper (indicate when we don't want to include a particular mesh/decal)
|
void | rearrangeKeyframeData (Sequence &, S32 keyframeStart, U8 *pns32=NULL, U8 *pns16=NULL, U8 *pos=NULL, U8 *pds=NULL, S32 szNS32=-1, S32 szNS16=-1, S32 szOS32=-1, S32 szDS32=-1) |
| used when reading old shapes/sequences
|
void | rearrangeStates (S32 start, S32 rows, S32 cols, U8 *data, S32 size) |
void | fixupOldSkins (S32 numMeshes, S32 numSkins, S32 numDetails, S32 *detailFirstSkin, S32 *detailNumSkins) |
|
For speeding up buildpolylist and support calls.
|
ConvexHullAccelerator * | getAccelerator (S32 dl) |
|
indexed by keyframe number and offset (which objecct/node/decal of the animated objects/nodes/decals you want information for).
|
QuatF & | getRotation (const Sequence &seq, S32 keyframeNum, S32 rotNum, QuatF *) const |
const Point3F & | getTranslation (const Sequence &seq, S32 keyframeNum, S32 tranNum) const |
F32 | getUniformScale (const Sequence &seq, S32 keyframeNum, S32 scaleNum) const |
const Point3F & | getAlignedScale (const Sequence &seq, S32 keyframeNum, S32 scaleNum) const |
TSScale & | getArbitraryScale (const Sequence &seq, S32 keyframeNum, S32 scaleNum, TSScale *) const |
const ObjectState & | getObjectState (const Sequence &seq, S32 keyframeNum, S32 objectNum) const |
const DecalState & | getDecalState (const Sequence &seq, S32 keyframeNum, S32 decalNum) const |
|
S32 | findName (const char *) const |
const char * | getName (S32) const |
S32 | findNode (S32 nameIndex) const |
S32 | findNode (const char *name) const |
S32 | findObject (S32 nameIndex) const |
S32 | findObject (const char *name) const |
S32 | findDecal (S32 nameIndex) const |
S32 | findDecal (const char *name) const |
S32 | findIflMaterial (S32 nameIndex) const |
S32 | findIflMaterial (const char *name) const |
S32 | findDetail (S32 nameIndex) const |
S32 | findDetail (const char *name) const |
S32 | findSequence (S32 nameIndex) const |
S32 | findSequence (const char *name) const |
bool | hasTranslucency () const |
|
Methods for saving/loading shapes to/from streams
|
void | write (Stream *) |
bool | read (Stream *) |
void | readOldShape (Stream *s, S32 *&, S16 *&, S8 *&, S32 &, S32 &, S32 &) |
void | writeName (Stream *, S32 nameIndex) |
S32 | readName (Stream *, bool addName) |
void | exportSequences (Stream *) |
bool | importSequences (Stream *) |
void | readIflMaterials (const char *shapePath) |
|
uses TSShape::Alloc structure
|
void | assembleShape () |
void | disassembleShape () |
Data Fields |
S8 * | mMemoryBlock |
| Memory block for data storage.
|
TSMaterialList * | materialList |
U32 | mExporterVersion |
F32 | mSmallestVisibleSize |
| Computed at load time from details vector.
|
S32 | mSmallestVisibleDL |
| - See also:
- mSmallestVisibleSize
|
S32 | mReadVersion |
| File version that this shape was read from.
|
U32 | mFlags |
| hasTranslucancy, iflInit
|
U32 | data |
| User-defined data storage.
|
bool | mSequencesConstructed |
S32 | mVertexBuffer |
U32 | mCallbackKey |
bool | mExportMerge |
bool | mMorphable |
Vector< S32 > | mPreviousMerge |
S32 | mMergeBufferSize |
|
ToolVector< Node > | nodes |
ToolVector< Object > | objects |
ToolVector< Decal > | decals |
ToolVector< IflMaterial > | iflMaterials |
ToolVector< ObjectState > | objectStates |
ToolVector< DecalState > | decalStates |
ToolVector< S32 > | subShapeFirstNode |
ToolVector< S32 > | subShapeFirstObject |
ToolVector< S32 > | subShapeFirstDecal |
ToolVector< S32 > | detailFirstSkin |
ToolVector< S32 > | subShapeNumNodes |
ToolVector< S32 > | subShapeNumObjects |
ToolVector< S32 > | subShapeNumDecals |
ToolVector< Detail > | details |
ToolVector< Quat16 > | defaultRotations |
ToolVector< Point3F > | defaultTranslations |
|
ToolVector< S32 > | subShapeFirstTranslucentObject |
| These are set up at load time, but memory is allocated along with loaded data.
|
ToolVector< TSMesh * > | meshes |
|
these vectors describe how to transition between detail levels using alpha.
"alpha-in" next detail as intraDL goes from alphaIn+alphaOut to alphaOut. "alpha-out" current detail level as intraDL goes from alphaOut to 0. - Note:
- intraDL is at 1 when if shape were any closer to us we'd be at dl-1
- intraDL is at 0 when if shape were any farther away we'd be at dl+1
|
ToolVector< F32 > | alphaIn |
ToolVector< F32 > | alphaOut |
|
Vector< Sequence > | sequences |
Vector< Quat16 > | nodeRotations |
Vector< Point3F > | nodeTranslations |
Vector< F32 > | nodeUniformScales |
Vector< Point3F > | nodeAlignedScales |
Vector< Quat16 > | nodeArbitraryScaleRots |
Vector< Point3F > | nodeArbitraryScaleFactors |
Vector< Quat16 > | groundRotations |
Vector< Point3F > | groundTranslations |
Vector< Trigger > | triggers |
Vector< F32 > | iflFrameOffTimes |
Vector< TSLastDetail * > | billboardDetails |
Vector< ConvexHullAccelerator * > | detailCollisionAccelerators |
Vector< const char * > | names |
|
F32 | radius |
F32 | tubeRadius |
Point3F | center |
Box3F | bounds |
Static Public Attributes |
static S32 | smNumSkipLoadDetails |
| don't load this many of the highest detail levels (although we always load one renderable detail if there is one)
|
static bool | smInitOnRead |
| by default we initialize shape when we read...
|
|
These control default values for alpha transitions between detail levels
|
static F32 | smAlphaOutLastDetail |
static F32 | smAlphaInBillboard |
static F32 | smAlphaOutBillboard |
static F32 | smAlphaInDefault |
static F32 | smAlphaOutDefault |
|
static S32 | smVersion |
| Most recent version...the one we write.
|
static S32 | smReadVersion |
| Version currently being read, only valid during read.
|
static const U32 | smMostRecentExporterVersion |
Data Structures |
struct | ConvexHullAccelerator |
struct | Decal |
| Decals hang off objects like objects hang off nodes. More...
|
struct | DecalState |
| Describes state of a decal. More...
|
struct | Detail |
| Details are used for render detail selection. More...
|
struct | IflMaterial |
| IFL Materials are used to animate material lists -- i.e., run through a series of frames of a material. More...
|
struct | Node |
| Nodes hold the transforms in the shape's tree. They are the bones of the skeleton. More...
|
struct | Object |
| Objects hold renderable items (in particular meshes). More...
|
struct | ObjectState |
| Describes state of an individual object. More...
|
struct | Sequence |
| A Sequence holds all the information necessary to perform a particular animation (sequence). More...
|
struct | Trigger |
| When time on a sequence advances past a certain point, a trigger takes effect and changes one of the state variables to on or off. More...
|
Member Enumeration Documentation
- Enumerator:
-
UniformScale |
|
AlignedScale |
|
ArbitraryScale |
|
Blend |
|
Cyclic |
|
MakePath |
|
IflInit |
|
HasTranslucency |
|
AnyScale |
|
Constructor & Destructor Documentation
Member Function Documentation
void TSShape::initMaterialList |
( |
|
) |
|
you can swap in a new material list, but call this if you do
bool TSShape::preloadMaterialList |
( |
|
) |
|
called to preload and validate the materials in the mat list
void TSShape::clearDynamicData |
( |
|
) |
|
bool TSShape::getSequencesConstructed |
( |
|
) |
const [inline] |
void TSShape::setSequencesConstructed |
( |
const bool |
c |
) |
[inline] |
const Point3F & TSShape::getTranslation |
( |
const Sequence & |
seq, |
|
|
S32 |
keyframeNum, |
|
|
S32 |
tranNum | |
|
) |
| | const [inline] |
F32 TSShape::getUniformScale |
( |
const Sequence & |
seq, |
|
|
S32 |
keyframeNum, |
|
|
S32 |
scaleNum | |
|
) |
| | const [inline] |
const Point3F & TSShape::getAlignedScale |
( |
const Sequence & |
seq, |
|
|
S32 |
keyframeNum, |
|
|
S32 |
scaleNum | |
|
) |
| | const [inline] |
void TSShape::computeAccelerator |
( |
S32 |
dl |
) |
|
build LOS collision detail
bool TSShape::buildConvexHull |
( |
S32 |
dl |
) |
const |
void TSShape::computeBounds |
( |
S32 |
dl, |
|
|
Box3F & |
bounds | |
|
) |
| | const |
S32 TSShape::findName |
( |
const char * |
|
) |
const |
const char* TSShape::getName |
( |
S32 |
|
) |
const |
S32 TSShape::findNode |
( |
S32 |
nameIndex |
) |
const |
S32 TSShape::findNode |
( |
const char * |
name |
) |
const [inline] |
S32 TSShape::findObject |
( |
S32 |
nameIndex |
) |
const |
S32 TSShape::findObject |
( |
const char * |
name |
) |
const [inline] |
S32 TSShape::findDecal |
( |
S32 |
nameIndex |
) |
const |
S32 TSShape::findDecal |
( |
const char * |
name |
) |
const [inline] |
S32 TSShape::findIflMaterial |
( |
S32 |
nameIndex |
) |
const |
S32 TSShape::findIflMaterial |
( |
const char * |
name |
) |
const [inline] |
S32 TSShape::findDetail |
( |
S32 |
nameIndex |
) |
const |
S32 TSShape::findDetail |
( |
const char * |
name |
) |
const [inline] |
S32 TSShape::findSequence |
( |
S32 |
nameIndex |
) |
const |
S32 TSShape::findSequence |
( |
const char * |
name |
) |
const [inline] |
bool TSShape::hasTranslucency |
( |
|
) |
const [inline] |
bool TSShape::read |
( |
Stream * |
|
) |
|
S32 TSShape::readName |
( |
Stream * |
, |
|
|
bool |
addName | |
|
) |
| | |
bool TSShape::importSequences |
( |
Stream * |
|
) |
|
void TSShape::readIflMaterials |
( |
const char * |
shapePath |
) |
|
void TSShape::assembleShape |
( |
|
) |
|
void TSShape::disassembleShape |
( |
|
) |
|
bool TSShape::checkSkip |
( |
S32 |
meshNum, |
|
|
S32 & |
curObject, |
|
|
S32 & |
curDecal, |
|
|
S32 |
skipDL | |
|
) |
| | |
mem buffer transfer helper (indicate when we don't want to include a particular mesh/decal)
used when reading old shapes/sequences
void TSShape::fixupOldSkins |
( |
S32 |
numMeshes, |
|
|
S32 |
numSkins, |
|
|
S32 |
numDetails, |
|
|
S32 * |
detailFirstSkin, |
|
|
S32 * |
detailNumSkins | |
|
) |
| | |
Field Documentation
These are set up at load time, but memory is allocated along with loaded data.
Memory block for data storage.
Most vectors are stored in a single memory block except when compiled using TORQUE_LIB defined.
in that case, ToolVector becomes Vector<> and the vectors are resizeable
Computed at load time from details vector.
File version that this shape was read from.
User-defined data storage.
don't load this many of the highest detail levels (although we always load one renderable detail if there is one)
by default we initialize shape when we read...
Most recent version...the one we write.
Version currently being read, only valid during read.
|