torque Torque Game Engine Documentation
TGE Version 1.5.2

TSPartInstance Class Reference

#include <tsPartInstance.h>


Public Member Functions

 TSPartInstance (TSShapeInstance *source)
 TSPartInstance (TSShapeInstance *source, S32 objectIndex)
 ~TSPartInstance ()
const TSShapegetShape ()
TSShapeInstancegetSourceShapeInstance ()
Point3FgetCenter ()
Box3FgetBounds ()
F32getRadius ()
void render (const Point3F *objectScale=NULL)
void render (S32 dl, const Point3F *objectScale=NULL)
void setDetailData (F32 *sizeCutoffs, S32 numDetails)
 choose detail method -- pass in NULL for first parameter to just use shapes data
Detail Selection
void selectCurrentDetail (bool ignoreScale=false)
void selectCurrentDetail (F32 pixelSize)
void selectCurrentDetail2 (F32 adjustedDist)
Detail Information Accessors
F32 getDetailSize (S32 dl)
S32 getPolyCount (S32 dl)
S32 getNumDetails ()
S32 getCurrentObjectDetail ()
void setCurrentObjectDetail (S32 od)
F32 getCurrentIntraDetail ()
void setCurrentIntraDetail (F32 intra)

Static Public Member Functions

static void breakShape (TSShapeInstance *, S32 subShape, Vector< TSPartInstance * > &partList, F32 *probShatter, F32 *probBreak, S32 probDepth)

Data Fields

voidmData
 for use by app

Private Member Functions

void addObject (S32 objectIndex)
void updateBounds ()
void renderDetailMap (S32 od)
void renderEnvironmentMap (S32 od)
void renderFog (S32 od)
void renderLightMap (S32 od)
void init (TSShapeInstance *)
Private Detail Selection Methods
void selectCurrentDetail (F32 *sizeCutoffs, S32 numDetails, bool ignoreScale)
void selectCurrentDetail (F32 pixelSize, F32 *sizeCutoffs, S32 numDetails)
void computePolyCount ()

Static Private Member Functions

static void breakShape (TSShapeInstance *, TSPartInstance *, S32 currentNode, Vector< TSPartInstance * > &partList, F32 *probShatter, F32 *probBreak, S32 probDepth)

Private Attributes

TSShapeInstancemSourceShape
 TSPartInstance assumes ownership (or shared ownership) of the source shape.
F32mSizeCutoffs
 detail selection uses the table pointed to by this member
S32mPolyCount
S32 mNumDetails
Vector< TSShapeInstance::MeshObjectInstance * > mMeshObjects
Vector< TSShapeInstance::DecalObjectInstance * > mDecalObjects
Bounding info
Box3F mBounds
Point3F mCenter
F32 mRadius
Detail Levels
detail levels on part instance correspond directly to object details on objects -- this is different from shape instances where dl corresponds to a subtree number and object detail.

The reason for this is that partinstances are derived from a single subtree of a shape instance, so the subtree is implied (implied by which objects are in the part instance)...

S32 mCurrentObjectDetail
F32 mCurrentIntraDL

Static Private Attributes

static MRandomR250 smRandom


Constructor & Destructor Documentation

TSPartInstance::TSPartInstance ( TSShapeInstance source  ) 

TSPartInstance::TSPartInstance ( TSShapeInstance source,
S32  objectIndex 
)

TSPartInstance::~TSPartInstance (  ) 


Member Function Documentation

void TSPartInstance::addObject ( S32  objectIndex  )  [private]

void TSPartInstance::updateBounds (  )  [private]

void TSPartInstance::renderDetailMap ( S32  od  )  [private]

void TSPartInstance::renderEnvironmentMap ( S32  od  )  [private]

void TSPartInstance::renderFog ( S32  od  )  [private]

void TSPartInstance::renderLightMap ( S32  od  )  [private]

void TSPartInstance::init ( TSShapeInstance  )  [private]

static void TSPartInstance::breakShape ( TSShapeInstance ,
TSPartInstance ,
S32  currentNode,
Vector< TSPartInstance * > &  partList,
F32 probShatter,
F32 probBreak,
S32  probDepth 
) [static, private]

void TSPartInstance::selectCurrentDetail ( F32 sizeCutoffs,
S32  numDetails,
bool  ignoreScale 
) [private]

void TSPartInstance::selectCurrentDetail ( F32  pixelSize,
F32 sizeCutoffs,
S32  numDetails 
) [private]

void TSPartInstance::computePolyCount (  )  [private]

const TSShape* TSPartInstance::getShape (  )  [inline]

TSShapeInstance* TSPartInstance::getSourceShapeInstance (  )  [inline]

static void TSPartInstance::breakShape ( TSShapeInstance ,
S32  subShape,
Vector< TSPartInstance * > &  partList,
F32 probShatter,
F32 probBreak,
S32  probDepth 
) [static]

Point3F& TSPartInstance::getCenter (  )  [inline]

Box3F& TSPartInstance::getBounds (  )  [inline]

F32& TSPartInstance::getRadius (  )  [inline]

void TSPartInstance::render ( const Point3F objectScale = NULL  )  [inline]

void TSPartInstance::render ( S32  dl,
const Point3F objectScale = NULL 
)

void TSPartInstance::setDetailData ( F32 sizeCutoffs,
S32  numDetails 
)

choose detail method -- pass in NULL for first parameter to just use shapes data

void TSPartInstance::selectCurrentDetail ( bool  ignoreScale = false  ) 

void TSPartInstance::selectCurrentDetail ( F32  pixelSize  ) 

void TSPartInstance::selectCurrentDetail2 ( F32  adjustedDist  ) 

F32 TSPartInstance::getDetailSize ( S32  dl  ) 

S32 TSPartInstance::getPolyCount ( S32  dl  ) 

S32 TSPartInstance::getNumDetails (  )  [inline]

S32 TSPartInstance::getCurrentObjectDetail (  )  [inline]

void TSPartInstance::setCurrentObjectDetail ( S32  od  )  [inline]

F32 TSPartInstance::getCurrentIntraDetail (  )  [inline]

void TSPartInstance::setCurrentIntraDetail ( F32  intra  )  [inline]


Field Documentation

TSPartInstance assumes ownership (or shared ownership) of the source shape.

This means that the source shape cannot be deleted so long as the part instance is still around. This also means that any change to source shapes's transforms or other animation properties will affect how the part instance displays. It is ok (even expected), however, to have many part instances accessing the same shape.

detail selection uses the table pointed to by this member

if this member is blank, then it uses source shape to determine detail...

detail 0 draws up until size of shape is less than mSizeCutoffs[0], detail 1 until mSizeCutoffs[1], etc.

for use by app




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