torque Torque Game Engine Documentation
TGE Version 1.5.2

TSShape Class Reference

#include <tsShape.h>

Inheritance diagram for TSShape:

Inheritance graph
[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)
Collision Accelerators
For speeding up buildpolylist and support calls.

ConvexHullAcceleratorgetAccelerator (S32 dl)
Lookup Animation Info
indexed by keyframe number and offset (which objecct/node/decal of the animated objects/nodes/decals you want information for).

QuatFgetRotation (const Sequence &seq, S32 keyframeNum, S32 rotNum, QuatF *) const
const Point3FgetTranslation (const Sequence &seq, S32 keyframeNum, S32 tranNum) const
F32 getUniformScale (const Sequence &seq, S32 keyframeNum, S32 scaleNum) const
const Point3FgetAlignedScale (const Sequence &seq, S32 keyframeNum, S32 scaleNum) const
TSScalegetArbitraryScale (const Sequence &seq, S32 keyframeNum, S32 scaleNum, TSScale *) const
const ObjectStategetObjectState (const Sequence &seq, S32 keyframeNum, S32 objectNum) const
const DecalStategetDecalState (const Sequence &seq, S32 keyframeNum, S32 decalNum) const
Lookup Methods
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
Persist Methods
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)
Memory Buffer Transfer Methods
uses TSShape::Alloc structure

void assembleShape ()
void disassembleShape ()

Data Fields

S8mMemoryBlock
 Memory block for data storage.
TSMaterialListmaterialList
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< S32mPreviousMerge
S32 mMergeBufferSize
Shape Vector Data
ToolVector< Nodenodes
ToolVector< Objectobjects
ToolVector< Decaldecals
ToolVector< IflMaterialiflMaterials
ToolVector< ObjectStateobjectStates
ToolVector< DecalStatedecalStates
ToolVector< S32subShapeFirstNode
ToolVector< S32subShapeFirstObject
ToolVector< S32subShapeFirstDecal
ToolVector< S32detailFirstSkin
ToolVector< S32subShapeNumNodes
ToolVector< S32subShapeNumObjects
ToolVector< S32subShapeNumDecals
ToolVector< Detaildetails
ToolVector< Quat16defaultRotations
ToolVector< Point3FdefaultTranslations
ToolVector< S32subShapeFirstTranslucentObject
 These are set up at load time, but memory is allocated along with loaded data.
ToolVector< TSMesh * > meshes
Alpha Vectors
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< F32alphaIn
ToolVector< F32alphaOut
Resizeable vectors
Vector< Sequencesequences
Vector< Quat16nodeRotations
Vector< Point3FnodeTranslations
Vector< F32nodeUniformScales
Vector< Point3FnodeAlignedScales
Vector< Quat16nodeArbitraryScaleRots
Vector< Point3FnodeArbitraryScaleFactors
Vector< Quat16groundRotations
Vector< Point3FgroundTranslations
Vector< Triggertriggers
Vector< F32iflFrameOffTimes
Vector< TSLastDetail * > billboardDetails
Vector< ConvexHullAccelerator * > detailCollisionAccelerators
Vector< const char * > names
Bounding
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...
Alpha Transitions
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
Version Info
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

anonymous enum

Enumerator:
UniformScale 
AlignedScale 
ArbitraryScale 
Blend 
Cyclic 
MakePath 
IflInit 
HasTranslucency 
AnyScale 


Constructor & Destructor Documentation

TSShape::TSShape (  ) 

TSShape::~TSShape (  ) 


Member Function Documentation

ConvexHullAccelerator* TSShape::getAccelerator ( S32  dl  ) 

void TSShape::init (  ) 

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 (  ) 

void TSShape::setupBillboardDetails ( TSShapeInstance  ) 

bool TSShape::getSequencesConstructed (  )  const [inline]

void TSShape::setSequencesConstructed ( const bool  c  )  [inline]

QuatF & TSShape::getRotation ( const Sequence seq,
S32  keyframeNum,
S32  rotNum,
QuatF  
) const [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]

TSScale & TSShape::getArbitraryScale ( const Sequence seq,
S32  keyframeNum,
S32  scaleNum,
TSScale  
) const [inline]

const TSShape::ObjectState & TSShape::getObjectState ( const Sequence seq,
S32  keyframeNum,
S32  objectNum 
) const [inline]

const TSShape::DecalState & TSShape::getDecalState ( const Sequence seq,
S32  keyframeNum,
S32  decalNum 
) 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]

void TSShape::write ( Stream  ) 

bool TSShape::read ( Stream  ) 

void TSShape::readOldShape ( Stream s,
S32 *&  ,
S16 *&  ,
S8 *&  ,
S32 ,
S32 ,
S32  
)

void TSShape::writeName ( Stream ,
S32  nameIndex 
)

S32 TSShape::readName ( Stream ,
bool  addName 
)

void TSShape::exportSequences ( Stream  ) 

bool TSShape::importSequences ( Stream  ) 

void TSShape::readIflMaterials ( const char *  shapePath  ) 

void TSShape::fixEndian ( S32 ,
S16 ,
S8 ,
S32  ,
S32  ,
S32   
)

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)

void TSShape::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 TSShape::rearrangeStates ( S32  start,
S32  rows,
S32  cols,
U8 data,
S32  size 
)

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.

Vector<const char *> TSShape::names

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.

hasTranslucancy, iflInit

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)

bool TSShape::smInitOnRead [static]

by default we initialize shape when we read...

Most recent version...the one we write.

Version currently being read, only valid during read.




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