TSPartInstance
Engine/source/ts/tsPartInstance.h
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)...
Private Detail Selection Methods
selectCurrentDetail(F32 * sizeCutoffs, S32 numDetails, bool ignoreScale)
selectCurrentDetail(F32 pixelSize, F32 * sizeCutoffs, S32 numDetails)
Detail Information Accessors
Private Attributes
F32 *
detail selection uses the table pointed to by this member
TSPartInstance assumes ownership (or shared ownership) of the source shape.
Private Static Attributes
Private Functions
init(TSShapeInstance * )
renderDetailMap(S32 od)
Private Static Functions
breakShape(TSShapeInstance * , TSPartInstance * , S32 currentNode, Vector< TSPartInstance * > & partList, F32 * probShatter, F32 * probBreak, S32 probDepth)
Public Functions
TSPartInstance(TSShapeInstance * source)
TSPartInstance(TSShapeInstance * source, S32 objectIndex)
render(const TSRenderState & rdata)
render(S32 dl, const TSRenderState & rdata)
setDetailData(F32 * sizeCutoffs, S32 numDetails)
choose detail method – pass in NULL for first parameter to just use shapes data
Public Static Functions
breakShape(TSShapeInstance * , S32 subShape, Vector< TSPartInstance * > & partList, F32 * probShatter, F32 * probBreak, S32 probDepth)
Detailed Description
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
Private Detail Selection Methods
selectCurrentDetail(F32 * sizeCutoffs, S32 numDetails, bool ignoreScale)
selectCurrentDetail(F32 pixelSize, F32 * sizeCutoffs, S32 numDetails)
computePolyCount()
Detail Information Accessors
getDetailSize(S32 dl)
getPolyCount(S32 dl)
getNumDetails()
getCurrentObjectDetail()
setCurrentObjectDetail(S32 od)
getCurrentIntraDetail()
setCurrentIntraDetail(F32 intra)
Private Attributes
Vector< TSShapeInstance::MeshObjectInstance * > mMeshObjects
S32 mNumDetails
S32 * mPolyCount
F32 * mSizeCutoffs
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.
TSShapeInstance * mSourceShape
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.
Private Static Attributes
MRandomR250 smRandom
Public Attributes
void * mData
for use by app
Private Functions
addObject(S32 objectIndex)
init(TSShapeInstance * )
renderDetailMap(S32 od)
renderEnvironmentMap(S32 od)
renderFog(S32 od)
updateBounds()
Private Static Functions
breakShape(TSShapeInstance * , TSPartInstance * , S32 currentNode, Vector< TSPartInstance * > & partList, F32 * probShatter, F32 * probBreak, S32 probDepth)
Public Functions
TSPartInstance(TSShapeInstance * source)
TSPartInstance(TSShapeInstance * source, S32 objectIndex)
~TSPartInstance()
getBounds()
getCenter()
getRadius()
getShape()
getSourceShapeInstance()
render(const TSRenderState & rdata)
render(S32 dl, const TSRenderState & rdata)
setDetailData(F32 * sizeCutoffs, S32 numDetails)
choose detail method – pass in NULL for first parameter to just use shapes data
Public Static Functions
breakShape(TSShapeInstance * , S32 subShape, Vector< TSPartInstance * > & partList, F32 * probShatter, F32 * probBreak, S32 probDepth)