From 69dbaf5b8547aae75f8b771225fae9f9d10be754 Mon Sep 17 00:00:00 2001 From: bank Date: Tue, 13 May 2014 14:08:42 +0400 Subject: [PATCH] Rename all member variables to follow the style guidelines (prefixed with the 'm') - class TSShape --- Engine/source/T3D/debris.cpp | 2 +- .../T3D/examples/renderShapeExample.cpp | 2 +- Engine/source/T3D/fx/explosion.cpp | 2 +- Engine/source/T3D/fx/groundCover.cpp | 2 +- Engine/source/T3D/guiMaterialPreview.cpp | 6 +- Engine/source/T3D/guiObjectView.cpp | 8 +- Engine/source/T3D/physics/physicsDebris.cpp | 12 +- Engine/source/T3D/physics/physicsShape.cpp | 2 +- Engine/source/T3D/player.cpp | 6 +- Engine/source/T3D/projectile.cpp | 2 +- Engine/source/T3D/shapeBase.cpp | 52 +- Engine/source/T3D/shapeImage.cpp | 4 +- Engine/source/T3D/tsStatic.cpp | 12 +- Engine/source/T3D/turret/turretShape.cpp | 16 +- Engine/source/T3D/vehicles/wheeledVehicle.cpp | 6 +- Engine/source/forest/ts/tsForestItemData.cpp | 16 +- Engine/source/forest/ts/tsForestItemData.h | 2 +- .../source/gui/editor/guiShapeEdPreview.cpp | 78 +- Engine/source/lighting/common/blobShadow.cpp | 6 +- .../source/ts/collada/colladaShapeLoader.cpp | 10 +- Engine/source/ts/loader/tsShapeLoader.cpp | 216 ++--- Engine/source/ts/tsAnimate.cpp | 66 +- Engine/source/ts/tsCollision.cpp | 116 +-- Engine/source/ts/tsDump.cpp | 52 +- Engine/source/ts/tsLastDetail.cpp | 4 +- Engine/source/ts/tsMeshFit.cpp | 20 +- Engine/source/ts/tsPartInstance.cpp | 16 +- Engine/source/ts/tsShape.cpp | 788 +++++++++--------- Engine/source/ts/tsShape.h | 82 +- Engine/source/ts/tsShapeConstruct.cpp | 96 +-- Engine/source/ts/tsShapeEdit.cpp | 654 +++++++-------- Engine/source/ts/tsShapeInstance.cpp | 52 +- Engine/source/ts/tsShapeInstance.h | 4 +- Engine/source/ts/tsShapeOldRead.cpp | 298 +++---- Engine/source/ts/tsThread.cpp | 44 +- 35 files changed, 1377 insertions(+), 1377 deletions(-) diff --git a/Engine/source/T3D/debris.cpp b/Engine/source/T3D/debris.cpp index 8b07154ec..4b6f5c993 100644 --- a/Engine/source/T3D/debris.cpp +++ b/Engine/source/T3D/debris.cpp @@ -568,7 +568,7 @@ bool Debris::onAdd() // Setup our bounding box if( mDataBlock->shape ) { - mObjBox = mDataBlock->shape->bounds; + mObjBox = mDataBlock->shape->mBounds; } else { diff --git a/Engine/source/T3D/examples/renderShapeExample.cpp b/Engine/source/T3D/examples/renderShapeExample.cpp index 0e60c3801..5f0847b90 100644 --- a/Engine/source/T3D/examples/renderShapeExample.cpp +++ b/Engine/source/T3D/examples/renderShapeExample.cpp @@ -213,7 +213,7 @@ void RenderShapeExample::createShape() } // Update the bounding box - mObjBox = mShape->bounds; + mObjBox = mShape->mBounds; resetWorldBox(); setRenderTransform(mObjToWorld); diff --git a/Engine/source/T3D/fx/explosion.cpp b/Engine/source/T3D/fx/explosion.cpp index 2acfa8487..7ee5fc1fb 100644 --- a/Engine/source/T3D/fx/explosion.cpp +++ b/Engine/source/T3D/fx/explosion.cpp @@ -1246,7 +1246,7 @@ bool Explosion::explode() mEndingMS = U32(mExplosionInstance->getScaledDuration(mExplosionThread) * 1000.0f); mObjScale.convolve(mDataBlock->explosionScale); - mObjBox = mDataBlock->explosionShape->bounds; + mObjBox = mDataBlock->explosionShape->mBounds; resetWorldBox(); } diff --git a/Engine/source/T3D/fx/groundCover.cpp b/Engine/source/T3D/fx/groundCover.cpp index bfc2f7737..248031635 100644 --- a/Engine/source/T3D/fx/groundCover.cpp +++ b/Engine/source/T3D/fx/groundCover.cpp @@ -1142,7 +1142,7 @@ GroundCoverCell* GroundCover::_generateCell( const Point2I& index, const F32 typeMaxElevation = mMaxElevation[type]; const F32 typeMinElevation = mMinElevation[type]; const bool typeIsShape = mShapeInstances[ type ] != NULL; - const Box3F typeShapeBounds = typeIsShape ? mShapeInstances[ type ]->getShape()->bounds : Box3F(); + const Box3F typeShapeBounds = typeIsShape ? mShapeInstances[ type ]->getShape()->mBounds : Box3F(); const F32 typeWindScale = mWindScale[type]; StringTableEntry typeLayer = mLayer[type]; const bool typeInvertLayer = mInvertLayer[type]; diff --git a/Engine/source/T3D/guiMaterialPreview.cpp b/Engine/source/T3D/guiMaterialPreview.cpp index 1229956e6..1392f9186 100644 --- a/Engine/source/T3D/guiMaterialPreview.cpp +++ b/Engine/source/T3D/guiMaterialPreview.cpp @@ -268,8 +268,8 @@ void GuiMaterialPreview::setObjectModel(const char* modelName) AssertFatal(mModel, avar("GuiMaterialPreview: Failed to load model %s. Please check your model name and load a valid model.", modelName)); // Initialize camera values: - mOrbitPos = mModel->getShape()->center; - mMinOrbitDist = mModel->getShape()->radius; + mOrbitPos = mModel->getShape()->mCenter; + mMinOrbitDist = mModel->getShape()->mRadius; lastRenderTime = Platform::getVirtualMilliseconds(); } @@ -434,7 +434,7 @@ void GuiMaterialPreview::resetViewport() mCameraRot.set( mDegToRad(30.0f), 0, mDegToRad(-30.0f) ); mCameraPos.set(0.0f, 1.75f, 1.25f); mOrbitDist = 5.0f; - mOrbitPos = mModel->getShape()->center; + mOrbitPos = mModel->getShape()->mCenter; // Reset the viewport's lighting. GuiMaterialPreview::mFakeSun->setColor( ColorF( 1.0f, 1.0f, 1.0f ) ); diff --git a/Engine/source/T3D/guiObjectView.cpp b/Engine/source/T3D/guiObjectView.cpp index 00e5de0df..35b4ad936 100644 --- a/Engine/source/T3D/guiObjectView.cpp +++ b/Engine/source/T3D/guiObjectView.cpp @@ -366,8 +366,8 @@ void GuiObjectView::setObjectModel( const String& modelName ) // Initialize camera values. - mOrbitPos = mModel->getShape()->center; - mMinOrbitDist = mModel->getShape()->radius; + mOrbitPos = mModel->getShape()->mCenter; + mMinOrbitDist = mModel->getShape()->mRadius; // Initialize animation. @@ -645,7 +645,7 @@ void GuiObjectView::_initAnimation() if( mAnimationSeq != -1 ) { - if( mAnimationSeq >= mModel->getShape()->sequences.size() ) + if( mAnimationSeq >= mModel->getShape()->mSequences.size() ) { Con::errorf( "GuiObjectView::_initAnimation - Sequence '%i' out of range for model '%s'", mAnimationSeq, @@ -694,7 +694,7 @@ void GuiObjectView::_initMount() // Make sure mount node is valid. - if( mMountNode != -1 && mMountNode >= mModel->getShape()->nodes.size() ) + if( mMountNode != -1 && mMountNode >= mModel->getShape()->mNodes.size() ) { Con::errorf( "GuiObjectView::_initMount - Mount node index '%i' out of range for '%s'", mMountNode, diff --git a/Engine/source/T3D/physics/physicsDebris.cpp b/Engine/source/T3D/physics/physicsDebris.cpp index 38549980a..195b2f2ae 100644 --- a/Engine/source/T3D/physics/physicsDebris.cpp +++ b/Engine/source/T3D/physics/physicsDebris.cpp @@ -350,7 +350,7 @@ bool PhysicsDebris::onAdd() } // Setup our bounding box - mObjBox = mDataBlock->shape->bounds; + mObjBox = mDataBlock->shape->mBounds; resetWorldBox(); // Add it to the client scene. @@ -688,20 +688,20 @@ void PhysicsDebris::_findNodes( U32 colNode, Vector &nodeIds ) // 2. Collision node is a child of its visible mesh node TSShape *shape = mDataBlock->shape; - S32 itr = shape->nodes[colNode].parentIndex; - itr = shape->nodes[itr].firstChild; + S32 itr = shape->mNodes[colNode].parentIndex; + itr = shape->mNodes[itr].firstChild; while ( itr != -1 ) { if ( itr != colNode ) nodeIds.push_back(itr); - itr = shape->nodes[itr].nextSibling; + itr = shape->mNodes[itr].nextSibling; } // If we didn't find any siblings of the collision node we assume // it is case #2 and the collision nodes direct parent is the visible mesh. - if ( nodeIds.size() == 0 && shape->nodes[colNode].parentIndex != -1 ) - nodeIds.push_back( shape->nodes[colNode].parentIndex ); + if ( nodeIds.size() == 0 && shape->mNodes[colNode].parentIndex != -1 ) + nodeIds.push_back( shape->mNodes[colNode].parentIndex ); } extern bool gEditingMission; diff --git a/Engine/source/T3D/physics/physicsShape.cpp b/Engine/source/T3D/physics/physicsShape.cpp index 660db0791..9fccc505a 100644 --- a/Engine/source/T3D/physics/physicsShape.cpp +++ b/Engine/source/T3D/physics/physicsShape.cpp @@ -698,7 +698,7 @@ bool PhysicsShape::_createShape() return false; // Set the world box. - mObjBox = db->shape->bounds; + mObjBox = db->shape->mBounds; resetWorldBox(); // If this is the server and its a client only simulation diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 1440f2d71..0646b71cb 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -492,12 +492,12 @@ bool PlayerData::preload(bool server, String &errorStr) if (dStricmp(sp->name, "jet") != 0) AssertWarn(dp->sequence != -1, avar("PlayerData::preload - Unable to find named animation sequence '%s'!", sp->name)); } - for (S32 b = 0; b < mShape->sequences.size(); b++) + for (S32 b = 0; b < mShape->mSequences.size(); b++) { if (!isTableSequence(b)) { dp->sequence = b; - dp->name = mShape->getName(mShape->sequences[b].nameIndex); + dp->name = mShape->getName(mShape->mSequences[b].nameIndex); dp->velocityScale = false; getGroundInfo(si,thread,dp++); } @@ -614,7 +614,7 @@ void PlayerData::getGroundInfo(TSShapeInstance* si, TSThread* thread,ActionAnima dp->dir.set(0.0f, 0.0f, 0.0f); // Death animations MUST define ground transforms, so add dummy ones if required - if (si->getShape()->sequences[dp->sequence].numGroundFrames == 0) + if (si->getShape()->mSequences[dp->sequence].numGroundFrames == 0) si->getShape()->setSequenceGroundSpeed(dp->name, Point3F(0, 0, 0), Point3F(0, 0, 0)); } else diff --git a/Engine/source/T3D/projectile.cpp b/Engine/source/T3D/projectile.cpp index 86886c2b5..51875ff95 100644 --- a/Engine/source/T3D/projectile.cpp +++ b/Engine/source/T3D/projectile.cpp @@ -764,7 +764,7 @@ bool Projectile::onAdd() // Setup our bounding box if (bool(mDataBlock->projectileShape) == true) - mObjBox = mDataBlock->projectileShape->bounds; + mObjBox = mDataBlock->projectileShape->mBounds; else mObjBox = Box3F(Point3F(0, 0, 0), Point3F(0, 0, 0)); diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 6661eb74c..1e8188246 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -319,9 +319,9 @@ bool ShapeBaseData::preload(bool server, String &errorStr) // Resolve details and camera node indexes. static const String sCollisionStr( "collision-" ); - for (i = 0; i < mShape->details.size(); i++) + for (i = 0; i < mShape->mDetails.size(); i++) { - const String &name = mShape->names[mShape->details[i].nameIndex]; + const String &name = mShape->mNames[mShape->mDetails[i].nameIndex]; if (name.compare( sCollisionStr, sCollisionStr.length(), String::NoCase ) == 0) { @@ -331,15 +331,15 @@ bool ShapeBaseData::preload(bool server, String &errorStr) mShape->computeBounds(collisionDetails.last(), collisionBounds.last()); mShape->getAccelerator(collisionDetails.last()); - if (!mShape->bounds.isContained(collisionBounds.last())) + if (!mShape->mBounds.isContained(collisionBounds.last())) { Con::warnf("Warning: shape %s collision detail %d (Collision-%d) bounds exceed that of shape.", shapeName, collisionDetails.size() - 1, collisionDetails.last()); - collisionBounds.last() = mShape->bounds; + collisionBounds.last() = mShape->mBounds; } else if (collisionBounds.last().isValidBox() == false) { Con::errorf("Error: shape %s-collision detail %d (Collision-%d) bounds box invalid!", shapeName, collisionDetails.size() - 1, collisionDetails.last()); - collisionBounds.last() = mShape->bounds; + collisionBounds.last() = mShape->mBounds; } // The way LOS works is that it will check to see if there is a LOS detail that matches @@ -360,9 +360,9 @@ bool ShapeBaseData::preload(bool server, String &errorStr) // Snag any "unmatched" LOS details static const String sLOSStr( "LOS-" ); - for (i = 0; i < mShape->details.size(); i++) + for (i = 0; i < mShape->mDetails.size(); i++) { - const String &name = mShape->names[mShape->details[i].nameIndex]; + const String &name = mShape->mNames[mShape->mDetails[i].nameIndex]; if (name.compare( sLOSStr, sLOSStr.length(), String::NoCase ) == 0) { @@ -406,7 +406,7 @@ bool ShapeBaseData::preload(bool server, String &errorStr) damageSequence = mShape->findSequence("Damage"); // - F32 w = mShape->bounds.len_y() / 2; + F32 w = mShape->mBounds.len_y() / 2; if (cameraMaxDist < w) cameraMaxDist = w; } @@ -602,7 +602,7 @@ DefineEngineMethod( ShapeBaseData, checkDeployPos, bool, ( TransformF txfm ),, MatrixF mat = txfm.getMatrix(); - Box3F objBox = object->mShape->bounds; + Box3F objBox = object->mShape->mBounds; Point3F boxCenter = (objBox.minExtents + objBox.maxExtents) * 0.5f; objBox.minExtents = boxCenter + (objBox.minExtents - boxCenter) * 0.9f; objBox.maxExtents = boxCenter + (objBox.maxExtents - boxCenter) * 0.9f; @@ -1104,11 +1104,11 @@ bool ShapeBase::onNewDataBlock( GameBaseData *dptr, bool reload ) if (isClientObject()) mShapeInstance->cloneMaterialList(); - mObjBox = mDataBlock->mShape->bounds; + mObjBox = mDataBlock->mShape->mBounds; resetWorldBox(); // Set the initial mesh hidden state. - mMeshHidden.setSize( mDataBlock->mShape->objects.size() ); + mMeshHidden.setSize( mDataBlock->mShape->mObjects.size() ); mMeshHidden.clear(); // Initialize the threads @@ -1133,8 +1133,8 @@ bool ShapeBase::onNewDataBlock( GameBaseData *dptr, bool reload ) AssertFatal( prevDB != NULL, "ShapeBase::onNewDataBlock - how did you have a sequence playing without a prior datablock?" ); const TSShape *prevShape = prevDB->mShape; - const TSShape::Sequence &prevSeq = prevShape->sequences[st.sequence]; - const String &prevSeqName = prevShape->names[prevSeq.nameIndex]; + const TSShape::Sequence &prevSeq = prevShape->mSequences[st.sequence]; + const String &prevSeqName = prevShape->mNames[prevSeq.nameIndex]; st.sequence = mDataBlock->mShape->findSequence( prevSeqName ); @@ -2130,7 +2130,7 @@ const char *ShapeBase::getThreadSequenceName( U32 slot ) } // Name Index - const U32 nameIndex = getShape()->sequences[st.sequence].nameIndex; + const U32 nameIndex = getShape()->mSequences[st.sequence].nameIndex; // Return Name. return getShape()->getName( nameIndex ); @@ -2343,7 +2343,7 @@ void ShapeBase::advanceThreads(F32 dt) for (U32 i = 0; i < MaxScriptThreads; i++) { Thread& st = mScriptThread[i]; if (st.thread) { - if (!mShapeInstance->getShape()->sequences[st.sequence].isCyclic() && !st.atEnd && + if (!mShapeInstance->getShape()->mSequences[st.sequence].isCyclic() && !st.atEnd && ( ( st.timescale > 0.f )? mShapeInstance->getPos(st.thread) >= 1.0: mShapeInstance->getPos(st.thread) <= 0)) { st.atEnd = true; @@ -2622,7 +2622,7 @@ void ShapeBase::_renderBoundingBox( ObjectRenderInst *ri, SceneRenderState *stat MatrixF mat; getRenderImageTransform( ri->objectIndex, &mat ); - const Box3F &objBox = image.shapeInstance[getImageShapeIndex(image)]->getShape()->bounds; + const Box3F &objBox = image.shapeInstance[getImageShapeIndex(image)]->getShape()->mBounds; drawer->drawCube( desc, objBox, ColorI( 255, 255, 255 ), &mat ); } @@ -3341,17 +3341,17 @@ void ShapeBaseConvex::findNodeTransform() TSShapeInstance* si = pShapeBase->getShapeInstance(); TSShape* shape = si->getShape(); - const TSShape::Detail* detail = &shape->details[dl]; + const TSShape::Detail* detail = &shape->mDetails[dl]; const S32 subs = detail->subShapeNum; - const S32 start = shape->subShapeFirstObject[subs]; - const S32 end = start + shape->subShapeNumObjects[subs]; + const S32 start = shape->mSubShapeFirstObject[subs]; + const S32 end = start + shape->mSubShapeNumObjects[subs]; // Find the first object that contains a mesh for this // detail level. There should only be one mesh per // collision detail level. for (S32 i = start; i < end; i++) { - const TSShape::Object* obj = &shape->objects[i]; + const TSShape::Object* obj = &shape->mObjects[i]; if (obj->numMeshes && detail->objectDetailNum < obj->numMeshes) { nodeTransform = &si->mNodeTransforms[obj->nodeIndex]; @@ -4921,7 +4921,7 @@ DefineEngineMethod( ShapeBase, changeMaterial, void, ( const char* mapTo, Materi ShapeBase *clientObj = dynamic_cast< ShapeBase* > ( object->getClientObject() ); // Check the mapTo name exists for this shape - S32 matIndex = serverObj->getShape()->materialList->getMaterialNameList().find_next(String(mapTo)); + S32 matIndex = serverObj->getShape()->mMaterialList->getMaterialNameList().find_next(String(mapTo)); if (matIndex < 0) { Con::errorf("ShapeBase::changeMaterial failed: Invalid mapTo name '%s'", mapTo); @@ -4940,19 +4940,19 @@ DefineEngineMethod( ShapeBase, changeMaterial, void, ( const char* mapTo, Materi // Replace instances with the new material being traded in. For ShapeBase // class we have to update the server/client objects separately so both // represent our changes - delete serverObj->getShape()->materialList->mMatInstList[matIndex]; - serverObj->getShape()->materialList->mMatInstList[matIndex] = newMat->createMatInstance(); + delete serverObj->getShape()->mMaterialList->mMatInstList[matIndex]; + serverObj->getShape()->mMaterialList->mMatInstList[matIndex] = newMat->createMatInstance(); if (clientObj) { - delete clientObj->getShape()->materialList->mMatInstList[matIndex]; - clientObj->getShape()->materialList->mMatInstList[matIndex] = newMat->createMatInstance(); + delete clientObj->getShape()->mMaterialList->mMatInstList[matIndex]; + clientObj->getShape()->mMaterialList->mMatInstList[matIndex] = newMat->createMatInstance(); } // Finish up preparing the material instances for rendering const GFXVertexFormat *flags = getGFXVertexFormat(); FeatureSet features = MATMGR->getDefaultFeatures(); - serverObj->getShape()->materialList->getMaterialInst(matIndex)->init( features, flags ); + serverObj->getShape()->mMaterialList->getMaterialInst(matIndex)->init( features, flags ); if (clientObj) clientObj->getShapeInstance()->mMaterialList->getMaterialInst(matIndex)->init( features, flags ); } diff --git a/Engine/source/T3D/shapeImage.cpp b/Engine/source/T3D/shapeImage.cpp index f49b44ba9..494b70249 100644 --- a/Engine/source/T3D/shapeImage.cpp +++ b/Engine/source/T3D/shapeImage.cpp @@ -490,9 +490,9 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr) do { MatrixF nmat; QuatF q; - TSTransform::setMatrix(shape[i]->defaultRotations[node].getQuatF(&q),shape[i]->defaultTranslations[node],&nmat); + TSTransform::setMatrix(shape[i]->mDefaultRotations[node].getQuatF(&q),shape[i]->mDefaultTranslations[node],&nmat); total.mul(nmat); - node = shape[i]->nodes[node].parentIndex; + node = shape[i]->mNodes[node].parentIndex; } while(node != -1); total.inverse(); diff --git a/Engine/source/T3D/tsStatic.cpp b/Engine/source/T3D/tsStatic.cpp index 1474bf96d..74911db79 100644 --- a/Engine/source/T3D/tsStatic.cpp +++ b/Engine/source/T3D/tsStatic.cpp @@ -314,7 +314,7 @@ bool TSStatic::_createShape() NetConnection::filesWereDownloaded() ) return false; - mObjBox = mShape->bounds; + mObjBox = mShape->mBounds; resetWorldBox(); mShapeInstance = new TSShapeInstance( mShape, isClientObject() ); @@ -371,7 +371,7 @@ void TSStatic::_updatePhysics() if ( mCollisionType == Bounds ) { MatrixF offset( true ); - offset.setPosition( mShape->center ); + offset.setPosition( mShape->mCenter ); colShape = PHYSICSMGR->createCollision(); colShape->addBox( getObjBox().getExtents() * 0.5f * mObjScale, offset ); } @@ -1109,7 +1109,7 @@ DefineEngineMethod( TSStatic, changeMaterial, void, ( const char* mapTo, Materia } // Check the mapTo name exists for this shape - S32 matIndex = object->getShape()->materialList->getMaterialNameList().find_next(String(mapTo)); + S32 matIndex = object->getShape()->mMaterialList->getMaterialNameList().find_next(String(mapTo)); if (matIndex < 0) { Con::errorf("TSShape::changeMaterial failed: Invalid mapTo name '%s'", mapTo); @@ -1127,13 +1127,13 @@ DefineEngineMethod( TSStatic, changeMaterial, void, ( const char* mapTo, Materia // Replace instances with the new material being traded in. Lets make sure that we only // target the specific targets per inst, this is actually doing more than we thought - delete object->getShape()->materialList->mMatInstList[matIndex]; - object->getShape()->materialList->mMatInstList[matIndex] = newMat->createMatInstance(); + delete object->getShape()->mMaterialList->mMatInstList[matIndex]; + object->getShape()->mMaterialList->mMatInstList[matIndex] = newMat->createMatInstance(); // Finish up preparing the material instances for rendering const GFXVertexFormat *flags = getGFXVertexFormat(); FeatureSet features = MATMGR->getDefaultFeatures(); - object->getShape()->materialList->getMaterialInst(matIndex)->init( features, flags ); + object->getShape()->mMaterialList->getMaterialInst(matIndex)->init( features, flags ); } DefineEngineMethod( TSStatic, getModelFile, const char *, (),, diff --git a/Engine/source/T3D/turret/turretShape.cpp b/Engine/source/T3D/turret/turretShape.cpp index 5d53fabe8..63165cafa 100644 --- a/Engine/source/T3D/turret/turretShape.cpp +++ b/Engine/source/T3D/turret/turretShape.cpp @@ -823,8 +823,8 @@ void TurretShape::_updateNodes(const Point3F& rot) if (node != -1) { MatrixF* mat = &mShapeInstance->mNodeTransforms[node]; - Point3F defaultPos = mShapeInstance->getShape()->defaultTranslations[node]; - Quat16 defaultRot = mShapeInstance->getShape()->defaultRotations[node]; + Point3F defaultPos = mShapeInstance->getShape()->mDefaultTranslations[node]; + Quat16 defaultRot = mShapeInstance->getShape()->mDefaultRotations[node]; QuatF qrot(zRot); qrot *= defaultRot.getQuatF(); @@ -837,8 +837,8 @@ void TurretShape::_updateNodes(const Point3F& rot) if (node != -1) { MatrixF* mat = &mShapeInstance->mNodeTransforms[node]; - Point3F defaultPos = mShapeInstance->getShape()->defaultTranslations[node]; - Quat16 defaultRot = mShapeInstance->getShape()->defaultRotations[node]; + Point3F defaultPos = mShapeInstance->getShape()->mDefaultTranslations[node]; + Quat16 defaultRot = mShapeInstance->getShape()->mDefaultRotations[node]; QuatF qrot(xRot); qrot *= defaultRot.getQuatF(); @@ -853,8 +853,8 @@ void TurretShape::_updateNodes(const Point3F& rot) if (node != -1) { MatrixF* mat = &mShapeInstance->mNodeTransforms[node]; - Point3F defaultPos = mShapeInstance->getShape()->defaultTranslations[node]; - Quat16 defaultRot = mShapeInstance->getShape()->defaultRotations[node]; + Point3F defaultPos = mShapeInstance->getShape()->mDefaultTranslations[node]; + Quat16 defaultRot = mShapeInstance->getShape()->mDefaultRotations[node]; QuatF qrot(xRot); qrot *= defaultRot.getQuatF(); @@ -866,8 +866,8 @@ void TurretShape::_updateNodes(const Point3F& rot) if (node != -1) { MatrixF* mat = &mShapeInstance->mNodeTransforms[node]; - Point3F defaultPos = mShapeInstance->getShape()->defaultTranslations[node]; - Quat16 defaultRot = mShapeInstance->getShape()->defaultRotations[node]; + Point3F defaultPos = mShapeInstance->getShape()->mDefaultTranslations[node]; + Quat16 defaultRot = mShapeInstance->getShape()->mDefaultRotations[node]; QuatF qrot(zRot); qrot *= defaultRot.getQuatF(); diff --git a/Engine/source/T3D/vehicles/wheeledVehicle.cpp b/Engine/source/T3D/vehicles/wheeledVehicle.cpp index 39556168c..49bf0146b 100644 --- a/Engine/source/T3D/vehicles/wheeledVehicle.cpp +++ b/Engine/source/T3D/vehicles/wheeledVehicle.cpp @@ -111,7 +111,7 @@ bool WheeledVehicleTire::preload(bool server, String &errorStr) // Determinw wheel radius from the shape's bounding box. // The tire should be built with it's hub axis along the // object's Y axis. - radius = shape->bounds.len_z() / 2; + radius = shape->mBounds.len_z() / 2; } return true; @@ -399,8 +399,8 @@ bool WheeledVehicleData::preload(bool server, String &errorStr) if (collisionDetails[0] != -1) { MatrixF imat(1); SphereF sphere; - sphere.center = mShape->center; - sphere.radius = mShape->radius; + sphere.center = mShape->mCenter; + sphere.radius = mShape->mRadius; PlaneExtractorPolyList polyList; polyList.mPlaneList = &rigidBody.mPlaneList; polyList.setTransform(&imat, Point3F(1,1,1)); diff --git a/Engine/source/forest/ts/tsForestItemData.cpp b/Engine/source/forest/ts/tsForestItemData.cpp index d5574587d..31435c310 100644 --- a/Engine/source/forest/ts/tsForestItemData.cpp +++ b/Engine/source/forest/ts/tsForestItemData.cpp @@ -154,7 +154,7 @@ TSShapeInstance* TSForestItemData::_getShapeInstance() const void TSForestItemData::_checkLastDetail() { const S32 dl = mShape->mSmallestVisibleDL; - const TSDetail *detail = &mShape->details[dl]; + const TSDetail *detail = &mShape->mDetails[dl]; // TODO: Expose some real parameters to the datablock maybe? if ( detail->subShapeNum != -1 ) @@ -162,8 +162,8 @@ void TSForestItemData::_checkLastDetail() mShape->addImposter( mShapeFile, 10, 4, 0, 0, 256, 0, 0 ); // HACK: If i don't do this it crashes! - while ( mShape->detailCollisionAccelerators.size() < mShape->details.size() ) - mShape->detailCollisionAccelerators.push_back( NULL ); + while ( mShape->mDetailCollisionAccelerators.size() < mShape->mDetails.size() ) + mShape->mDetailCollisionAccelerators.push_back( NULL ); } } @@ -174,12 +174,12 @@ TSLastDetail* TSForestItemData::getLastDetail() const return NULL; const S32 dl = mShape->mSmallestVisibleDL; - const TSDetail* detail = &mShape->details[dl]; + const TSDetail* detail = &mShape->mDetails[dl]; if ( detail->subShapeNum >= 0 || - mShape->billboardDetails.size() <= dl ) + mShape->mBillboardDetails.size() <= dl ) return NULL; - return mShape->billboardDetails[dl]; + return mShape->mBillboardDetails[dl]; } ForestCellBatch* TSForestItemData::allocateBatch() const @@ -207,8 +207,8 @@ bool TSForestItemData::canBillboard( const SceneRenderState *state, const Forest if ( dl < 0 ) return true; - const TSDetail *detail = &mShape->details[dl]; - if ( detail->subShapeNum < 0 && dl < mShape->billboardDetails.size() ) + const TSDetail *detail = &mShape->mDetails[dl]; + if ( detail->subShapeNum < 0 && dl < mShape->mBillboardDetails.size() ) return true; return false; diff --git a/Engine/source/forest/ts/tsForestItemData.h b/Engine/source/forest/ts/tsForestItemData.h index 197069c9f..80316447c 100644 --- a/Engine/source/forest/ts/tsForestItemData.h +++ b/Engine/source/forest/ts/tsForestItemData.h @@ -88,7 +88,7 @@ public: const Vector& getLOSDetails() const { return mLOSDetails; } // ForestItemData - const Box3F& getObjBox() const { return mShape ? mShape->bounds : Box3F::Invalid; } + const Box3F& getObjBox() const { return mShape ? mShape->mBounds : Box3F::Invalid; } bool render( TSRenderState *rdata, const ForestItem& item ) const; ForestCellBatch* allocateBatch() const; bool canBillboard( const SceneRenderState *state, const ForestItem &item, F32 distToCamera ) const; diff --git a/Engine/source/gui/editor/guiShapeEdPreview.cpp b/Engine/source/gui/editor/guiShapeEdPreview.cpp index 7b3afdedc..3394aa991 100644 --- a/Engine/source/gui/editor/guiShapeEdPreview.cpp +++ b/Engine/source/gui/editor/guiShapeEdPreview.cpp @@ -331,7 +331,7 @@ void GuiShapeEdPreview::setCurrentDetail(S32 dl) if ( mModel ) { S32 smallest = mModel->getShape()->mSmallestVisibleDL; - mModel->getShape()->mSmallestVisibleDL = mModel->getShape()->details.size()-1; + mModel->getShape()->mSmallestVisibleDL = mModel->getShape()->mDetails.size()-1; mModel->setCurrentDetail( dl ); mModel->getShape()->mSmallestVisibleDL = smallest; @@ -360,18 +360,18 @@ bool GuiShapeEdPreview::setObjectModel(const char* modelName) AssertFatal( mModel, avar("GuiShapeEdPreview: Failed to load model %s. Please check your model name and load a valid model.", modelName )); // Initialize camera values: - mOrbitPos = mModel->getShape()->center; + mOrbitPos = mModel->getShape()->mCenter; // Set camera move and zoom speed according to model size - mMoveSpeed = mModel->getShape()->radius / sMoveScaler; - mZoomSpeed = mModel->getShape()->radius / sZoomScaler; + mMoveSpeed = mModel->getShape()->mRadius / sMoveScaler; + mZoomSpeed = mModel->getShape()->mRadius / sZoomScaler; // Reset node selection mHoverNode = -1; mSelectedNode = -1; mSelectedObject = -1; mSelectedObjDetail = 0; - mProjectedNodes.setSize( mModel->getShape()->nodes.size() ); + mProjectedNodes.setSize( mModel->getShape()->mNodes.size() ); // Reset detail stats mCurrentDL = 0; @@ -683,9 +683,9 @@ void GuiShapeEdPreview::refreshShape() mModel->initNodeTransforms(); mModel->initMeshObjects(); - mProjectedNodes.setSize( mModel->getShape()->nodes.size() ); + mProjectedNodes.setSize( mModel->getShape()->mNodes.size() ); - if ( mSelectedObject >= mModel->getShape()->objects.size() ) + if ( mSelectedObject >= mModel->getShape()->mObjects.size() ) { mSelectedObject = -1; mSelectedObjDetail = 0; @@ -694,9 +694,9 @@ void GuiShapeEdPreview::refreshShape() // Re-compute the collision mesh stats mColMeshes = 0; mColPolys = 0; - for ( S32 i = 0; i < mModel->getShape()->details.size(); i++ ) + for ( S32 i = 0; i < mModel->getShape()->mDetails.size(); i++ ) { - const TSShape::Detail& det = mModel->getShape()->details[i]; + const TSShape::Detail& det = mModel->getShape()->mDetails[i]; const String& detName = mModel->getShape()->getName( det.nameIndex ); if ( ( det.subShapeNum < 0 ) || !detName.startsWith( "collision-" ) ) continue; @@ -704,12 +704,12 @@ void GuiShapeEdPreview::refreshShape() mColPolys += det.polyCount; S32 od = det.objectDetailNum; - S32 start = mModel->getShape()->subShapeFirstObject[det.subShapeNum]; - S32 end = start + mModel->getShape()->subShapeNumObjects[det.subShapeNum]; + S32 start = mModel->getShape()->mSubShapeFirstObject[det.subShapeNum]; + S32 end = start + mModel->getShape()->mSubShapeNumObjects[det.subShapeNum]; for ( S32 j = start; j < end; j++ ) { - const TSShape::Object &obj = mModel->getShape()->objects[j]; - const TSMesh* mesh = ( od < obj.numMeshes ) ? mModel->getShape()->meshes[obj.startMeshIndex + od] : NULL; + const TSShape::Object &obj = mModel->getShape()->mObjects[j]; + const TSMesh* mesh = ( od < obj.numMeshes ) ? mModel->getShape()->mMeshes[obj.startMeshIndex + od] : NULL; if ( mesh ) mColMeshes++; } @@ -850,7 +850,7 @@ void GuiShapeEdPreview::exportToCollada( const String& path ) if ( mModel ) { MatrixF orientation( true ); - orientation.setPosition( mModel->getShape()->bounds.getCenter() ); + orientation.setPosition( mModel->getShape()->mBounds.getCenter() ); orientation.inverse(); OptimizedPolyList polyList; @@ -1135,8 +1135,8 @@ bool GuiShapeEdPreview::getCameraTransform(MatrixF* cameraMatrix) cameraMatrix->identity(); if ( mModel ) { - Point3F camPos = mModel->getShape()->bounds.getCenter(); - F32 offset = mModel->getShape()->bounds.len(); + Point3F camPos = mModel->getShape()->mBounds.getCenter(); + F32 offset = mModel->getShape()->mBounds.len(); switch (mDisplayType) { @@ -1166,11 +1166,11 @@ void GuiShapeEdPreview::computeSceneBounds(Box3F& bounds) void GuiShapeEdPreview::updateDetailLevel(const SceneRenderState* state) { // Make sure current detail is valid - if ( !mModel->getShape()->details.size() ) + if ( !mModel->getShape()->mDetails.size() ) return; - if ( mModel->getCurrentDetail() >= mModel->getShape()->details.size() ) - setCurrentDetail( mModel->getShape()->details.size() - 1 ); + if ( mModel->getCurrentDetail() >= mModel->getShape()->mDetails.size() ) + setCurrentDetail( mModel->getShape()->mDetails.size() - 1 ); // Convert between FOV and distance so zoom is consistent between Perspective // and Orthographic views (conversion factor found by trial and error) @@ -1193,7 +1193,7 @@ void GuiShapeEdPreview::updateDetailLevel(const SceneRenderState* state) setCurrentDetail( 0 ); currentDetail = mModel->getCurrentDetail(); - const TSShape::Detail& det = mModel->getShape()->details[ currentDetail ]; + const TSShape::Detail& det = mModel->getShape()->mDetails[ currentDetail ]; mDetailPolys = det.polyCount; mDetailSize = det.size; @@ -1213,17 +1213,17 @@ void GuiShapeEdPreview::updateDetailLevel(const SceneRenderState* state) { Vector usedMaterials; - S32 start = mModel->getShape()->subShapeFirstObject[det.subShapeNum]; - S32 end = start + mModel->getShape()->subShapeNumObjects[det.subShapeNum]; + S32 start = mModel->getShape()->mSubShapeFirstObject[det.subShapeNum]; + S32 end = start + mModel->getShape()->mSubShapeNumObjects[det.subShapeNum]; for ( S32 iObj = start; iObj < end; iObj++ ) { - const TSShape::Object& obj = mModel->getShape()->objects[iObj]; + const TSShape::Object& obj = mModel->getShape()->mObjects[iObj]; if ( obj.numMeshes <= currentDetail ) continue; - const TSMesh* mesh = mModel->getShape()->meshes[ obj.startMeshIndex + currentDetail ]; + const TSMesh* mesh = mModel->getShape()->mMeshes[ obj.startMeshIndex + currentDetail ]; if ( !mesh ) continue; @@ -1262,7 +1262,7 @@ void GuiShapeEdPreview::updateThreads(F32 delta) continue; // Make sure thread priority matches sequence priority (which may have changed) - mModel->setPriority( thread.key, mModel->getShape()->sequences[mModel->getSequence( thread.key )].priority ); + mModel->setPriority( thread.key, mModel->getShape()->mSequences[mModel->getSequence( thread.key )].priority ); // Handle ping-pong if ( thread.pingpong && !mModel->isInTransition( thread.key ) ) @@ -1426,18 +1426,18 @@ void GuiShapeEdPreview::renderWorld(const RectI &updateRect) // Render the shape bounding box if ( mRenderBounds ) { - Point3F boxSize = mModel->getShape()->bounds.maxExtents - mModel->getShape()->bounds.minExtents; + Point3F boxSize = mModel->getShape()->mBounds.maxExtents - mModel->getShape()->mBounds.minExtents; GFXStateBlockDesc desc; desc.fillMode = GFXFillWireframe; - GFX->getDrawUtil()->drawCube( desc, boxSize, mModel->getShape()->center, ColorF::WHITE ); + GFX->getDrawUtil()->drawCube( desc, boxSize, mModel->getShape()->mCenter, ColorF::WHITE ); } // Render the selected object bounding box if ( mRenderObjBox && ( mSelectedObject != -1 ) ) { - const TSShape::Object& obj = mModel->getShape()->objects[mSelectedObject]; - const TSMesh* mesh = ( mCurrentDL < obj.numMeshes ) ? mModel->getShape()->meshes[obj.startMeshIndex + mSelectedObjDetail] : NULL; + const TSShape::Object& obj = mModel->getShape()->mObjects[mSelectedObject]; + const TSMesh* mesh = ( mCurrentDL < obj.numMeshes ) ? mModel->getShape()->mMeshes[obj.startMeshIndex + mSelectedObjDetail] : NULL; if ( mesh ) { GFX->pushWorldMatrix(); @@ -1528,7 +1528,7 @@ void GuiShapeEdPreview::renderSunDirection() const { // Render four arrows aiming in the direction of the sun's light ColorI color( mFakeSun->getColor() ); - F32 length = mModel->getShape()->bounds.len() * 0.8f; + F32 length = mModel->getShape()->mBounds.len() * 0.8f; // Get the sun's vectors Point3F fwd = mFakeSun->getTransform().getForwardVector(); @@ -1536,8 +1536,8 @@ void GuiShapeEdPreview::renderSunDirection() const Point3F right = mFakeSun->getTransform().getRightVector() * length / 8; // Calculate the start and end points of the first arrow (bottom left) - Point3F start = mModel->getShape()->center - fwd * length - up/2 - right/2; - Point3F end = mModel->getShape()->center - fwd * length / 3 - up/2 - right/2; + Point3F start = mModel->getShape()->mCenter - fwd * length - up/2 - right/2; + Point3F end = mModel->getShape()->mCenter - fwd * length / 3 - up/2 - right/2; GFXStateBlockDesc desc; desc.setZReadWrite( true, true ); @@ -1560,10 +1560,10 @@ void GuiShapeEdPreview::renderNodes() const GFX->setStateBlockByDesc( desc ); PrimBuild::color( ColorI::WHITE ); - PrimBuild::begin( GFXLineList, mModel->getShape()->nodes.size() * 2 ); - for ( S32 i = 0; i < mModel->getShape()->nodes.size(); i++) + PrimBuild::begin( GFXLineList, mModel->getShape()->mNodes.size() * 2 ); + for ( S32 i = 0; i < mModel->getShape()->mNodes.size(); i++) { - const TSShape::Node& node = mModel->getShape()->nodes[i]; + const TSShape::Node& node = mModel->getShape()->mNodes[i]; if (node.parentIndex >= 0) { Point3F start(mModel->mNodeTransforms[i].getPosition()); @@ -1576,7 +1576,7 @@ void GuiShapeEdPreview::renderNodes() const PrimBuild::end(); // Render the node axes - for ( S32 i = 0; i < mModel->getShape()->nodes.size(); i++) + for ( S32 i = 0; i < mModel->getShape()->mNodes.size(); i++) { // Render the selected and hover nodes last (so they are on top) if ( ( i == mSelectedNode ) || ( i == mHoverNode ) ) @@ -1626,7 +1626,7 @@ void GuiShapeEdPreview::renderNodeAxes(S32 index, const ColorF& nodeColor) const void GuiShapeEdPreview::renderNodeName(S32 index, const ColorF& textColor) const { - const TSShape::Node& node = mModel->getShape()->nodes[index]; + const TSShape::Node& node = mModel->getShape()->mNodes[index]; const String& nodeName = mModel->getShape()->getName( node.nameIndex ); Point2I pos( mProjectedNodes[index].x, mProjectedNodes[index].y + sNodeRectSize + 6 ); @@ -1641,9 +1641,9 @@ void GuiShapeEdPreview::renderCollisionMeshes() const { ConcretePolyList polylist; polylist.setTransform( &MatrixF::Identity, Point3F::One ); - for ( S32 iDet = 0; iDet < mModel->getShape()->details.size(); iDet++ ) + for ( S32 iDet = 0; iDet < mModel->getShape()->mDetails.size(); iDet++ ) { - const TSShape::Detail& det = mModel->getShape()->details[iDet]; + const TSShape::Detail& det = mModel->getShape()->mDetails[iDet]; const String& detName = mModel->getShape()->getName( det.nameIndex ); // Ignore non-collision details diff --git a/Engine/source/lighting/common/blobShadow.cpp b/Engine/source/lighting/common/blobShadow.cpp index 0dfce8b15..9e72d97ec 100644 --- a/Engine/source/lighting/common/blobShadow.cpp +++ b/Engine/source/lighting/common/blobShadow.cpp @@ -95,8 +95,8 @@ bool BlobShadow::shouldRender(F32 camDist) if (mShapeBase && mShapeBase->getFadeVal() < TSMesh::VISIBILITY_EPSILON) return false; - F32 shadowLen = 10.0f * mShapeInstance->getShape()->radius; - Point3F pos = mShapeInstance->getShape()->center; + F32 shadowLen = 10.0f * mShapeInstance->getShape()->mRadius; + Point3F pos = mShapeInstance->getShape()->mCenter; // this is a bit of a hack...move generic shadows towards feet/base of shape pos *= 0.5f; @@ -182,7 +182,7 @@ void BlobShadow::setRadius(F32 radius) void BlobShadow::setRadius(TSShapeInstance * shapeInstance, const Point3F & scale) { - const Box3F & bounds = shapeInstance->getShape()->bounds; + const Box3F & bounds = shapeInstance->getShape()->mBounds; F32 dx = 0.5f * (bounds.maxExtents.x-bounds.minExtents.x) * scale.x; F32 dy = 0.5f * (bounds.maxExtents.y-bounds.minExtents.y) * scale.y; F32 dz = 0.5f * (bounds.maxExtents.z-bounds.minExtents.z) * scale.z; diff --git a/Engine/source/ts/collada/colladaShapeLoader.cpp b/Engine/source/ts/collada/colladaShapeLoader.cpp index 8461b5954..e58dd050e 100644 --- a/Engine/source/ts/collada/colladaShapeLoader.cpp +++ b/Engine/source/ts/collada/colladaShapeLoader.cpp @@ -359,24 +359,24 @@ void ColladaShapeLoader::computeBounds(Box3F& bounds) bounds.maxExtents += shapeOffset; // Now adjust all positions for root level nodes (nodes with no parent) - for (S32 iNode = 0; iNode < mShape->nodes.size(); iNode++) + for (S32 iNode = 0; iNode < mShape->mNodes.size(); iNode++) { if ( !mAppNodes[iNode]->isParentRoot() ) continue; // Adjust default translation - mShape->defaultTranslations[iNode] += shapeOffset; + mShape->mDefaultTranslations[iNode] += shapeOffset; // Adjust animated translations - for (S32 iSeq = 0; iSeq < mShape->sequences.size(); iSeq++) + for (S32 iSeq = 0; iSeq < mShape->mSequences.size(); iSeq++) { - const TSShape::Sequence& seq = mShape->sequences[iSeq]; + const TSShape::Sequence& seq = mShape->mSequences[iSeq]; if ( seq.translationMatters.test(iNode) ) { for (S32 iFrame = 0; iFrame < seq.numKeyframes; iFrame++) { S32 index = seq.baseTranslation + seq.translationMatters.count(iNode)*seq.numKeyframes + iFrame; - mShape->nodeTranslations[index] += shapeOffset; + mShape->mNodeTranslations[index] += shapeOffset; } } } diff --git a/Engine/source/ts/loader/tsShapeLoader.cpp b/Engine/source/ts/loader/tsShapeLoader.cpp index 542c23530..8831fbbd1 100644 --- a/Engine/source/ts/loader/tsShapeLoader.cpp +++ b/Engine/source/ts/loader/tsShapeLoader.cpp @@ -252,7 +252,7 @@ void TSShapeLoader::recurseSubshape(AppNode* appNode, S32 parentIndex, bool recu if (appNode->isBounds()) return; - S32 subShapeNum = mShape->subShapeFirstNode.size()-1; + S32 subShapeNum = mShape->mSubShapeFirstNode.size()-1; Subshape* subshape = mSubShapes[subShapeNum]; // Check if we should collapse this node @@ -264,19 +264,19 @@ void TSShapeLoader::recurseSubshape(AppNode* appNode, S32 parentIndex, bool recu else { // Check that adding this node will not exceed the maximum node count - if (mShape->nodes.size() >= MAX_TS_SET_SIZE) + if (mShape->mNodes.size() >= MAX_TS_SET_SIZE) return; - myIndex = mShape->nodes.size(); - String nodeName = getUniqueName(appNode->getName(), cmpShapeName, mShape->names); + myIndex = mShape->mNodes.size(); + String nodeName = getUniqueName(appNode->getName(), cmpShapeName, mShape->mNames); // Create the 3space node - mShape->nodes.increment(); - mShape->nodes.last().nameIndex = mShape->addName(nodeName); - mShape->nodes.last().parentIndex = parentIndex; - mShape->nodes.last().firstObject = -1; - mShape->nodes.last().firstChild = -1; - mShape->nodes.last().nextSibling = -1; + mShape->mNodes.increment(); + mShape->mNodes.last().nameIndex = mShape->addName(nodeName); + mShape->mNodes.last().parentIndex = parentIndex; + mShape->mNodes.last().firstObject = -1; + mShape->mNodes.last().firstChild = -1; + mShape->mNodes.last().nextSibling = -1; // Add the AppNode to a matching list (so AppNodes can be accessed using 3space // node indices) @@ -312,12 +312,12 @@ void TSShapeLoader::recurseSubshape(AppNode* appNode, S32 parentIndex, bool recu appNode->getBool("BB::INCLUDE_POLES", includePoles); S32 detIndex = mShape->addDetail( "bbDetail", size, -1 ); - mShape->details[detIndex].bbEquatorSteps = numEquatorSteps; - mShape->details[detIndex].bbPolarSteps = numPolarSteps; - mShape->details[detIndex].bbDetailLevel = dl; - mShape->details[detIndex].bbDimension = dim; - mShape->details[detIndex].bbIncludePoles = includePoles; - mShape->details[detIndex].bbPolarAngle = polarAngle; + mShape->mDetails[detIndex].bbEquatorSteps = numEquatorSteps; + mShape->mDetails[detIndex].bbPolarSteps = numPolarSteps; + mShape->mDetails[detIndex].bbDetailLevel = dl; + mShape->mDetails[detIndex].bbDimension = dim; + mShape->mDetails[detIndex].bbIncludePoles = includePoles; + mShape->mDetails[detIndex].bbPolarAngle = polarAngle; } } } @@ -351,15 +351,15 @@ void TSShapeLoader::generateSubshapes() // Recurse through the node hierarchy, adding 3space nodes and // collecting geometry - S32 firstNode = mShape->nodes.size(); - mShape->subShapeFirstNode.push_back(firstNode); + S32 firstNode = mShape->mNodes.size(); + mShape->mSubShapeFirstNode.push_back(firstNode); for (U32 iBranch = 0; iBranch < subshape->branches.size(); iBranch++) recurseSubshape(subshape->branches[iBranch], -1, true); - mShape->subShapeNumNodes.push_back(mShape->nodes.size() - firstNode); + mShape->mSubShapeNumNodes.push_back(mShape->mNodes.size() - firstNode); - if (mShape->nodes.size() >= MAX_TS_SET_SIZE) + if (mShape->mNodes.size() >= MAX_TS_SET_SIZE) { Con::warnf("Shape exceeds the maximum node count (%d). Ignoring additional nodes.", MAX_TS_SET_SIZE); @@ -389,7 +389,7 @@ void TSShapeLoader::generateObjects() for (S32 iSub = 0; iSub < mSubShapes.size(); iSub++) { Subshape* subshape = mSubShapes[iSub]; - mShape->subShapeFirstObject.push_back(mShape->objects.size()); + mShape->mSubShapeFirstObject.push_back(mShape->mObjects.size()); // Get the names and sizes of the meshes for this subshape Vector meshNames; @@ -450,17 +450,17 @@ void TSShapeLoader::generateObjects() if (!lastName || (meshNames[iMesh] != *lastName)) { - mShape->objects.increment(); - mShape->objects.last().nameIndex = mShape->addName(meshNames[iMesh]); - mShape->objects.last().nodeIndex = subshape->objNodes[iMesh]; - mShape->objects.last().startMeshIndex = mAppMeshes.size(); - mShape->objects.last().numMeshes = 0; + mShape->mObjects.increment(); + mShape->mObjects.last().nameIndex = mShape->addName(meshNames[iMesh]); + mShape->mObjects.last().nodeIndex = subshape->objNodes[iMesh]; + mShape->mObjects.last().startMeshIndex = mAppMeshes.size(); + mShape->mObjects.last().numMeshes = 0; lastName = &meshNames[iMesh]; } // Add this mesh to the object mAppMeshes.push_back(mesh); - mShape->objects.last().numMeshes++; + mShape->mObjects.last().numMeshes++; // Set mesh flags mesh->mFlags = 0; @@ -483,9 +483,9 @@ void TSShapeLoader::generateObjects() } // Attempt to add the detail (will fail if it already exists) - S32 oldNumDetails = mShape->details.size(); + S32 oldNumDetails = mShape->mDetails.size(); mShape->addDetail(detailName, mesh->mDetailSize, iSub); - if (mShape->details.size() > oldNumDetails) + if (mShape->mDetails.size() > oldNumDetails) { Con::warnf("Object mesh \"%s\" has no matching detail (\"%s%d\" has" " been added automatically)", mesh->getName(false), detailName, mesh->mDetailSize); @@ -493,18 +493,18 @@ void TSShapeLoader::generateObjects() } // Get object count for this subshape - mShape->subShapeNumObjects.push_back(mShape->objects.size() - mShape->subShapeFirstObject.last()); + mShape->mSubShapeNumObjects.push_back(mShape->mObjects.size() - mShape->mSubShapeFirstObject.last()); } } void TSShapeLoader::generateSkins() { Vector skins; - for (S32 iObject = 0; iObject < mShape->objects.size(); iObject++) + for (S32 iObject = 0; iObject < mShape->mObjects.size(); iObject++) { - for (S32 iMesh = 0; iMesh < mShape->objects[iObject].numMeshes; iMesh++) + for (S32 iMesh = 0; iMesh < mShape->mObjects[iObject].numMeshes; iMesh++) { - AppMesh* mesh = mAppMeshes[mShape->objects[iObject].startMeshIndex + iMesh]; + AppMesh* mesh = mAppMeshes[mShape->mObjects[iObject].startMeshIndex + iMesh]; if (mesh->isSkin()) skins.push_back(mesh); } @@ -551,12 +551,12 @@ void TSShapeLoader::generateSkins() void TSShapeLoader::generateDefaultStates() { // Generate default object states (includes initial geometry) - for (S32 iObject = 0; iObject < mShape->objects.size(); iObject++) + for (S32 iObject = 0; iObject < mShape->mObjects.size(); iObject++) { updateProgress(Load_GenerateDefaultStates, "Generating initial mesh and node states...", - mShape->objects.size(), iObject); + mShape->mObjects.size(), iObject); - TSShape::Object& obj = mShape->objects[iObject]; + TSShape::Object& obj = mShape->mObjects[iObject]; // Calculate the objectOffset for each mesh at T=0 for (S32 iMesh = 0; iMesh < obj.numMeshes; iMesh++) @@ -572,7 +572,7 @@ void TSShapeLoader::generateDefaultStates() appMesh->mObjectOffset = nodeMat.inverse() * meshMat; } - generateObjectState(mShape->objects[iObject], smDefaultTime, true, true); + generateObjectState(mShape->mObjects[iObject], smDefaultTime, true, true); } // Generate default node transforms @@ -591,8 +591,8 @@ void TSShapeLoader::generateDefaultStates() void TSShapeLoader::generateObjectState(TSShape::Object& obj, F32 t, bool addFrame, bool addMatFrame) { - mShape->objectStates.increment(); - TSShape::ObjectState& state = mShape->objectStates.last(); + mShape->mObjectStates.increment(); + TSShape::ObjectState& state = mShape->mObjectStates.last(); state.frameIndex = 0; state.matFrameIndex = 0; @@ -689,13 +689,13 @@ void TSShapeLoader::generateFrame(TSShape::Object& obj, F32 t, bool addFrame, bo void TSShapeLoader::generateMaterialList() { // Install the materials into the material list - mShape->materialList = new TSMaterialList; + mShape->mMaterialList = new TSMaterialList; for (S32 iMat = 0; iMat < AppMesh::mAppMaterials.size(); iMat++) { updateProgress(Load_GenerateMaterials, "Generating materials...", AppMesh::mAppMaterials.size(), iMat); AppMaterial* appMat = AppMesh::mAppMaterials[iMat]; - mShape->materialList->push_back(appMat->getName(), appMat->getFlags(), U32(-1), U32(-1), U32(-1), 1.0f, appMat->getReflectance()); + mShape->mMaterialList->push_back(appMat->getName(), appMat->getFlags(), U32(-1), U32(-1), U32(-1), 1.0f, appMat->getReflectance()); } } @@ -712,8 +712,8 @@ void TSShapeLoader::generateSequences() // Initialize the sequence mAppSequences[iSeq]->setActive(true); - mShape->sequences.increment(); - TSShape::Sequence& seq = mShape->sequences.last(); + mShape->mSequences.increment(); + TSShape::Sequence& seq = mShape->mSequences.last(); seq.nameIndex = mShape->addName(mAppSequences[iSeq]->getName()); seq.toolBegin = mAppSequences[iSeq]->getStart(); @@ -788,7 +788,7 @@ void TSShapeLoader::setRotationMembership(TSShape::Sequence& seq) // Check if any of the node rotations are different to // the default rotation QuatF defaultRot; - mShape->defaultRotations[iNode].getQuatF(&defaultRot); + mShape->mDefaultRotations[iNode].getQuatF(&defaultRot); for (S32 iFrame = 0; iFrame < seq.numKeyframes; iFrame++) { @@ -807,7 +807,7 @@ void TSShapeLoader::setTranslationMembership(TSShape::Sequence& seq) { // Check if any of the node translations are different to // the default translation - Point3F& defaultTrans = mShape->defaultTranslations[iNode]; + Point3F& defaultTrans = mShape->mDefaultTranslations[iNode]; for (S32 iFrame = 0; iFrame < seq.numKeyframes; iFrame++) { @@ -865,12 +865,12 @@ void TSShapeLoader::setObjectMembership(TSShape::Sequence& seq, const AppSequenc seq.frameMatters.clearAll(); // vert animation (morph) (size = objects.size()) seq.matFrameMatters.clearAll(); // UV animation (size = objects.size()) - for (S32 iObject = 0; iObject < mShape->objects.size(); iObject++) + for (S32 iObject = 0; iObject < mShape->mObjects.size(); iObject++) { - if (!mAppMeshes[mShape->objects[iObject].startMeshIndex]) + if (!mAppMeshes[mShape->mObjects[iObject].startMeshIndex]) continue; - if (mAppMeshes[mShape->objects[iObject].startMeshIndex]->animatesVis(appSeq)) + if (mAppMeshes[mShape->mObjects[iObject].startMeshIndex]->animatesVis(appSeq)) seq.visMatters.set(iObject); // Morph and UV animation has been deprecated //if (appMeshes[shape->objects[iObject].startMeshIndex]->animatesFrame(appSeq)) @@ -934,44 +934,44 @@ void TSShapeLoader::addNodeRotation(QuatF& rot, bool defaultVal) rot16.set(rot); if (!defaultVal) - mShape->nodeRotations.push_back(rot16); + mShape->mNodeRotations.push_back(rot16); else - mShape->defaultRotations.push_back(rot16); + mShape->mDefaultRotations.push_back(rot16); } void TSShapeLoader::addNodeTranslation(Point3F& trans, bool defaultVal) { if (!defaultVal) - mShape->nodeTranslations.push_back(trans); + mShape->mNodeTranslations.push_back(trans); else - mShape->defaultTranslations.push_back(trans); + mShape->mDefaultTranslations.push_back(trans); } void TSShapeLoader::addNodeUniformScale(F32 scale) { - mShape->nodeUniformScales.push_back(scale); + mShape->mNodeUniformScales.push_back(scale); } void TSShapeLoader::addNodeAlignedScale(Point3F& scale) { - mShape->nodeAlignedScales.push_back(scale); + mShape->mNodeAlignedScales.push_back(scale); } void TSShapeLoader::addNodeArbitraryScale(QuatF& qrot, Point3F& scale) { Quat16 rot16; rot16.set(qrot); - mShape->nodeArbitraryScaleRots.push_back(rot16); - mShape->nodeArbitraryScaleFactors.push_back(scale); + mShape->mNodeArbitraryScaleRots.push_back(rot16); + mShape->mNodeArbitraryScaleFactors.push_back(scale); } void TSShapeLoader::generateNodeAnimation(TSShape::Sequence& seq) { - seq.baseRotation = mShape->nodeRotations.size(); - seq.baseTranslation = mShape->nodeTranslations.size(); - seq.baseScale = (seq.flags & TSShape::ArbitraryScale) ? mShape->nodeArbitraryScaleRots.size() : - (seq.flags & TSShape::AlignedScale) ? mShape->nodeAlignedScales.size() : - mShape->nodeUniformScales.size(); + seq.baseRotation = mShape->mNodeRotations.size(); + seq.baseTranslation = mShape->mNodeTranslations.size(); + seq.baseScale = (seq.flags & TSShape::ArbitraryScale) ? mShape->mNodeArbitraryScaleRots.size() : + (seq.flags & TSShape::AlignedScale) ? mShape->mNodeAlignedScales.size() : + mShape->mNodeUniformScales.size(); for (S32 iNode = 0; iNode < mAppNodes.size(); iNode++) { @@ -999,9 +999,9 @@ void TSShapeLoader::generateNodeAnimation(TSShape::Sequence& seq) void TSShapeLoader::generateObjectAnimation(TSShape::Sequence& seq, const AppSequence* appSeq) { - seq.baseObjectState = mShape->objectStates.size(); + seq.baseObjectState = mShape->mObjectStates.size(); - for (S32 iObject = 0; iObject < mShape->objects.size(); iObject++) + for (S32 iObject = 0; iObject < mShape->mObjects.size(); iObject++) { bool visMatters = seq.visMatters.test(iObject); bool frameMatters = seq.frameMatters.test(iObject); @@ -1012,7 +1012,7 @@ void TSShapeLoader::generateObjectAnimation(TSShape::Sequence& seq, const AppSeq for (S32 iFrame = 0; iFrame < seq.numKeyframes; iFrame++) { F32 time = appSeq->getStart() + seq.duration * iFrame / getMax(1, seq.numKeyframes - 1); - generateObjectState(mShape->objects[iObject], time, frameMatters, matFrameMatters); + generateObjectState(mShape->mObjects[iObject], time, frameMatters, matFrameMatters); } } } @@ -1020,7 +1020,7 @@ void TSShapeLoader::generateObjectAnimation(TSShape::Sequence& seq, const AppSeq void TSShapeLoader::generateGroundAnimation(TSShape::Sequence& seq, const AppSequence* appSeq) { - seq.firstGroundFrame = mShape->groundTranslations.size(); + seq.firstGroundFrame = mShape->mGroundTranslations.size(); seq.numGroundFrames = 0; if (!mBoundsNode) @@ -1048,15 +1048,15 @@ void TSShapeLoader::generateGroundAnimation(TSShape::Sequence& seq, const AppSeq // Add ground transform Quat16 rotation; rotation.set(QuatF(mat)); - mShape->groundTranslations.push_back(mat.getPosition()); - mShape->groundRotations.push_back(rotation); + mShape->mGroundTranslations.push_back(mat.getPosition()); + mShape->mGroundRotations.push_back(rotation); } } void TSShapeLoader::generateFrameTriggers(TSShape::Sequence& seq, const AppSequence* appSeq) { // Initialize triggers - seq.firstTrigger = mShape->triggers.size(); + seq.firstTrigger = mShape->mTriggers.size(); seq.numTriggers = appSeq->getNumTriggers(); if (!seq.numTriggers) return; @@ -1066,8 +1066,8 @@ void TSShapeLoader::generateFrameTriggers(TSShape::Sequence& seq, const AppSeque // Add triggers for (S32 iTrigger = 0; iTrigger < seq.numTriggers; iTrigger++) { - mShape->triggers.increment(); - appSeq->getTrigger(iTrigger, mShape->triggers.last()); + mShape->mTriggers.increment(); + appSeq->getTrigger(iTrigger, mShape->mTriggers.last()); } // Track the triggers that get turned off by this shape...normally, triggers @@ -1077,7 +1077,7 @@ void TSShapeLoader::generateFrameTriggers(TSShape::Sequence& seq, const AppSeque U32 offTriggers = 0; for (S32 iTrigger = 0; iTrigger < seq.numTriggers; iTrigger++) { - U32 state = mShape->triggers[seq.firstTrigger+iTrigger].state; + U32 state = mShape->mTriggers[seq.firstTrigger+iTrigger].state; if ((state & TSShape::Trigger::StateOn) == 0) offTriggers |= (state & TSShape::Trigger::StateMask); } @@ -1085,8 +1085,8 @@ void TSShapeLoader::generateFrameTriggers(TSShape::Sequence& seq, const AppSeque // We now know which states are turned off, set invert on all those (including when turned on) for (int iTrigger = 0; iTrigger < seq.numTriggers; iTrigger++) { - if (mShape->triggers[seq.firstTrigger + iTrigger].state & offTriggers) - mShape->triggers[seq.firstTrigger + iTrigger].state |= TSShape::Trigger::InvertOnReverse; + if (mShape->mTriggers[seq.firstTrigger + iTrigger].state & offTriggers) + mShape->mTriggers[seq.firstTrigger + iTrigger].state |= TSShape::Trigger::InvertOnReverse; } } @@ -1105,29 +1105,29 @@ void TSShapeLoader::sortDetails() for (S32 iDet = 0; iDet < validDetails.size(); iDet++) { - TSShape::Detail &detail = mShape->details[validDetails[iDet]]; + TSShape::Detail &detail = mShape->mDetails[validDetails[iDet]]; if (detail.subShapeNum >= 0) detail.objectDetailNum = iDet; - for (S32 iObj = mShape->subShapeFirstObject[iSub]; - iObj < (mShape->subShapeFirstObject[iSub] + mShape->subShapeNumObjects[iSub]); + for (S32 iObj = mShape->mSubShapeFirstObject[iSub]; + iObj < (mShape->mSubShapeFirstObject[iSub] + mShape->mSubShapeNumObjects[iSub]); iObj++) { - TSShape::Object &object = mShape->objects[iObj]; + TSShape::Object &object = mShape->mObjects[iObj]; // Insert a NULL mesh for this detail level if required (ie. if the // object does not already have a mesh with an equal or higher detail) S32 meshIndex = (iDet < object.numMeshes) ? iDet : object.numMeshes-1; - if (mAppMeshes[object.startMeshIndex + meshIndex]->mDetailSize < mShape->details[iDet].size) + if (mAppMeshes[object.startMeshIndex + meshIndex]->mDetailSize < mShape->mDetails[iDet].size) { // Add a NULL mesh mAppMeshes.insert(object.startMeshIndex + iDet, NULL); object.numMeshes++; // Fixup the start index for the other objects - for (S32 k = iObj+1; k < mShape->objects.size(); k++) - mShape->objects[k].startMeshIndex++; + for (S32 k = iObj+1; k < mShape->mObjects.size(); k++) + mShape->mObjects[k].startMeshIndex++; } } } @@ -1142,20 +1142,20 @@ void TSShapeLoader::install() { // Arrays that are filled in by ts shape init, but need // to be allocated beforehand. - mShape->subShapeFirstTranslucentObject.setSize(mShape->subShapeFirstObject.size()); + mShape->mSubShapeFirstTranslucentObject.setSize(mShape->mSubShapeFirstObject.size()); // Construct TS sub-meshes - mShape->meshes.setSize(mAppMeshes.size()); + mShape->mMeshes.setSize(mAppMeshes.size()); for (U32 m = 0; m < mAppMeshes.size(); m++) - mShape->meshes[m] = mAppMeshes[m] ? mAppMeshes[m]->constructTSMesh() : NULL; + mShape->mMeshes[m] = mAppMeshes[m] ? mAppMeshes[m]->constructTSMesh() : NULL; // Remove empty meshes and objects - for (S32 iObj = mShape->objects.size()-1; iObj >= 0; iObj--) + for (S32 iObj = mShape->mObjects.size()-1; iObj >= 0; iObj--) { - TSShape::Object& obj = mShape->objects[iObj]; + TSShape::Object& obj = mShape->mObjects[iObj]; for (S32 iMesh = obj.numMeshes-1; iMesh >= 0; iMesh--) { - TSMesh *mesh = mShape->meshes[obj.startMeshIndex + iMesh]; + TSMesh *mesh = mShape->mMeshes[obj.startMeshIndex + iMesh]; if (mesh && !mesh->mPrimitives.size()) { @@ -1171,45 +1171,45 @@ void TSShapeLoader::install() } // Add a dummy object if needed so the shape loads and renders ok - if (!mShape->details.size()) + if (!mShape->mDetails.size()) { mShape->addDetail("detail", 2, 0); - mShape->subShapeNumObjects.last() = 1; + mShape->mSubShapeNumObjects.last() = 1; - mShape->meshes.push_back(NULL); + mShape->mMeshes.push_back(NULL); - mShape->objects.increment(); - mShape->objects.last().nameIndex = mShape->addName("dummy"); - mShape->objects.last().nodeIndex = 0; - mShape->objects.last().startMeshIndex = 0; - mShape->objects.last().numMeshes = 1; + mShape->mObjects.increment(); + mShape->mObjects.last().nameIndex = mShape->addName("dummy"); + mShape->mObjects.last().nodeIndex = 0; + mShape->mObjects.last().startMeshIndex = 0; + mShape->mObjects.last().numMeshes = 1; - mShape->objectStates.increment(); - mShape->objectStates.last().frameIndex = 0; - mShape->objectStates.last().matFrameIndex = 0; - mShape->objectStates.last().vis = 1.0f; + mShape->mObjectStates.increment(); + mShape->mObjectStates.last().frameIndex = 0; + mShape->mObjectStates.last().matFrameIndex = 0; + mShape->mObjectStates.last().vis = 1.0f; } // Update smallest visible detail mShape->mSmallestVisibleDL = -1; mShape->mSmallestVisibleSize = 999999; - for (S32 i = 0; i < mShape->details.size(); i++) + for (S32 i = 0; i < mShape->mDetails.size(); i++) { - if ((mShape->details[i].size >= 0) && - (mShape->details[i].size < mShape->mSmallestVisibleSize)) + if ((mShape->mDetails[i].size >= 0) && + (mShape->mDetails[i].size < mShape->mSmallestVisibleSize)) { mShape->mSmallestVisibleDL = i; - mShape->mSmallestVisibleSize = mShape->details[i].size; + mShape->mSmallestVisibleSize = mShape->mDetails[i].size; } } - computeBounds(mShape->bounds); - if (!mShape->bounds.isValidBox()) - mShape->bounds = Box3F(1.0f); + computeBounds(mShape->mBounds); + if (!mShape->mBounds.isValidBox()) + mShape->mBounds = Box3F(1.0f); - mShape->bounds.getCenter(&mShape->center); - mShape->radius = (mShape->bounds.maxExtents - mShape->center).len(); - mShape->tubeRadius = mShape->radius; + mShape->mBounds.getCenter(&mShape->mCenter); + mShape->mRadius = (mShape->mBounds.maxExtents - mShape->mCenter).len(); + mShape->mTubeRadius = mShape->mRadius; mShape->init(); } diff --git a/Engine/source/ts/tsAnimate.cpp b/Engine/source/ts/tsAnimate.cpp index 8c80fea18..4d1a51a03 100644 --- a/Engine/source/ts/tsAnimate.cpp +++ b/Engine/source/ts/tsAnimate.cpp @@ -43,14 +43,14 @@ void TSShapeInstance::sortThreads() void TSShapeInstance::setDirty(U32 dirty) { AssertFatal((dirty & AllDirtyMask) == dirty,"TSShapeInstance::setDirty: illegal dirty flags"); - for (S32 i=0; isubShapeFirstNode.size(); i++) + for (S32 i=0; imSubShapeFirstNode.size(); i++) mDirtyFlags[i] |= dirty; } void TSShapeInstance::clearDirty(U32 dirty) { AssertFatal((dirty & AllDirtyMask) == dirty,"TSShapeInstance::clearDirty: illegal dirty flags"); - for (S32 i=0; isubShapeFirstNode.size(); i++) + for (S32 i=0; imSubShapeFirstNode.size(); i++) mDirtyFlags[i] &= ~dirty; } @@ -62,25 +62,25 @@ void TSShapeInstance::animateNodes(S32 ss) { PROFILE_SCOPE( TSShapeInstance_animateNodes ); - if (!mShape->nodes.size()) + if (!mShape->mNodes.size()) return; // @todo: When a node is added, we need to make sure to resize the nodeTransforms array as well - mNodeTransforms.setSize(mShape->nodes.size()); + mNodeTransforms.setSize(mShape->mNodes.size()); // temporary storage for node transforms - smNodeCurrentRotations.setSize(mShape->nodes.size()); - smNodeCurrentTranslations.setSize(mShape->nodes.size()); - smNodeLocalTransforms.setSize(mShape->nodes.size()); - smRotationThreads.setSize(mShape->nodes.size()); - smTranslationThreads.setSize(mShape->nodes.size()); + smNodeCurrentRotations.setSize(mShape->mNodes.size()); + smNodeCurrentTranslations.setSize(mShape->mNodes.size()); + smNodeLocalTransforms.setSize(mShape->mNodes.size()); + smRotationThreads.setSize(mShape->mNodes.size()); + smTranslationThreads.setSize(mShape->mNodes.size()); TSIntegerSet rotBeenSet; TSIntegerSet tranBeenSet; TSIntegerSet scaleBeenSet; - rotBeenSet.setAll(mShape->nodes.size()); - tranBeenSet.setAll(mShape->nodes.size()); - scaleBeenSet.setAll(mShape->nodes.size()); + rotBeenSet.setAll(mShape->mNodes.size()); + tranBeenSet.setAll(mShape->mNodes.size()); + scaleBeenSet.setAll(mShape->mNodes.size()); smNodeLocalTransformDirty.clearAll(); S32 i,j,nodeIndex,a,b,start,end,firstBlend = mThreadList.size(); @@ -114,18 +114,18 @@ void TSShapeInstance::animateNodes(S32 ss) // we'll set default regardless of mask status // all the nodes marked above need to have the default transform - a = mShape->subShapeFirstNode[ss]; - b = a + mShape->subShapeNumNodes[ss]; + a = mShape->mSubShapeFirstNode[ss]; + b = a + mShape->mSubShapeNumNodes[ss]; for (i=a; idefaultRotations[i].getQuatF(&smNodeCurrentRotations[i]); + mShape->mDefaultRotations[i].getQuatF(&smNodeCurrentRotations[i]); smRotationThreads[i] = NULL; } if (tranBeenSet.test(i)) { - smNodeCurrentTranslations[i] = mShape->defaultTranslations[i]; + smNodeCurrentTranslations[i] = mShape->mDefaultTranslations[i]; smTranslationThreads[i] = NULL; } } @@ -235,7 +235,7 @@ void TSShapeInstance::animateNodes(S32 ss) // multiply transforms... for (i=a; inodes[i].parentIndex; + S32 parentIdx = mShape->mNodes[i].parentIndex; if (parentIdx < 0) mNodeTransforms[i] = smNodeLocalTransforms[i]; else @@ -248,12 +248,12 @@ void TSShapeInstance::handleDefaultScale(S32 a, S32 b, TSIntegerSet & scaleBeenS // set default scale values (i.e., identity) and do any initialization // relating to animated scale (since scale normally not animated) - smScaleThreads.setSize(mShape->nodes.size()); + smScaleThreads.setSize(mShape->mNodes.size()); scaleBeenSet.takeAway(mCallbackNodes); scaleBeenSet.takeAway(mHandsOffNodes); if (animatesUniformScale()) { - smNodeCurrentUniformScales.setSize(mShape->nodes.size()); + smNodeCurrentUniformScales.setSize(mShape->mNodes.size()); for (S32 i=a; inodes.size()); + smNodeCurrentAlignedScales.setSize(mShape->mNodes.size()); for (S32 i=a; inodes.size()); + smNodeCurrentArbitraryScales.setSize(mShape->mNodes.size()); for (S32 i=a; igetSequence()->visMatters); // set defaults - S32 a = mShape->subShapeFirstObject[ss]; - S32 b = a + mShape->subShapeNumObjects[ss]; + S32 a = mShape->mSubShapeFirstObject[ss]; + S32 b = a + mShape->mSubShapeNumObjects[ss]; for (i=a; iobjectStates[i].vis; + mMeshObjects[i].visible = mShape->mObjectStates[i].vis; } // go through each thread and set visibility on those objects that @@ -735,11 +735,11 @@ void TSShapeInstance::animateFrame(S32 ss) beenSet.takeAway(mThreadList[i]->getSequence()->frameMatters); // set defaults - S32 a = mShape->subShapeFirstObject[ss]; - S32 b = a + mShape->subShapeNumObjects[ss]; + S32 a = mShape->mSubShapeFirstObject[ss]; + S32 b = a + mShape->mSubShapeNumObjects[ss]; for (i=a; iobjectStates[i].frameIndex; + mMeshObjects[i].frame = mShape->mObjectStates[i].frameIndex; // go through each thread and set frame on those objects that // are not set yet and are controlled by that thread @@ -790,11 +790,11 @@ void TSShapeInstance::animateMatFrame(S32 ss) beenSet.takeAway(mThreadList[i]->getSequence()->matFrameMatters); // set defaults - S32 a = mShape->subShapeFirstObject[ss]; - S32 b = a + mShape->subShapeNumObjects[ss]; + S32 a = mShape->mSubShapeFirstObject[ss]; + S32 b = a + mShape->mSubShapeNumObjects[ss]; for (i=a; iobjectStates[i].matFrameIndex; + mMeshObjects[i].matFrame = mShape->mObjectStates[i].matFrameIndex; // go through each thread and set matFrame on those objects that // are not set yet and are controlled by that thread @@ -842,7 +842,7 @@ void TSShapeInstance::animate(S32 dl) // nothing to do return; - S32 ss = mShape->details[dl].subShapeNum; + S32 ss = mShape->mDetails[dl].subShapeNum; // this is a billboard detail... if (ss<0) @@ -878,7 +878,7 @@ void TSShapeInstance::animateNodeSubtrees(bool forceFull) // force transforms to animate setDirty(TransformDirty); - for (S32 i=0; isubShapeNumNodes.size(); i++) + for (S32 i=0; imSubShapeNumNodes.size(); i++) { if (mDirtyFlags[i] & TransformDirty) { @@ -896,7 +896,7 @@ void TSShapeInstance::animateSubtrees(bool forceFull) // force full animate setDirty(AllDirtyMask); - for (S32 i=0; isubShapeNumNodes.size(); i++) + for (S32 i=0; imSubShapeNumNodes.size(); i++) { if (mDirtyFlags[i] & TransformDirty) { diff --git a/Engine/source/ts/tsCollision.cpp b/Engine/source/ts/tsCollision.cpp index 47cf594ed..fd3b17b06 100644 --- a/Engine/source/ts/tsCollision.cpp +++ b/Engine/source/ts/tsCollision.cpp @@ -52,10 +52,10 @@ bool TSShapeInstance::buildPolyList(AbstractPolyList * polyList, S32 dl) if (dl==-1) return false; - AssertFatal(dl>=0 && dldetails.size(),"TSShapeInstance::buildPolyList"); + AssertFatal(dl>=0 && dlmDetails.size(),"TSShapeInstance::buildPolyList"); // get subshape and object detail - const TSDetail * detail = &mShape->details[dl]; + const TSDetail * detail = &mShape->mDetails[dl]; S32 ss = detail->subShapeNum; S32 od = detail->objectDetailNum; @@ -67,8 +67,8 @@ bool TSShapeInstance::buildPolyList(AbstractPolyList * polyList, S32 dl) bool emitted = false; U32 surfaceKey = 0; - S32 start = mShape->subShapeFirstObject[ss]; - S32 end = mShape->subShapeNumObjects[ss] + start; + S32 start = mShape->mSubShapeFirstObject[ss]; + S32 end = mShape->mSubShapeNumObjects[ss] + start; if (start=0 && dldetails.size(),"TSShapeInstance::buildPolyList"); + AssertFatal(dl>=0 && dlmDetails.size(),"TSShapeInstance::buildPolyList"); // get subshape and object detail - const TSDetail * detail = &mShape->details[dl]; + const TSDetail * detail = &mShape->mDetails[dl]; S32 ss = detail->subShapeNum; S32 od = detail->objectDetailNum; @@ -135,8 +135,8 @@ bool TSShapeInstance::getFeatures(const MatrixF& mat, const Point3F& n, ConvexFe bool emitted = false; U32 surfaceKey = 0; - S32 start = mShape->subShapeFirstObject[ss]; - S32 end = mShape->subShapeNumObjects[ss] + start; + S32 start = mShape->mSubShapeFirstObject[ss]; + S32 end = mShape->mSubShapeNumObjects[ss] + start; if (start=0 && dldetails.size(),"TSShapeInstance::castRay"); + AssertFatal(dl>=0 && dlmDetails.size(),"TSShapeInstance::castRay"); // get subshape and object detail - const TSDetail * detail = &mShape->details[dl]; + const TSDetail * detail = &mShape->mDetails[dl]; S32 ss = detail->subShapeNum; S32 od = detail->objectDetailNum; @@ -179,8 +179,8 @@ bool TSShapeInstance::castRay(const Point3F & a, const Point3F & b, RayInfo * ra if ( ss < 0 ) return false; - S32 start = mShape->subShapeFirstObject[ss]; - S32 end = mShape->subShapeNumObjects[ss] + start; + S32 start = mShape->mSubShapeFirstObject[ss]; + S32 end = mShape->mSubShapeNumObjects[ss] + start; RayInfo saveRay; saveRay.t = 1.0f; const MatrixF * saveMat = NULL; @@ -255,18 +255,18 @@ bool TSShapeInstance::castRayRendered(const Point3F & a, const Point3F & b, RayI if (dl==-1) return false; - AssertFatal(dl>=0 && dldetails.size(),"TSShapeInstance::castRayRendered"); + AssertFatal(dl>=0 && dlmDetails.size(),"TSShapeInstance::castRayRendered"); // get subshape and object detail - const TSDetail * detail = &mShape->details[dl]; + const TSDetail * detail = &mShape->mDetails[dl]; S32 ss = detail->subShapeNum; S32 od = detail->objectDetailNum; if ( ss == -1 ) return false; - S32 start = mShape->subShapeFirstObject[ss]; - S32 end = mShape->subShapeNumObjects[ss] + start; + S32 start = mShape->mSubShapeFirstObject[ss]; + S32 end = mShape->mSubShapeNumObjects[ss] + start; RayInfo saveRay; saveRay.t = 1.0f; const MatrixF * saveMat = NULL; @@ -339,15 +339,15 @@ Point3F TSShapeInstance::support(const Point3F & v, S32 dl) { // if dl==-1, nothing to do AssertFatal(dl != -1, "Error, should never try to collide with a non-existant detail level!"); - AssertFatal(dl>=0 && dldetails.size(),"TSShapeInstance::support"); + AssertFatal(dl>=0 && dlmDetails.size(),"TSShapeInstance::support"); // get subshape and object detail - const TSDetail * detail = &mShape->details[dl]; + const TSDetail * detail = &mShape->mDetails[dl]; S32 ss = detail->subShapeNum; S32 od = detail->objectDetailNum; - S32 start = mShape->subShapeFirstObject[ss]; - S32 end = mShape->subShapeNumObjects[ss] + start; + S32 start = mShape->mSubShapeFirstObject[ss]; + S32 end = mShape->mSubShapeNumObjects[ss] + start; F32 currMaxDP = -1e9f; Point3F currSupport = Point3F(0, 0, 0); @@ -404,22 +404,22 @@ void TSShapeInstance::computeBounds(S32 dl, Box3F & bounds) if (dl==-1) return; - AssertFatal(dl>=0 && dldetails.size(),"TSShapeInstance::computeBounds"); + AssertFatal(dl>=0 && dlmDetails.size(),"TSShapeInstance::computeBounds"); // get subshape and object detail - const TSDetail * detail = &mShape->details[dl]; + const TSDetail * detail = &mShape->mDetails[dl]; S32 ss = detail->subShapeNum; S32 od = detail->objectDetailNum; // use shape bounds for imposter details if (ss < 0) { - bounds = mShape->bounds; + bounds = mShape->mBounds; return; } - S32 start = mShape->subShapeFirstObject[ss]; - S32 end = mShape->subShapeNumObjects[ss] + start; + S32 start = mShape->mSubShapeFirstObject[ss]; + S32 end = mShape->mSubShapeNumObjects[ss] + start; // run through objects and updating bounds as we go bounds.minExtents.set( 10E30f, 10E30f, 10E30f); @@ -587,10 +587,10 @@ bool TSShapeInstance::buildPolyListOpcode( S32 dl, AbstractPolyList *polyList, c if (dl==-1) return false; - AssertFatal(dl>=0 && dldetails.size(),"TSShapeInstance::buildPolyListOpcode"); + AssertFatal(dl>=0 && dlmDetails.size(),"TSShapeInstance::buildPolyListOpcode"); // get subshape and object detail - const TSDetail * detail = &mShape->details[dl]; + const TSDetail * detail = &mShape->mDetails[dl]; S32 ss = detail->subShapeNum; if ( ss < 0 ) return false; @@ -600,8 +600,8 @@ bool TSShapeInstance::buildPolyListOpcode( S32 dl, AbstractPolyList *polyList, c // nothing emitted yet... bool emitted = false; - S32 start = mShape->subShapeFirstObject[ss]; - S32 end = mShape->subShapeNumObjects[ss] + start; + S32 start = mShape->mSubShapeFirstObject[ss]; + S32 end = mShape->mSubShapeNumObjects[ss] + start; if (start=0 && dldetails.size(),"TSShapeInstance::castRayOpcode"); + AssertFatal(dl>=0 && dlmDetails.size(),"TSShapeInstance::castRayOpcode"); info->t = 100.f; // get subshape and object detail - const TSDetail * detail = &mShape->details[dl]; + const TSDetail * detail = &mShape->mDetails[dl]; S32 ss = detail->subShapeNum; if ( ss < 0 ) return false; @@ -686,8 +686,8 @@ bool TSShapeInstance::castRayOpcode( S32 dl, const Point3F & startPos, const Poi bool emitted = false; const MatrixF* saveMat = NULL; - S32 start = mShape->subShapeFirstObject[ss]; - S32 end = mShape->subShapeNumObjects[ss] + start; + S32 start = mShape->mSubShapeFirstObject[ss]; + S32 end = mShape->mSubShapeNumObjects[ss] + start; if (start=0 && dldetails.size(),"TSShapeInstance::buildConvexOpcode"); + AssertFatal(dl>=0 && dlmDetails.size(),"TSShapeInstance::buildConvexOpcode"); // get subshape and object detail - const TSDetail * detail = &mShape->details[dl]; + const TSDetail * detail = &mShape->mDetails[dl]; S32 ss = detail->subShapeNum; S32 od = detail->objectDetailNum; // nothing emitted yet... bool emitted = false; - S32 start = mShape->subShapeFirstObject[ss]; - S32 end = mShape->subShapeNumObjects[ss] + start; + S32 start = mShape->mSubShapeFirstObject[ss]; + S32 end = mShape->mSubShapeNumObjects[ss] + start; if (start *outDetails, Vect U32 highestDetail = -1; F32 highestSize = -F32_MAX; - for ( U32 i = 0; i < details.size(); i++ ) + for ( U32 i = 0; i < mDetails.size(); i++ ) { // Make sure we skip any details that shouldn't be rendered - if ( details[i].size < 0 ) + if ( mDetails[i].size < 0 ) continue; /* @@ -838,10 +838,10 @@ void TSShape::findColDetails( bool useVisibleMesh, Vector *outDetails, Vect */ // Otherwise test against the current highest size - if ( details[i].size > highestSize ) + if ( mDetails[i].size > highestSize ) { highestDetail = i; - highestSize = details[i].size; + highestSize = mDetails[i].size; } } @@ -861,9 +861,9 @@ void TSShape::findColDetails( bool useVisibleMesh, Vector *outDetails, Vect // // The LOS (light of sight) details are used for raycasts. - for ( U32 i = 0; i < details.size(); i++ ) + for ( U32 i = 0; i < mDetails.size(); i++ ) { - const String &name = names[ details[i].nameIndex ]; + const String &name = mNames[ mDetails[i].nameIndex ]; if ( !dStrStartsWith( name, "Collision" ) ) continue; @@ -906,9 +906,9 @@ void TSShape::findColDetails( bool useVisibleMesh, Vector *outDetails, Vect // Snag any "unmatched" LOS details and put // them at the end of the list. - for ( U32 i = 0; i < details.size(); i++ ) + for ( U32 i = 0; i < mDetails.size(); i++ ) { - const String &name = names[ details[i].nameIndex ]; + const String &name = mNames[ mDetails[i].nameIndex ]; if ( !dStrStartsWith( name, "LOS" ) ) continue; @@ -954,7 +954,7 @@ PhysicsCollision* TSShape::_buildColShapes( bool useVisibleMesh, const Point3F & // visible detail levels. // A negative subshape on the detail means we don't have geometry. - const TSShape::Detail &detail = details[0]; + const TSShape::Detail &detail = mDetails[0]; if ( detail.subShapeNum < 0 ) return NULL; @@ -964,16 +964,16 @@ PhysicsCollision* TSShape::_buildColShapes( bool useVisibleMesh, const Point3F & polyList.setTransform( &MatrixF::Identity, scale ); // Create the collision meshes. - S32 start = subShapeFirstObject[ detail.subShapeNum ]; - S32 end = start + subShapeNumObjects[ detail.subShapeNum ]; + S32 start = mSubShapeFirstObject[ detail.subShapeNum ]; + S32 end = start + mSubShapeNumObjects[ detail.subShapeNum ]; for ( S32 o=start; o < end; o++ ) { - const TSShape::Object &object = objects[o]; + const TSShape::Object &object = mObjects[o]; if ( detail.objectDetailNum >= object.numMeshes ) continue; // No mesh or no verts.... nothing to do. - TSMesh *mesh = meshes[ object.startMeshIndex + detail.objectDetailNum ]; + TSMesh *mesh = mMeshes[ object.startMeshIndex + detail.objectDetailNum ]; if ( !mesh || mesh->mNumVerts == 0 ) continue; @@ -1013,31 +1013,31 @@ PhysicsCollision* TSShape::_buildColShapes( bool useVisibleMesh, const Point3F & // // TODO: We need to support LOS collision for physics. // - for ( U32 i = 0; i < details.size(); i++ ) + for ( U32 i = 0; i < mDetails.size(); i++ ) { - const TSShape::Detail &detail = details[i]; - const String &name = names[detail.nameIndex]; + const TSShape::Detail &detail = mDetails[i]; + const String &name = mNames[detail.nameIndex]; // Is this a valid collision detail. if ( !dStrStartsWith( name, "Collision" ) || detail.subShapeNum < 0 ) continue; // Now go thru the meshes for this detail. - S32 start = subShapeFirstObject[ detail.subShapeNum ]; - S32 end = start + subShapeNumObjects[ detail.subShapeNum ]; + S32 start = mSubShapeFirstObject[ detail.subShapeNum ]; + S32 end = start + mSubShapeNumObjects[ detail.subShapeNum ]; if ( start >= end ) continue; for ( S32 o=start; o < end; o++ ) { - const TSShape::Object &object = objects[o]; - const String &meshName = names[ object.nameIndex ]; + const TSShape::Object &object = mObjects[o]; + const String &meshName = mNames[ object.nameIndex ]; if ( object.numMeshes <= detail.objectDetailNum ) continue; // No mesh, a flat bounds, or no verts.... nothing to do. - TSMesh *mesh = meshes[ object.startMeshIndex + detail.objectDetailNum ]; + TSMesh *mesh = mMeshes[ object.startMeshIndex + detail.objectDetailNum ]; if ( !mesh || mesh->getBounds().isEmpty() || mesh->mNumVerts == 0 ) continue; diff --git a/Engine/source/ts/tsDump.cpp b/Engine/source/ts/tsDump.cpp index 9d37faa81..0d5991754 100644 --- a/Engine/source/ts/tsDump.cpp +++ b/Engine/source/ts/tsDump.cpp @@ -50,7 +50,7 @@ void TSShapeInstance::dumpNode(Stream & stream ,S32 level, S32 nodeIndex, Vector space[level*3] = '\0'; const char *nodeName = ""; - const TSShape::Node & node = mShape->nodes[nodeIndex]; + const TSShape::Node & node = mShape->mNodes[nodeIndex]; if (node.nameIndex != -1) nodeName = mShape->getName(node.nameIndex); dumpLine(avar("%s%s", space, nodeName)); @@ -93,7 +93,7 @@ void TSShapeInstance::dumpNode(Stream & stream ,S32 level, S32 nodeIndex, Vector for (S32 k=0; kobject->numMeshes; k++) { S32 f = obj->object->startMeshIndex; - if (mShape->meshes[f+k]) + if (mShape->mMeshes[f+k]) dumpLine(avar(" %i",detailSizes[k])); } @@ -108,9 +108,9 @@ void TSShapeInstance::dumpNode(Stream & stream ,S32 level, S32 nodeIndex, Vector } // search for children - for (S32 k=nodeIndex+1; knodes.size(); k++) + for (S32 k=nodeIndex+1; kmNodes.size(); k++) { - if (mShape->nodes[k].parentIndex == nodeIndex) + if (mShape->mNodes[k].parentIndex == nodeIndex) // this is our child dumpNode(stream, level+1, k, detailSizes); } @@ -126,9 +126,9 @@ void TSShapeInstance::dump(Stream & stream) dumpLine("\r\n Details:\r\n"); - for (i=0; idetails.size(); i++) + for (i=0; imDetails.size(); i++) { - const TSDetail & detail = mShape->details[i]; + const TSDetail & detail = mShape->mDetails[i]; name = mShape->getName(detail.nameIndex); ss = detail.subShapeNum; od = detail.objectDetailNum; @@ -145,23 +145,23 @@ void TSShapeInstance::dump(Stream & stream) dumpLine("\r\n Subtrees:\r\n"); - for (i=0; isubShapeFirstNode.size(); i++) + for (i=0; imSubShapeFirstNode.size(); i++) { - S32 a = mShape->subShapeFirstNode[i]; - S32 b = a + mShape->subShapeNumNodes[i]; + S32 a = mShape->mSubShapeFirstNode[i]; + S32 b = a + mShape->mSubShapeNumNodes[i]; dumpLine(avar(" Subtree %i\r\n",i)); // compute detail sizes for each subshape Vector detailSizes; - for (S32 l=0;ldetails.size(); l++) + for (S32 l=0;lmDetails.size(); l++) { - if ((mShape->details[l].subShapeNum==i) || (mShape->details[l].subShapeNum==-1)) - detailSizes.push_back((S32)mShape->details[l].size); + if ((mShape->mDetails[l].subShapeNum==i) || (mShape->mDetails[l].subShapeNum==-1)) + detailSizes.push_back((S32)mShape->mDetails[l].size); } for (j=a; jnodes[j]; + const TSNode & node = mShape->mNodes[j]; // if the node has a parent, it'll get dumped via the parent if (node.parentIndex<0) dumpNode(stream,3,j,detailSizes); @@ -169,22 +169,22 @@ void TSShapeInstance::dump(Stream & stream) } bool foundSkin = false; - for (i=0; iobjects.size(); i++) + for (i=0; imObjects.size(); i++) { - if (mShape->objects[i].nodeIndex<0) // must be a skin + if (mShape->mObjects[i].nodeIndex<0) // must be a skin { if (!foundSkin) dumpLine("\r\n Skins:\r\n"); foundSkin=true; const char * skinName = ""; - S32 nameIndex = mShape->objects[i].nameIndex; + S32 nameIndex = mShape->mObjects[i].nameIndex; if (nameIndex>=0) skinName = mShape->getName(nameIndex); dumpLine(avar(" Skin %s with following details: ",skinName)); - for (S32 num=0; numobjects[i].numMeshes; num++) + for (S32 num=0; nummObjects[i].numMeshes; num++) { - if (mShape->meshes[mShape->objects[i].startMeshIndex + num]) - dumpLine(avar(" %i",(S32)mShape->details[num].size)); + if (mShape->mMeshes[mShape->mObjects[i].startMeshIndex + num]) + dumpLine(avar(" %i",(S32)mShape->mDetails[num].size)); } dumpLine("\r\n"); } @@ -193,19 +193,19 @@ void TSShapeInstance::dump(Stream & stream) dumpLine("\r\n"); dumpLine("\r\n Sequences:\r\n"); - for (i = 0; i < mShape->sequences.size(); i++) + for (i = 0; i < mShape->mSequences.size(); i++) { const char *name = "(none)"; - if (mShape->sequences[i].nameIndex != -1) - name = mShape->getName(mShape->sequences[i].nameIndex); + if (mShape->mSequences[i].nameIndex != -1) + name = mShape->getName(mShape->mSequences[i].nameIndex); dumpLine(avar(" %3d: %s%s%s\r\n", i, name, - mShape->sequences[i].isCyclic() ? " (cyclic)" : "", - mShape->sequences[i].isBlend() ? " (blend)" : "")); + mShape->mSequences[i].isCyclic() ? " (cyclic)" : "", + mShape->mSequences[i].isBlend() ? " (blend)" : "")); } - if (mShape->materialList) + if (mShape->mMaterialList) { - TSMaterialList * ml = mShape->materialList; + TSMaterialList * ml = mShape->mMaterialList; dumpLine("\r\n Material list:\r\n"); for (i=0; i<(S32)ml->size(); i++) { diff --git a/Engine/source/ts/tsLastDetail.cpp b/Engine/source/ts/tsLastDetail.cpp index 1e9ec9726..4a425b6bb 100644 --- a/Engine/source/ts/tsLastDetail.cpp +++ b/Engine/source/ts/tsLastDetail.cpp @@ -81,8 +81,8 @@ TSLastDetail::TSLastDetail( TSShape *shape, mDl = dl; mDim = getMax( dim, (S32)32 ); - mRadius = mShape->radius; - mCenter = mShape->center; + mRadius = mShape->mRadius; + mCenter = mShape->mCenter; mCachePath = cachePath; diff --git a/Engine/source/ts/tsMeshFit.cpp b/Engine/source/ts/tsMeshFit.cpp index 9c07cceab..4188b83cc 100644 --- a/Engine/source/ts/tsMeshFit.cpp +++ b/Engine/source/ts/tsMeshFit.cpp @@ -204,18 +204,18 @@ void MeshFit::initSourceGeometry( const String& target ) { // Add all geometry in the highest detail level S32 dl = 0; - S32 ss = mShape->details[dl].subShapeNum; + S32 ss = mShape->mDetails[dl].subShapeNum; if ( ss < 0 ) return; - S32 od = mShape->details[dl].objectDetailNum; - S32 start = mShape->subShapeFirstObject[ss]; - S32 end = start + mShape->subShapeNumObjects[ss]; + S32 od = mShape->mDetails[dl].objectDetailNum; + S32 start = mShape->mSubShapeFirstObject[ss]; + S32 end = start + mShape->mSubShapeNumObjects[ss]; for ( S32 i = start; i < end; i++ ) { - const TSShape::Object &obj = mShape->objects[i]; - const TSMesh* mesh = ( od < obj.numMeshes ) ? mShape->meshes[obj.startMeshIndex + od] : NULL; + const TSShape::Object &obj = mShape->mObjects[i]; + const TSMesh* mesh = ( od < obj.numMeshes ) ? mShape->mMeshes[obj.startMeshIndex + od] : NULL; if ( mesh ) addSourceMesh( obj, mesh ); } @@ -227,10 +227,10 @@ void MeshFit::initSourceGeometry( const String& target ) if ( objIndex == -1 ) return; - const TSShape::Object &obj = mShape->objects[objIndex]; + const TSShape::Object &obj = mShape->mObjects[objIndex]; for ( S32 i = 0; i < obj.numMeshes; i++ ) { - const TSMesh* mesh = mShape->meshes[obj.startMeshIndex + i]; + const TSMesh* mesh = mShape->mMeshes[obj.startMeshIndex + i]; if ( mesh ) { addSourceMesh( obj, mesh ); @@ -310,13 +310,13 @@ TSMesh* MeshFit::initMeshFromFile( const String& filename ) const { // Open the source shape file and make a copy of the mesh Resource hShape = ResourceManager::get().load(filename); - if (!bool(hShape) || !((TSShape*)hShape)->meshes.size()) + if (!bool(hShape) || !((TSShape*)hShape)->mMeshes.size()) { Con::errorf("TSShape::createMesh: Could not load source mesh from %s", filename.c_str()); return NULL; } - TSMesh* srcMesh = ((TSShape*)hShape)->meshes[0]; + TSMesh* srcMesh = ((TSShape*)hShape)->mMeshes[0]; return mShape->copyMesh( srcMesh ); } diff --git a/Engine/source/ts/tsPartInstance.cpp b/Engine/source/ts/tsPartInstance.cpp index 32e1a6fe3..f7378cfdc 100644 --- a/Engine/source/ts/tsPartInstance.cpp +++ b/Engine/source/ts/tsPartInstance.cpp @@ -97,9 +97,9 @@ void TSPartInstance::updateBounds() void TSPartInstance::breakShape(TSShapeInstance * shape, S32 subShape, Vector & partList, F32 * probShatter, F32 * probBreak, S32 probDepth) { - AssertFatal(subShape>=0 && subShapemShape->subShapeFirstNode.size(),"TSPartInstance::breakShape: subShape out of range."); + AssertFatal(subShape>=0 && subShapemShape->mSubShapeFirstNode.size(),"TSPartInstance::breakShape: subShape out of range."); - S32 start = shape->mShape->subShapeFirstNode[subShape]; + S32 start = shape->mShape->mSubShapeFirstNode[subShape]; TSPartInstance::breakShape(shape, NULL, start, partList, probShatter, probBreak, probDepth); @@ -120,7 +120,7 @@ void TSPartInstance::breakShape(TSShapeInstance * shape, TSPartInstance * curren { AssertFatal( !probDepth || (probShatter && probBreak),"TSPartInstance::breakShape: probabilities improperly specified."); - const TSShape::Node * node = &shape->mShape->nodes[currentNode]; + const TSShape::Node * node = &shape->mShape->mNodes[currentNode]; S32 object = node->firstObject; S32 child = node->firstChild; @@ -155,14 +155,14 @@ void TSPartInstance::breakShape(TSShapeInstance * shape, TSPartInstance * curren { partList.increment(); partList.last() = new TSPartInstance(shape,object); - object = shape->mShape->objects[object].nextSibling; + object = shape->mShape->mObjects[object].nextSibling; } // iterate through the child nodes, call ourselves on each one with currentPart = NULL while (child>=0) { TSPartInstance::breakShape(shape,NULL,child,partList,probShatter,probBreak,probDepth); - child = shape->mShape->nodes[child].nextSibling; + child = shape->mShape->mNodes[child].nextSibling; } return; @@ -184,14 +184,14 @@ void TSPartInstance::breakShape(TSShapeInstance * shape, TSPartInstance * curren while (object>=0) { currentPart->addObject(object); - object = shape->mShape->objects[object].nextSibling; + object = shape->mShape->mObjects[object].nextSibling; } // iterate through child nodes, call ourselves on each one with currentPart as is while (child>=0) { TSPartInstance::breakShape(shape,currentPart,child,partList,probShatter,probBreak,probDepth); - child = shape->mShape->nodes[child].nextSibling; + child = shape->mShape->mNodes[child].nextSibling; } } @@ -334,7 +334,7 @@ F32 TSPartInstance::getDetailSize(S32 dl) const else if (mSizeCutoffs && dlgetShape()->mSmallestVisibleDL) - return mSourceShape->getShape()->details[dl].size; + return mSourceShape->getShape()->mDetails[dl].size; else return 0; } diff --git a/Engine/source/ts/tsShape.cpp b/Engine/source/ts/tsShape.cpp index f4fadf815..1a27dc3c6 100644 --- a/Engine/source/ts/tsShape.cpp +++ b/Engine/source/ts/tsShape.cpp @@ -62,7 +62,7 @@ bool TSShape::smInitOnRead = true; TSShape::TSShape() { - materialList = NULL; + mMaterialList = NULL; mReadVersion = -1; // -1 means constructed from scratch (e.g., in exporter or no read yet) mHasSkinMesh = false; mSequencesConstructed = false; @@ -74,70 +74,70 @@ TSShape::TSShape() mDetailLevelLookup.setSize( 1 ); mDetailLevelLookup[0].set( -1, 0 ); - VECTOR_SET_ASSOCIATION(sequences); - VECTOR_SET_ASSOCIATION(nodeRotations); - VECTOR_SET_ASSOCIATION(nodeTranslations); - VECTOR_SET_ASSOCIATION(nodeUniformScales); - VECTOR_SET_ASSOCIATION(nodeAlignedScales); - VECTOR_SET_ASSOCIATION(nodeArbitraryScaleRots); - VECTOR_SET_ASSOCIATION(nodeArbitraryScaleFactors); - VECTOR_SET_ASSOCIATION(groundRotations); - VECTOR_SET_ASSOCIATION(groundTranslations); - VECTOR_SET_ASSOCIATION(triggers); - VECTOR_SET_ASSOCIATION(billboardDetails); - VECTOR_SET_ASSOCIATION(detailCollisionAccelerators); - VECTOR_SET_ASSOCIATION(names); + VECTOR_SET_ASSOCIATION(mSequences); + VECTOR_SET_ASSOCIATION(mNodeRotations); + VECTOR_SET_ASSOCIATION(mNodeTranslations); + VECTOR_SET_ASSOCIATION(mNodeUniformScales); + VECTOR_SET_ASSOCIATION(mNodeAlignedScales); + VECTOR_SET_ASSOCIATION(mNodeArbitraryScaleRots); + VECTOR_SET_ASSOCIATION(mNodeArbitraryScaleFactors); + VECTOR_SET_ASSOCIATION(mGroundRotations); + VECTOR_SET_ASSOCIATION(mGroundTranslations); + VECTOR_SET_ASSOCIATION(mTriggers); + VECTOR_SET_ASSOCIATION(mBillboardDetails); + VECTOR_SET_ASSOCIATION(mDetailCollisionAccelerators); + VECTOR_SET_ASSOCIATION(mNames); - VECTOR_SET_ASSOCIATION( nodes ); - VECTOR_SET_ASSOCIATION( objects ); - VECTOR_SET_ASSOCIATION( objectStates ); - VECTOR_SET_ASSOCIATION( subShapeFirstNode ); - VECTOR_SET_ASSOCIATION( subShapeFirstObject ); - VECTOR_SET_ASSOCIATION( detailFirstSkin ); - VECTOR_SET_ASSOCIATION( subShapeNumNodes ); - VECTOR_SET_ASSOCIATION( subShapeNumObjects ); - VECTOR_SET_ASSOCIATION( details ); - VECTOR_SET_ASSOCIATION( defaultRotations ); - VECTOR_SET_ASSOCIATION( defaultTranslations ); + VECTOR_SET_ASSOCIATION( mNodes ); + VECTOR_SET_ASSOCIATION( mObjects ); + VECTOR_SET_ASSOCIATION( mObjectStates ); + VECTOR_SET_ASSOCIATION( mSubShapeFirstNode ); + VECTOR_SET_ASSOCIATION( mSubShapeFirstObject ); + VECTOR_SET_ASSOCIATION( mDetailFirstSkin ); + VECTOR_SET_ASSOCIATION( mSubShapeNumNodes ); + VECTOR_SET_ASSOCIATION( mSubShapeNumObjects ); + VECTOR_SET_ASSOCIATION( mDetails ); + VECTOR_SET_ASSOCIATION( mDefaultRotations ); + VECTOR_SET_ASSOCIATION( mDefaultTranslations ); - VECTOR_SET_ASSOCIATION( subShapeFirstTranslucentObject ); - VECTOR_SET_ASSOCIATION( meshes ); + VECTOR_SET_ASSOCIATION( mSubShapeFirstTranslucentObject ); + VECTOR_SET_ASSOCIATION( mMeshes ); - VECTOR_SET_ASSOCIATION( alphaIn ); - VECTOR_SET_ASSOCIATION( alphaOut ); + VECTOR_SET_ASSOCIATION( mAlphaIn ); + VECTOR_SET_ASSOCIATION( mAlphaOut ); } TSShape::~TSShape() { - delete materialList; + delete mMaterialList; S32 i; // everything left over here is a legit mesh - for (i=0; i= mShapeData) && ((S8*)meshes[i] < (mShapeData + mShapeDataSize))) - destructInPlace(meshes[i]); + if (((S8*)mMeshes[i] >= mShapeData) && ((S8*)mMeshes[i] < (mShapeData + mShapeDataSize))) + destructInPlace(mMeshes[i]); else - delete meshes[i]; + delete mMeshes[i]; } - for (i=0; ivertexList; delete [] accel->normalList; @@ -147,8 +147,8 @@ TSShape::~TSShape() delete accel; } } - for (dca = 0; dca < detailCollisionAccelerators.size(); dca++) - detailCollisionAccelerators[dca] = NULL; + for (dca = 0; dca < mDetailCollisionAccelerators.size(); dca++) + mDetailCollisionAccelerators[dca] = NULL; if( mShapeData ) delete[] mShapeData; @@ -156,44 +156,44 @@ TSShape::~TSShape() const String& TSShape::getName( S32 nameIndex ) const { - AssertFatal(nameIndex>=0 && nameIndex=0 && nameIndex= 0 && seqIndex= 0 && seqIndexgetMaterialNameList().size(); + S32 targetCount = mMaterialList->getMaterialNameList().size(); if(mapToNameIndex < 0 || mapToNameIndex >= targetCount) return String::EmptyString; - return materialList->getMaterialNameList()[mapToNameIndex]; + return mMaterialList->getMaterialNameList()[mapToNameIndex]; } S32 TSShape::getTargetCount() const @@ -215,46 +215,46 @@ S32 TSShape::getTargetCount() const if(!this) return -1; - return materialList->getMaterialNameList().size(); + return mMaterialList->getMaterialNameList().size(); } S32 TSShape::findNode(S32 nameIndex) const { - for (S32 i=0; i validDetails; @@ -278,7 +278,7 @@ bool TSShape::findMeshIndex(const String& meshName, S32& objIndex, S32& meshInde // Find the detail with the correct size for (meshIndex = 0; meshIndex < validDetails.size(); meshIndex++) { - const TSShape::Detail& det = details[validDetails[meshIndex]]; + const TSShape::Detail& det = mDetails[validDetails[meshIndex]]; if (detailSize == det.size) return true; } @@ -291,15 +291,15 @@ TSMesh* TSShape::findMesh(const String& meshName) S32 objIndex, meshIndex; if (!findMeshIndex(meshName, objIndex, meshIndex)) return 0; - return meshes[objects[objIndex].startMeshIndex + meshIndex]; + return mMeshes[mObjects[objIndex].startMeshIndex + meshIndex]; } S32 TSShape::getSubShapeForNode(S32 nodeIndex) { - for (S32 i = 0; i < subShapeFirstNode.size(); i++) + for (S32 i = 0; i < mSubShapeFirstNode.size(); i++) { - S32 start = subShapeFirstNode[i]; - S32 end = start + subShapeNumNodes[i]; + S32 start = mSubShapeFirstNode[i]; + S32 end = start + mSubShapeNumNodes[i]; if ((nodeIndex >= start) && (nodeIndex < end)) return i;; } @@ -308,10 +308,10 @@ S32 TSShape::getSubShapeForNode(S32 nodeIndex) S32 TSShape::getSubShapeForObject(S32 objIndex) { - for (S32 i = 0; i < subShapeFirstObject.size(); i++) + for (S32 i = 0; i < mSubShapeFirstObject.size(); i++) { - S32 start = subShapeFirstObject[i]; - S32 end = start + subShapeNumObjects[i]; + S32 start = mSubShapeFirstObject[i]; + S32 end = start + mSubShapeNumObjects[i]; if ((objIndex >= start) && (objIndex < end)) return i; } @@ -321,10 +321,10 @@ S32 TSShape::getSubShapeForObject(S32 objIndex) void TSShape::getSubShapeDetails(S32 subShapeIndex, Vector& validDetails) { validDetails.clear(); - for (S32 i = 0; i < details.size(); i++) + for (S32 i = 0; i < mDetails.size(); i++) { - if ((details[i].subShapeNum == subShapeIndex) || - (details[i].subShapeNum < 0)) + if ((mDetails[i].subShapeNum == subShapeIndex) || + (mDetails[i].subShapeNum < 0)) validDetails.push_back(i); } } @@ -338,36 +338,36 @@ void TSShape::getNodeWorldTransform(S32 nodeIndex, MatrixF* mat) const else { // Calculate the world transform of the given node - defaultRotations[nodeIndex].getQuatF().setMatrix(mat); - mat->setPosition(defaultTranslations[nodeIndex]); + mDefaultRotations[nodeIndex].getQuatF().setMatrix(mat); + mat->setPosition(mDefaultTranslations[nodeIndex]); - S32 parentIndex = nodes[nodeIndex].parentIndex; + S32 parentIndex = mNodes[nodeIndex].parentIndex; while (parentIndex != -1) { MatrixF mat2(*mat); - defaultRotations[parentIndex].getQuatF().setMatrix(mat); - mat->setPosition(defaultTranslations[parentIndex]); + mDefaultRotations[parentIndex].getQuatF().setMatrix(mat); + mat->setPosition(mDefaultTranslations[parentIndex]); mat->mul(mat2); - parentIndex = nodes[parentIndex].parentIndex; + parentIndex = mNodes[parentIndex].parentIndex; } } } void TSShape::getNodeObjects(S32 nodeIndex, Vector& nodeObjects) { - for (S32 i = 0; i < objects.size(); i++) + for (S32 i = 0; i < mObjects.size(); i++) { - if ((nodeIndex == -1) || (objects[i].nodeIndex == nodeIndex)) + if ((nodeIndex == -1) || (mObjects[i].nodeIndex == nodeIndex)) nodeObjects.push_back(i); } } void TSShape::getNodeChildren(S32 nodeIndex, Vector& nodeChildren) { - for (S32 i = 0; i < nodes.size(); i++) + for (S32 i = 0; i < mNodes.size(); i++) { - if (nodes[i].parentIndex == nodeIndex) + if (mNodes[i].parentIndex == nodeIndex) nodeChildren.push_back(i); } } @@ -379,101 +379,101 @@ void TSShape::getObjectDetails(S32 objIndex, Vector& objDetails) getSubShapeDetails(getSubShapeForObject(objIndex), validDetails); // Get the non-null details for this object - const TSShape::Object& obj = objects[objIndex]; + const TSShape::Object& obj = mObjects[objIndex]; for (S32 i = 0; i < obj.numMeshes; i++) { - if (meshes[obj.startMeshIndex + i]) + if (mMeshes[obj.startMeshIndex + i]) objDetails.push_back(validDetails[i]); } } void TSShape::init() { - S32 numSubShapes = subShapeFirstNode.size(); - AssertFatal(numSubShapes==subShapeFirstObject.size(),"TSShape::init"); + S32 numSubShapes = mSubShapeFirstNode.size(); + AssertFatal(numSubShapes==mSubShapeFirstObject.size(),"TSShape::init"); S32 i,j; // set up parent/child relationships on nodes and objects - for (i=0; i=0) { - if (nodes[parentIndex].firstChild<0) - nodes[parentIndex].firstChild=i; + if (mNodes[parentIndex].firstChild<0) + mNodes[parentIndex].firstChild=i; else { - S32 child = nodes[parentIndex].firstChild; - while (nodes[child].nextSibling>=0) - child = nodes[child].nextSibling; - nodes[child].nextSibling = i; + S32 child = mNodes[parentIndex].firstChild; + while (mNodes[child].nextSibling>=0) + child = mNodes[child].nextSibling; + mNodes[child].nextSibling = i; } } } - for (i=0; i=0) { - if (nodes[nodeIndex].firstObject<0) - nodes[nodeIndex].firstObject = i; + if (mNodes[nodeIndex].firstObject<0) + mNodes[nodeIndex].firstObject = i; else { - S32 objectIndex = nodes[nodeIndex].firstObject; - while (objects[objectIndex].nextSibling>=0) - objectIndex = objects[objectIndex].nextSibling; - objects[objectIndex].nextSibling = i; + S32 objectIndex = mNodes[nodeIndex].firstObject; + while (mObjects[objectIndex].nextSibling>=0) + objectIndex = mObjects[objectIndex].nextSibling; + mObjects[objectIndex].nextSibling = i; } } } mFlags = 0; - for (i=0; igetNumPolys() : 0; } } - details[i].polyCount = count; + mDetails[i].polyCount = count; } // Init the collision accelerator array. Note that we don't compute the // accelerators until the app requests them { S32 dca; - for (dca = 0; dca < detailCollisionAccelerators.size(); dca++) + for (dca = 0; dca < mDetailCollisionAccelerators.size(); dca++) { - ConvexHullAccelerator* accel = detailCollisionAccelerators[dca]; + ConvexHullAccelerator* accel = mDetailCollisionAccelerators[dca]; if (accel != NULL) { delete [] accel->vertexList; delete [] accel->normalList; @@ -540,9 +540,9 @@ void TSShape::init() } } - detailCollisionAccelerators.setSize(details.size()); - for (dca = 0; dca < detailCollisionAccelerators.size(); dca++) - detailCollisionAccelerators[dca] = NULL; + mDetailCollisionAccelerators.setSize(mDetails.size()); + for (dca = 0; dca < mDetailCollisionAccelerators.size(); dca++) + mDetailCollisionAccelerators[dca] = NULL; } initVertexFeatures(); @@ -554,8 +554,8 @@ void TSShape::initVertexFeatures() bool hasColors = false; bool hasTexcoord2 = false; - Vector::iterator iter = meshes.begin(); - for ( ; iter != meshes.end(); iter++ ) + Vector::iterator iter = mMeshes.begin(); + for ( ; iter != mMeshes.end(); iter++ ) { TSMesh *mesh = *iter; if ( mesh && @@ -594,8 +594,8 @@ void TSShape::initVertexFeatures() // Go fix up meshes to include defaults for optional features // and initialize them if they're not a skin mesh. - iter = meshes.begin(); - for ( ; iter != meshes.end(); iter++ ) + iter = mMeshes.begin(); + for ( ; iter != mMeshes.end(); iter++ ) { TSMesh *mesh = *iter; if ( !mesh || @@ -621,20 +621,20 @@ void TSShape::setupBillboardDetails( const String &cachePath ) // set up billboard details -- only do this once, meaning that // if we add a sequence to the shape we don't redo the billboard // details... - if ( !billboardDetails.empty() ) + if ( !mBillboardDetails.empty() ) return; - for ( U32 i=0; i < details.size(); i++ ) + for ( U32 i=0; i < mDetails.size(); i++ ) { - const Detail &det = details[i]; + const Detail &det = mDetails[i]; if ( det.subShapeNum >= 0 ) continue; // not a billboard detail - while (billboardDetails.size() <= i ) - billboardDetails.push_back(NULL); + while (mBillboardDetails.size() <= i ) + mBillboardDetails.push_back(NULL); - billboardDetails[i] = new TSLastDetail( this, + mBillboardDetails[i] = new TSLastDetail( this, cachePath, det.bbEquatorSteps, det.bbPolarSteps, @@ -643,15 +643,15 @@ void TSShape::setupBillboardDetails( const String &cachePath ) det.bbDetailLevel, det.bbDimension ); - billboardDetails[i]->update(); + mBillboardDetails[i]->update(); } } void TSShape::initMaterialList() { - S32 numSubShapes = subShapeFirstObject.size(); + S32 numSubShapes = mSubShapeFirstObject.size(); #if defined(TORQUE_MAX_LIB) - subShapeFirstTranslucentObject.setSize(numSubShapes); + mSubShapeFirstTranslucentObject.setSize(numSubShapes); #endif mHasSkinMesh = false; @@ -661,16 +661,16 @@ void TSShape::initMaterialList() // also, while we're at it, set mHasTranslucency for (S32 ss = 0; ssmPrimitives[k].matIndex & TSDrawPrimitive::NoMaterial) continue; - S32 flags = materialList->getFlags(mesh->mPrimitives[k].matIndex & TSDrawPrimitive::MaterialMask); + S32 flags = mMaterialList->getFlags(mesh->mPrimitives[k].matIndex & TSDrawPrimitive::MaterialMask); if (flags & TSMaterialList::AuxiliaryMap) continue; if (flags & TSMaterialList::Translucent) { mFlags |= HasTranslucency; - subShapeFirstTranslucentObject[ss] = i; + mSubShapeFirstTranslucentObject[ss] = i; break; } } @@ -704,26 +704,26 @@ void TSShape::initMaterialList() bool TSShape::preloadMaterialList(const Torque::Path &path) { - if (materialList) - materialList->setTextureLookupPath(path.getPath()); + if (mMaterialList) + mMaterialList->setTextureLookupPath(path.getPath()); return true; } bool TSShape::buildConvexHull(S32 dl) const { - AssertFatal(dl>=0 && dl=0 && dlbuildConvexHull(); @@ -739,10 +739,10 @@ void TSShape::computeBounds(S32 dl, Box3F & bounds) const if (dl==-1) return; - AssertFatal(dl>=0 && dl=0 && dlsubShapeNum; S32 od = detail->objectDetailNum; @@ -753,16 +753,16 @@ void TSShape::computeBounds(S32 dl, Box3F & bounds) const // set up temporary storage for non-local transforms... S32 i; - S32 start = subShapeFirstNode[ss]; - S32 end = subShapeNumNodes[ss] + start; + S32 start = mSubShapeFirstNode[ss]; + S32 end = mSubShapeNumNodes[ss] + start; gTempNodeTransforms.setSize(end-start); for (i=start; i=0) - gTempNodeTransforms[i-start].mul(gTempNodeTransforms[nodes[i].parentIndex-start],mat); + TSTransform::setMatrix(mDefaultRotations[i].getQuatF(&q),mDefaultTranslations[i],&mat); + if (mNodes[i].parentIndex>=0) + gTempNodeTransforms[i-start].mul(gTempNodeTransforms[mNodes[i].parentIndex-start],mat); else gTempNodeTransforms[i-start] = mat; } @@ -771,12 +771,12 @@ void TSShape::computeBounds(S32 dl, Box3F & bounds) const bounds.minExtents.set( 10E30f, 10E30f, 10E30f); bounds.maxExtents.set(-10E30f,-10E30f,-10E30f); Box3F box; - start = subShapeFirstObject[ss]; - end = subShapeNumObjects[ss] + start; + start = mSubShapeFirstObject[ss]; + end = mSubShapeNumObjects[ss] + start; for (i=start; inumMeshes ? meshes[object->startMeshIndex+od] : NULL; + const Object * object = &mObjects[i]; + TSMesh * mesh = odnumMeshes ? mMeshes[object->startMeshIndex+od] : NULL; if (mesh) { static MatrixF idMat(true); @@ -805,23 +805,23 @@ bool TSShape::checkSkip(S32 meshNum, S32 & curObject, S32 skipDL) return false; // skip detail level exists on this subShape - S32 skipSS = details[skipDL].subShapeNum; + S32 skipSS = mDetails[skipDL].subShapeNum; - if (curObject=start) { // we are either from this object, the next object, or a decal - if (meshNum < start + objects[curObject].numMeshes) + if (meshNum < start + mObjects[curObject].numMeshes) { // this object... - if (subShapeFirstObject[skipSS]>curObject) + if (mSubShapeFirstObject[skipSS]>curObject) // haven't reached this subshape yet return true; - if (skipSS+1==subShapeFirstObject.size() || curObject21) { // more node sequence data...scale - nodeUniformScales.setSize(numNodeUniformScales); + mNodeUniformScales.setSize(numNodeUniformScales); for (i=0;i23) { - groundTranslations.setSize(numGroundFrames); + mGroundTranslations.setSize(numGroundFrames); for (i=0;i 10000 ) || - ( details[i].maxError == 0 ) || ( details[i].maxError > 10000 ) ) + if ( ( mDetails[i].averageError == 0 ) || ( mDetails[i].averageError > 10000 ) || + ( mDetails[i].maxError == 0 ) || ( mDetails[i].maxError > 10000 ) ) { - details[i].averageError = details[i].maxError = -1.0f; + mDetails[i].averageError = mDetails[i].maxError = -1.0f; } } @@ -1198,7 +1198,7 @@ void TSShape::assembleShape() } } } - meshes.set(ptr32,numMeshes); + mMeshes.set(ptr32,numMeshes); tsalloc.checkGuard(); @@ -1206,13 +1206,13 @@ void TSShape::assembleShape() char * nameBufferStart = (char*)tsalloc.getPointer8(0); char * name = nameBufferStart; S32 nameBufferSize = 0; - names.setSize(numNames); + mNames.setSize(numNames); for (i=0; i 25) { U32 alignedSize32 = sizeof( Detail ) / 4; - tsalloc.copyToBuffer32((S32*)details.address(),numDetails * alignedSize32 ); + tsalloc.copyToBuffer32((S32*)mDetails.address(),numDetails * alignedSize32 ); } else { // Legacy details => no explicit autobillboard parameters U32 legacyDetailSize32 = 7; // only store the first 7 4-byte values of each detail - for ( S32 i = 0; i < details.size(); i++ ) - tsalloc.copyToBuffer32( (S32*)&details[i], legacyDetailSize32 ); + for ( S32 i = 0; i < mDetails.size(); i++ ) + tsalloc.copyToBuffer32( (S32*)&mDetails[i], legacyDetailSize32 ); } tsalloc.setGuard(); @@ -1403,18 +1403,18 @@ void TSShape::disassembleShape() bool * isMesh = new bool[numMeshes]; // funny business because decals are pretend meshes (legacy issue) for (i=0;igetMeshType() != TSMesh::DecalMeshType) ? mesh->getMeshType() : TSMesh::NullMeshType); if (mesh) mesh->disassemble(); @@ -1424,7 +1424,7 @@ void TSShape::disassembleShape() // names for (i=0; imTVerts2.size() || meshes[i]->mColors.size()) + if (mMeshes[i]->mTVerts2.size() || mMeshes[i]->mColors.size()) return false; // Cannot use old format if any primitive has too many triangles // (ie. cannot fit in a S16) - for (S32 j = 0; j < meshes[i]->mPrimitives.size(); j++) + for (S32 j = 0; j < mMeshes[i]->mPrimitives.size(); j++) { - if ((meshes[i]->mPrimitives[j].start + - meshes[i]->mPrimitives[j].numElements) >= (1 << 15)) + if ((mMeshes[i]->mPrimitives[j].start + + mMeshes[i]->mPrimitives[j].numElements) >= (1 << 15)) { return false; } @@ -1513,12 +1513,12 @@ void TSShape::write(Stream * s, bool saveOldFormat) s->write(size8 *4,buffer8); // write sequences - write will properly endian-flip. - s->write(sequences.size()); - for (S32 i=0; iwrite(mSequences.size()); + for (S32 i=0; iwrite(*s); + mMaterialList->write(*s); delete [] buffer32; delete [] buffer16; @@ -1585,20 +1585,20 @@ bool TSShape::read(Stream * s) // read sequences S32 numSequences; s->read(&numSequences); - sequences.setSize(numSequences); + mSequences.setSize(numSequences); for (i=0; iread(*s); + delete mMaterialList; // just in case... + mMaterialList = new TSMaterialList; + mMaterialList->read(*s); } // since we read in the buffers, we need to endian-flip their entire contents... @@ -1842,89 +1842,89 @@ bool TSShape::read(Stream * s) void TSShape::createEmptyShape() { - nodes.set(dMalloc(1 * sizeof(Node)), 1); - nodes[0].nameIndex = 1; - nodes[0].parentIndex = -1; - nodes[0].firstObject = 0; - nodes[0].firstChild = -1; - nodes[0].nextSibling = -1; + mNodes.set(dMalloc(1 * sizeof(Node)), 1); + mNodes[0].nameIndex = 1; + mNodes[0].parentIndex = -1; + mNodes[0].firstObject = 0; + mNodes[0].firstChild = -1; + mNodes[0].nextSibling = -1; - objects.set(dMalloc(1 * sizeof(Object)), 1); - objects[0].nameIndex = 2; - objects[0].numMeshes = 1; - objects[0].startMeshIndex = 0; - objects[0].nodeIndex = 0; - objects[0].nextSibling = -1; - objects[0].firstDecal = -1; + mObjects.set(dMalloc(1 * sizeof(Object)), 1); + mObjects[0].nameIndex = 2; + mObjects[0].numMeshes = 1; + mObjects[0].startMeshIndex = 0; + mObjects[0].nodeIndex = 0; + mObjects[0].nextSibling = -1; + mObjects[0].firstDecal = -1; - objectStates.set(dMalloc(1 * sizeof(ObjectState)), 1); - objectStates[0].vis = 1; - objectStates[0].frameIndex = 0; - objectStates[0].matFrameIndex = 0; + mObjectStates.set(dMalloc(1 * sizeof(ObjectState)), 1); + mObjectStates[0].vis = 1; + mObjectStates[0].frameIndex = 0; + mObjectStates[0].matFrameIndex = 0; - subShapeFirstNode.set(dMalloc(1 * sizeof(S32)), 1); - subShapeFirstNode[0] = 0; + mSubShapeFirstNode.set(dMalloc(1 * sizeof(S32)), 1); + mSubShapeFirstNode[0] = 0; - subShapeFirstObject.set(dMalloc(1 * sizeof(S32)), 1); - subShapeFirstObject[0] = 0; + mSubShapeFirstObject.set(dMalloc(1 * sizeof(S32)), 1); + mSubShapeFirstObject[0] = 0; - detailFirstSkin.set(NULL, 0); + mDetailFirstSkin.set(NULL, 0); - subShapeNumNodes.set(dMalloc(1 * sizeof(S32)), 1); - subShapeNumNodes[0] = 1; + mSubShapeNumNodes.set(dMalloc(1 * sizeof(S32)), 1); + mSubShapeNumNodes[0] = 1; - subShapeNumObjects.set(dMalloc(1 * sizeof(S32)), 1); - subShapeNumObjects[0] = 1; + mSubShapeNumObjects.set(dMalloc(1 * sizeof(S32)), 1); + mSubShapeNumObjects[0] = 1; - details.set(dMalloc(1 * sizeof(Detail)), 1); - details[0].nameIndex = 0; - details[0].subShapeNum = 0; - details[0].objectDetailNum = 0; - details[0].size = 2.0f; - details[0].averageError = -1.0f; - details[0].maxError = -1.0f; - details[0].polyCount = 0; + mDetails.set(dMalloc(1 * sizeof(Detail)), 1); + mDetails[0].nameIndex = 0; + mDetails[0].subShapeNum = 0; + mDetails[0].objectDetailNum = 0; + mDetails[0].size = 2.0f; + mDetails[0].averageError = -1.0f; + mDetails[0].maxError = -1.0f; + mDetails[0].polyCount = 0; - defaultRotations.set(dMalloc(1 * sizeof(Quat16)), 1); - defaultRotations[0].x = 0.0f; - defaultRotations[0].y = 0.0f; - defaultRotations[0].z = 0.0f; - defaultRotations[0].w = 0.0f; + mDefaultRotations.set(dMalloc(1 * sizeof(Quat16)), 1); + mDefaultRotations[0].x = 0.0f; + mDefaultRotations[0].y = 0.0f; + mDefaultRotations[0].z = 0.0f; + mDefaultRotations[0].w = 0.0f; - defaultTranslations.set(dMalloc(1 * sizeof(Point3F)), 1); - defaultTranslations[0].set(0.0f, 0.0f, 0.0f); + mDefaultTranslations.set(dMalloc(1 * sizeof(Point3F)), 1); + mDefaultTranslations[0].set(0.0f, 0.0f, 0.0f); - subShapeFirstTranslucentObject.set(dMalloc(1 * sizeof(S32)), 1); - subShapeFirstTranslucentObject[0] = 1; + mSubShapeFirstTranslucentObject.set(dMalloc(1 * sizeof(S32)), 1); + mSubShapeFirstTranslucentObject[0] = 1; - alphaIn.set(dMalloc(1 * sizeof(F32)), 1); - alphaIn[0] = 0; + mAlphaIn.set(dMalloc(1 * sizeof(F32)), 1); + mAlphaIn[0] = 0; - alphaOut.set(dMalloc(1 * sizeof(F32)), 1); - alphaOut[0] = -1; + mAlphaOut.set(dMalloc(1 * sizeof(F32)), 1); + mAlphaOut[0] = -1; - sequences.set(NULL, 0); - nodeRotations.set(NULL, 0); - nodeTranslations.set(NULL, 0); - nodeUniformScales.set(NULL, 0); - nodeAlignedScales.set(NULL, 0); - nodeArbitraryScaleRots.set(NULL, 0); - nodeArbitraryScaleFactors.set(NULL, 0); - groundRotations.set(NULL, 0); - groundTranslations.set(NULL, 0); - triggers.set(NULL, 0); - billboardDetails.set(NULL, 0); + mSequences.set(NULL, 0); + mNodeRotations.set(NULL, 0); + mNodeTranslations.set(NULL, 0); + mNodeUniformScales.set(NULL, 0); + mNodeAlignedScales.set(NULL, 0); + mNodeArbitraryScaleRots.set(NULL, 0); + mNodeArbitraryScaleFactors.set(NULL, 0); + mGroundRotations.set(NULL, 0); + mGroundTranslations.set(NULL, 0); + mTriggers.set(NULL, 0); + mBillboardDetails.set(NULL, 0); - names.setSize(3); - names[0] = StringTable->insert("Detail2"); - names[1] = StringTable->insert("Mesh2"); - names[2] = StringTable->insert("Mesh"); + mNames.setSize(3); + mNames[0] = StringTable->insert("Detail2"); + mNames[1] = StringTable->insert("Mesh2"); + mNames[2] = StringTable->insert("Mesh"); - radius = 0.866025f; - tubeRadius = 0.707107f; - center.set(0.0f, 0.5f, 0.0f); - bounds.minExtents.set(-0.5f, 0.0f, -0.5f); - bounds.maxExtents.set(0.5f, 1.0f, 0.5f); + mRadius = 0.866025f; + mTubeRadius = 0.707107f; + mCenter.set(0.0f, 0.5f, 0.0f); + mBounds.minExtents.set(-0.5f, 0.0f, -0.5f); + mBounds.maxExtents.set(0.5f, 1.0f, 0.5f); mExporterVersion = 124; mSmallestVisibleSize = 2; @@ -1940,9 +1940,9 @@ void TSShape::createEmptyShape() // Init the collision accelerator array. Note that we don't compute the // accelerators until the app requests them - detailCollisionAccelerators.setSize(details.size()); - for (U32 i = 0; i < detailCollisionAccelerators.size(); i++) - detailCollisionAccelerators[i] = NULL; + mDetailCollisionAccelerators.setSize(mDetails.size()); + for (U32 i = 0; i < mDetailCollisionAccelerators.size(); i++) + mDetailCollisionAccelerators[i] = NULL; } void TSShape::fixEndian(S32 * buff32, S16 * buff16, S8 *, S32 count32, S32 count16, S32) @@ -2045,27 +2045,27 @@ template<> ResourceBase::Signature Resource::signature() TSShape::ConvexHullAccelerator* TSShape::getAccelerator(S32 dl) { - AssertFatal(dl < details.size(), "Error, bad detail level!"); + AssertFatal(dl < mDetails.size(), "Error, bad detail level!"); if (dl == -1) return NULL; - AssertFatal( detailCollisionAccelerators.size() == details.size(), + AssertFatal( mDetailCollisionAccelerators.size() == mDetails.size(), "TSShape::getAccelerator() - mismatched array sizes!" ); - if (detailCollisionAccelerators[dl] == NULL) + if (mDetailCollisionAccelerators[dl] == NULL) computeAccelerator(dl); - AssertFatal(detailCollisionAccelerators[dl] != NULL, "This should be non-null after computing it!"); - return detailCollisionAccelerators[dl]; + AssertFatal(mDetailCollisionAccelerators[dl] != NULL, "This should be non-null after computing it!"); + return mDetailCollisionAccelerators[dl]; } void TSShape::computeAccelerator(S32 dl) { - AssertFatal(dl < details.size(), "Error, bad detail level!"); + AssertFatal(dl < mDetails.size(), "Error, bad detail level!"); // Have we already computed this? - if (detailCollisionAccelerators[dl] != NULL) + if (mDetailCollisionAccelerators[dl] != NULL) return; // Create a bogus features list... @@ -2073,12 +2073,12 @@ void TSShape::computeAccelerator(S32 dl) MatrixF mat(true); Point3F n(0, 0, 1); - const TSDetail* detail = &details[dl]; + const TSDetail* detail = &mDetails[dl]; S32 ss = detail->subShapeNum; S32 od = detail->objectDetailNum; - S32 start = subShapeFirstObject[ss]; - S32 end = subShapeNumObjects[ss] + start; + S32 start = mSubShapeFirstObject[ss]; + S32 end = mSubShapeNumObjects[ss] + start; if (start < end) { // run through objects and collide @@ -2087,10 +2087,10 @@ void TSShape::computeAccelerator(S32 dl) U32 surfaceKey = 0; for (S32 i = start; i < end; i++) { - const TSObject* obj = &objects[i]; + const TSObject* obj = &mObjects[i]; if (obj->numMeshes && od < obj->numMeshes) { - TSMesh* mesh = meshes[obj->startMeshIndex + od]; + TSMesh* mesh = mMeshes[obj->startMeshIndex + od]; if (mesh) mesh->getFeatures(0, mat, n, &cf, surfaceKey); } @@ -2145,7 +2145,7 @@ void TSShape::computeAccelerator(S32 dl) // Ok, so now we have a vertex list. Lets copy that out... ConvexHullAccelerator* accel = new ConvexHullAccelerator; - detailCollisionAccelerators[dl] = accel; + mDetailCollisionAccelerators[dl] = accel; accel->numVerts = cf.mVertexList.size(); accel->vertexList = new Point3F[accel->numVerts]; dMemcpy(accel->vertexList, cf.mVertexList.address(), sizeof(Point3F) * accel->numVerts); diff --git a/Engine/source/ts/tsShape.h b/Engine/source/ts/tsShape.h index 676b323fe..84bf75964 100644 --- a/Engine/source/ts/tsShape.h +++ b/Engine/source/ts/tsShape.h @@ -274,25 +274,25 @@ class TSShape /// @name Shape Vector Data /// @{ - Vector nodes; - Vector objects; - Vector objectStates; - Vector subShapeFirstNode; - Vector subShapeFirstObject; - Vector detailFirstSkin; - Vector subShapeNumNodes; - Vector subShapeNumObjects; - Vector details; - Vector defaultRotations; - Vector defaultTranslations; + Vector mNodes; + Vector mObjects; + Vector mObjectStates; + Vector mSubShapeFirstNode; + Vector mSubShapeFirstObject; + Vector mDetailFirstSkin; + Vector mSubShapeNumNodes; + Vector mSubShapeNumObjects; + Vector mDetails; + Vector mDefaultRotations; + Vector mDefaultTranslations; /// @} /// These are set up at load time, but memory is allocated along with loaded data /// @{ - Vector subShapeFirstTranslucentObject; - Vector meshes; + Vector mSubShapeFirstTranslucentObject; + Vector mMeshes; /// @} @@ -306,39 +306,39 @@ class TSShape /// - intraDL is at 0 when if shape were any farther away we'd be at dl+1 /// @{ - Vector alphaIn; - Vector alphaOut + Vector mAlphaIn; + Vector mAlphaOut ; /// @} /// @name Resizeable vectors /// @{ - Vector sequences; - Vector nodeRotations; - Vector nodeTranslations; - Vector nodeUniformScales; - Vector nodeAlignedScales; - Vector nodeArbitraryScaleRots; - Vector nodeArbitraryScaleFactors; - Vector groundRotations; - Vector groundTranslations; - Vector triggers; - Vector billboardDetails; - Vector detailCollisionAccelerators; - Vector names; + Vector mSequences; + Vector mNodeRotations; + Vector mNodeTranslations; + Vector mNodeUniformScales; + Vector mNodeAlignedScales; + Vector mNodeArbitraryScaleRots; + Vector mNodeArbitraryScaleFactors; + Vector mGroundRotations; + Vector mGroundTranslations; + Vector mTriggers; + Vector mBillboardDetails; + Vector mDetailCollisionAccelerators; + Vector mNames; /// @} - TSMaterialList * materialList; + TSMaterialList * mMaterialList; /// @name Bounding /// @{ - F32 radius; - F32 tubeRadius; - Point3F center; - Box3F bounds; + F32 mRadius; + F32 mTubeRadius; + Point3F mCenter; + Box3F mBounds; /// @} @@ -348,7 +348,7 @@ class TSShape S32 mSmallestVisibleDL; ///< @see mSmallestVisibleSize S32 mReadVersion; ///< File version that this shape was read from. U32 mFlags; ///< hasTranslucancy - U32 data; ///< User-defined data storage. + U32 mData; ///< User-defined data storage. /// If enabled detail selection will use the /// legacy screen error method for lod. @@ -659,34 +659,34 @@ class TSShape inline QuatF & TSShape::getRotation(const Sequence & seq, S32 keyframeNum, S32 rotNum, QuatF * quat) const { - return nodeRotations[seq.baseRotation + rotNum*seq.numKeyframes + keyframeNum].getQuatF(quat); + return mNodeRotations[seq.baseRotation + rotNum*seq.numKeyframes + keyframeNum].getQuatF(quat); } inline const Point3F & TSShape::getTranslation(const Sequence & seq, S32 keyframeNum, S32 tranNum) const { - return nodeTranslations[seq.baseTranslation + tranNum*seq.numKeyframes + keyframeNum]; + return mNodeTranslations[seq.baseTranslation + tranNum*seq.numKeyframes + keyframeNum]; } inline F32 TSShape::getUniformScale(const Sequence & seq, S32 keyframeNum, S32 scaleNum) const { - return nodeUniformScales[seq.baseScale + scaleNum*seq.numKeyframes + keyframeNum]; + return mNodeUniformScales[seq.baseScale + scaleNum*seq.numKeyframes + keyframeNum]; } inline const Point3F & TSShape::getAlignedScale(const Sequence & seq, S32 keyframeNum, S32 scaleNum) const { - return nodeAlignedScales[seq.baseScale + scaleNum*seq.numKeyframes + keyframeNum]; + return mNodeAlignedScales[seq.baseScale + scaleNum*seq.numKeyframes + keyframeNum]; } inline TSScale & TSShape::getArbitraryScale(const Sequence & seq, S32 keyframeNum, S32 scaleNum, TSScale * scale) const { - nodeArbitraryScaleRots[seq.baseScale + scaleNum*seq.numKeyframes + keyframeNum].getQuatF(&scale->mRotate); - scale->mScale = nodeArbitraryScaleFactors[seq.baseScale + scaleNum*seq.numKeyframes + keyframeNum]; + mNodeArbitraryScaleRots[seq.baseScale + scaleNum*seq.numKeyframes + keyframeNum].getQuatF(&scale->mRotate); + scale->mScale = mNodeArbitraryScaleFactors[seq.baseScale + scaleNum*seq.numKeyframes + keyframeNum]; return *scale; } inline const TSShape::ObjectState & TSShape::getObjectState(const Sequence & seq, S32 keyframeNum, S32 objectNum) const { - return objectStates[seq.baseObjectState + objectNum*seq.numKeyframes + keyframeNum]; + return mObjectStates[seq.baseObjectState + objectNum*seq.numKeyframes + keyframeNum]; } #endif diff --git a/Engine/source/ts/tsShapeConstruct.cpp b/Engine/source/ts/tsShapeConstruct.cpp index 0590b4fe9..a77735c3b 100644 --- a/Engine/source/ts/tsShapeConstruct.cpp +++ b/Engine/source/ts/tsShapeConstruct.cpp @@ -482,7 +482,7 @@ bool TSShapeConstructor::writeField(StringTableEntry fieldname, const char *valu return ret; \ } \ } \ - TSShape::Node* var = var##Index < 0 ? NULL : &(mShape->nodes[var##Index]); \ + TSShape::Node* var = var##Index < 0 ? NULL : &(mShape->mNodes[var##Index]); \ TORQUE_UNUSED(var##Index); \ TORQUE_UNUSED(var) @@ -495,7 +495,7 @@ bool TSShapeConstructor::writeField(StringTableEntry fieldname, const char *valu "node '%s'", name); \ return ret; \ } \ - TSShape::Node* var = &(mShape->nodes[var##Index]); \ + TSShape::Node* var = &(mShape->mNodes[var##Index]); \ TORQUE_UNUSED(var##Index); \ TORQUE_UNUSED(var) @@ -508,7 +508,7 @@ bool TSShapeConstructor::writeField(StringTableEntry fieldname, const char *valu "object '%s'", name); \ return ret; \ } \ - TSShape::Object* var = &(mShape->objects[var##Index]); \ + TSShape::Object* var = &(mShape->mObjects[var##Index]); \ TORQUE_UNUSED(var##Index); \ TORQUE_UNUSED(var) @@ -531,7 +531,7 @@ bool TSShapeConstructor::writeField(StringTableEntry fieldname, const char *valu "sequence named '%s'", name); \ return ret; \ } \ - TSShape::Sequence* var = &(mShape->sequences[var##Index]); \ + TSShape::Sequence* var = &(mShape->mSequences[var##Index]); \ TORQUE_UNUSED(var##Index); \ TORQUE_UNUSED(var); @@ -695,7 +695,7 @@ DefineTSShapeConstructorMethod( getNodeCount, S32, (),, "%count = %this.getNodeCount();\n" "@endtsexample\n" ) { - return mShape->nodes.size(); + return mShape->mNodes.size(); }} DefineTSShapeConstructorMethod( getNodeIndex, S32, ( const char* name ),, @@ -723,8 +723,8 @@ DefineTSShapeConstructorMethod( getNodeName, const char*, ( S32 index ),, " echo(%i SPC %this.getNodeName(%i));\n" "@endtsexample\n" ) { - CHECK_INDEX_IN_RANGE( getNodeName, index, mShape->nodes.size(), "" ); - return mShape->getName( mShape->nodes[index].nameIndex ); + CHECK_INDEX_IN_RANGE( getNodeName, index, mShape->mNodes.size(), "" ); + return mShape->getName( mShape->mNodes[index].nameIndex ); }} DefineTSShapeConstructorMethod( getNodeParentName, const char*, ( const char* name ),, @@ -742,7 +742,7 @@ DefineTSShapeConstructorMethod( getNodeParentName, const char*, ( const char* na if ( node->parentIndex < 0 ) return ""; else - return mShape->getName( mShape->nodes[node->parentIndex].nameIndex ); + return mShape->getName( mShape->mNodes[node->parentIndex].nameIndex ); }} DefineTSShapeConstructorMethod( setNodeParent, bool, ( const char* name, const char* parentName ),, @@ -814,7 +814,7 @@ DefineTSShapeConstructorMethod( getNodeChildName, const char*, ( const char* nam mShape->getNodeChildren( nodeIndex, nodeChildren ); CHECK_INDEX_IN_RANGE( getNodeChildName, index, nodeChildren.size(), "" ); - return mShape->getName( mShape->nodes[nodeChildren[index]].nameIndex ); + return mShape->getName( mShape->mNodes[nodeChildren[index]].nameIndex ); }} DefineTSShapeConstructorMethod( getNodeObjectCount, S32, ( const char* name ),, @@ -852,7 +852,7 @@ DefineTSShapeConstructorMethod( getNodeObjectName, const char*, ( const char* na mShape->getNodeObjects( nodeIndex, nodeObjects ); CHECK_INDEX_IN_RANGE( getNodeObjectName, index, nodeObjects.size(), "" ); - return mShape->getName( mShape->objects[nodeObjects[index]].nameIndex ); + return mShape->getName( mShape->mObjects[nodeObjects[index]].nameIndex ); }} DefineTSShapeConstructorMethod( getNodeTransform, TransformF, ( const char* name, bool isWorld ), ( false ), @@ -884,8 +884,8 @@ DefineTSShapeConstructorMethod( getNodeTransform, TransformF, ( const char* name else { // Local transform - pos = mShape->defaultTranslations[nodeIndex]; - const Quat16& q16 = mShape->defaultRotations[nodeIndex]; + pos = mShape->mDefaultTranslations[nodeIndex]; + const Quat16& q16 = mShape->mDefaultRotations[nodeIndex]; aa.set( q16.getQuatF() ); } @@ -1067,7 +1067,7 @@ DefineTSShapeConstructorMethod( getObjectCount, S32, (),, (), 0, "%count = %this.getObjectCount();\n" "@endtsexample\n" ) { - return mShape->objects.size(); + return mShape->mObjects.size(); }} DefineTSShapeConstructorMethod( getObjectName, const char*, ( S32 index ),, @@ -1082,9 +1082,9 @@ DefineTSShapeConstructorMethod( getObjectName, const char*, ( S32 index ),, " echo( %i SPC %this.getObjectName( %i ) );\n" "@endtsexample\n" ) { - CHECK_INDEX_IN_RANGE( getObjectName, index, mShape->objects.size(), "" ); + CHECK_INDEX_IN_RANGE( getObjectName, index, mShape->mObjects.size(), "" ); - return mShape->getName( mShape->objects[index].nameIndex ); + return mShape->getName( mShape->mObjects[index].nameIndex ); }} DefineTSShapeConstructorMethod( getObjectIndex, S32, ( const char* name ),, @@ -1113,7 +1113,7 @@ DefineTSShapeConstructorMethod( getObjectNode, const char*, ( const char* name ) if ( obj->nodeIndex < 0 ) return ""; else - return mShape->getName( mShape->nodes[obj->nodeIndex].nameIndex ); + return mShape->getName( mShape->mNodes[obj->nodeIndex].nameIndex ); }} DefineTSShapeConstructorMethod( setObjectNode, bool, ( const char* objName, const char* nodeName ),, @@ -1217,7 +1217,7 @@ DefineTSShapeConstructorMethod( getMeshName, const char*, ( const char* name, S3 CHECK_INDEX_IN_RANGE( getMeshName, index, objectDetails.size(), "" ); char* returnBuffer = Con::getReturnBuffer(256); - dSprintf(returnBuffer, 256, "%s %d", name, (S32)mShape->details[objectDetails[index]].size); + dSprintf(returnBuffer, 256, "%s %d", name, (S32)mShape->mDetails[objectDetails[index]].size); return returnBuffer; }} @@ -1242,7 +1242,7 @@ DefineTSShapeConstructorMethod( getMeshSize, S32, ( const char* name, S32 index CHECK_INDEX_IN_RANGE( getMeshName, index, objectDetails.size(), -1 ); - return (S32)mShape->details[objectDetails[index]].size; + return (S32)mShape->mDetails[objectDetails[index]].size; }} DefineTSShapeConstructorMethod( setMeshSize, bool, ( const char* name, S32 size ),, @@ -1327,8 +1327,8 @@ DefineTSShapeConstructorMethod( getMeshMaterial, const char*, ( const char* name // Return the name of the first material attached to this mesh S32 matIndex = mesh->mPrimitives[0].matIndex & TSDrawPrimitive::MaterialMask; - if ((matIndex >= 0) && (matIndex < mShape->materialList->size())) - return mShape->materialList->getMaterialName( matIndex ); + if ((matIndex >= 0) && (matIndex < mShape->mMaterialList->size())) + return mShape->mMaterialList->getMaterialName( matIndex ); else return ""; }} @@ -1350,16 +1350,16 @@ DefineTSShapeConstructorMethod( setMeshMaterial, bool, ( const char* meshName, c // Check if this material is already in the shape S32 matIndex; - for ( matIndex = 0; matIndex < mShape->materialList->size(); matIndex++ ) + for ( matIndex = 0; matIndex < mShape->mMaterialList->size(); matIndex++ ) { - if ( dStrEqual( matName, mShape->materialList->getMaterialName( matIndex ) ) ) + if ( dStrEqual( matName, mShape->mMaterialList->getMaterialName( matIndex ) ) ) break; } - if ( matIndex == mShape->materialList->size() ) + if ( matIndex == mShape->mMaterialList->size() ) { // Add a new material to the shape U32 flags = TSMaterialList::S_Wrap | TSMaterialList::T_Wrap; - mShape->materialList->push_back( matName, flags ); + mShape->mMaterialList->push_back( matName, flags ); } // Set this material for all primitives in the mesh @@ -1431,7 +1431,7 @@ DefineTSShapeConstructorMethod( getBounds, Box3F, (),, "Get the bounding box for the shape.\n" "@return Bounding box \"minX minY minZ maxX maxY maxZ\"" ) { - return mShape->bounds; + return mShape->mBounds; }} DefineTSShapeConstructorMethod( setBounds, bool, ( Box3F bbox ),, @@ -1443,10 +1443,10 @@ DefineTSShapeConstructorMethod( setBounds, bool, ( Box3F bbox ),, // Set shape bounds TSShape* shape = mShape; - shape->bounds = bbox; - shape->bounds.getCenter( &shape->center ); - shape->radius = ( shape->bounds.maxExtents - shape->center ).len(); - shape->tubeRadius = shape->radius; + shape->mBounds = bbox; + shape->mBounds.getCenter( &shape->mCenter ); + shape->mRadius = ( shape->mBounds.maxExtents - shape->mCenter ).len(); + shape->mTubeRadius = shape->mRadius; ADD_TO_CHANGE_SET(); return true; @@ -1458,7 +1458,7 @@ DefineTSShapeConstructorMethod( getDetailLevelCount, S32, (),, (), 0, "Get the total number of detail levels in the shape.\n" "@return the number of detail levels in the shape\n" ) { - return mShape->details.size(); + return mShape->mDetails.size(); }} DefineTSShapeConstructorMethod( getDetailLevelName, const char*, ( S32 index ),, @@ -1473,9 +1473,9 @@ DefineTSShapeConstructorMethod( getDetailLevelName, const char*, ( S32 index ),, " echo( %i SPC %this.getDetailLevelName( %i ) );\n" "@endtsexample\n" ) { - CHECK_INDEX_IN_RANGE( getDetailLevelName, index, mShape->details.size(), "" ); + CHECK_INDEX_IN_RANGE( getDetailLevelName, index, mShape->mDetails.size(), "" ); - return mShape->getName(mShape->details[index].nameIndex); + return mShape->getName(mShape->mDetails[index].nameIndex); }} DefineTSShapeConstructorMethod( getDetailLevelSize, S32, ( S32 index),, @@ -1490,9 +1490,9 @@ DefineTSShapeConstructorMethod( getDetailLevelSize, S32, ( S32 index),, " echo( \"Detail\" @ %i @ \" has size \" @ %this.getDetailLevelSize( %i ) );\n" "@endtsexample\n" ) { - CHECK_INDEX_IN_RANGE( getDetailLevelSize, index, mShape->details.size(), 0 ); + CHECK_INDEX_IN_RANGE( getDetailLevelSize, index, mShape->mDetails.size(), 0 ); - return (S32)mShape->details[index].size; + return (S32)mShape->mDetails[index].size; }} DefineTSShapeConstructorMethod( getDetailLevelIndex, S32, ( S32 size ),, @@ -1567,9 +1567,9 @@ DefineTSShapeConstructorMethod( getImposterDetailLevel, S32, (),, (), -1, "@return imposter detail level index, or -1 if the shape does not use " "imposters.\n\n" ) { - for ( S32 i = 0; i < mShape->details.size(); i++ ) + for ( S32 i = 0; i < mShape->mDetails.size(); i++ ) { - if ( mShape->details[i].subShapeNum < 0 ) + if ( mShape->mDetails[i].subShapeNum < 0 ) return i; } return -1; @@ -1597,10 +1597,10 @@ DefineTSShapeConstructorMethod( getImposterSettings, const char*, ( S32 index ), " echo( \"Imposter settings: \" @ %this.getImposterSettings( %index ) );\n" "@endtsexample\n" ) { - CHECK_INDEX_IN_RANGE( getImposterSettings, index, mShape->details.size(), "" ); + CHECK_INDEX_IN_RANGE( getImposterSettings, index, mShape->mDetails.size(), "" ); // Return information about the detail level - const TSShape::Detail& det = mShape->details[index]; + const TSShape::Detail& det = mShape->mDetails[index]; char* returnBuffer = Con::getReturnBuffer(512); dSprintf(returnBuffer, 512, "%d\t%d\t%d\t%d\t%d\t%d\t%g", @@ -1670,7 +1670,7 @@ DefineTSShapeConstructorMethod( getSequenceCount, S32, (),, (), 0, "Get the total number of sequences in the shape.\n" "@return the number of sequences in the shape\n\n" ) { - return mShape->sequences.size(); + return mShape->mSequences.size(); }} DefineTSShapeConstructorMethod( getSequenceIndex, S32, ( const char* name),, @@ -1699,9 +1699,9 @@ DefineTSShapeConstructorMethod( getSequenceName, const char*, ( S32 index ),, " echo( %i SPC %this.getSequenceName( %i ) );\n" "@endtsexample\n" ) { - CHECK_INDEX_IN_RANGE( getSequenceName, index, mShape->sequences.size(), "" ); + CHECK_INDEX_IN_RANGE( getSequenceName, index, mShape->mSequences.size(), "" ); - return mShape->getName( mShape->sequences[index].nameIndex ); + return mShape->getName( mShape->mSequences[index].nameIndex ); }} DefineTSShapeConstructorMethod( getSequenceSource, const char*, ( const char* name ),, @@ -1789,12 +1789,12 @@ DefineTSShapeConstructorMethod( getSequenceGroundSpeed, const char*, ( const cha Point3F trans(0,0,0), rot(0,0,0); if ( seq->numGroundFrames > 0 ) { - const Point3F& p1 = mShape->groundTranslations[seq->firstGroundFrame]; - const Point3F& p2 = mShape->groundTranslations[seq->firstGroundFrame + 1]; + const Point3F& p1 = mShape->mGroundTranslations[seq->firstGroundFrame]; + const Point3F& p2 = mShape->mGroundTranslations[seq->firstGroundFrame + 1]; trans = p2 - p1; - QuatF r1 = mShape->groundRotations[seq->firstGroundFrame].getQuatF(); - QuatF r2 = mShape->groundRotations[seq->firstGroundFrame + 1].getQuatF(); + QuatF r1 = mShape->mGroundRotations[seq->firstGroundFrame].getQuatF(); + QuatF r2 = mShape->mGroundRotations[seq->firstGroundFrame + 1].getQuatF(); r2 -= r1; MatrixF mat; @@ -2032,7 +2032,7 @@ DefineTSShapeConstructorMethod( getTrigger, const char*, ( const char* name, S32 CHECK_INDEX_IN_RANGE( getTrigger, index, seq->numTriggers, "" ); - const TSShape::Trigger& trig = mShape->triggers[seq->firstTrigger + index]; + const TSShape::Trigger& trig = mShape->mTriggers[seq->firstTrigger + index]; S32 frame = trig.pos * seq->numKeyframes; S32 state = getBinLog2(trig.state & TSShape::Trigger::StateMask) + 1; if (!(trig.state & TSShape::Trigger::StateOn)) @@ -2138,9 +2138,9 @@ void TSShapeConstructor::ChangeSet::write(TSShape* shape, Stream& stream, const // Remove all __backup__ sequences (used during Shape Editing) if (shape) { - for (S32 i = 0; i < shape->sequences.size(); i++) + for (S32 i = 0; i < shape->mSequences.size(); i++) { - const char* seqName = shape->getName( shape->sequences[i].nameIndex ); + const char* seqName = shape->getName( shape->mSequences[i].nameIndex ); if ( dStrStartsWith( seqName, "__backup__" ) ) { Command cmd( "removeSequence" ); diff --git a/Engine/source/ts/tsShapeEdit.cpp b/Engine/source/ts/tsShapeEdit.cpp index 4eac3c3f6..5d4a1ce5f 100644 --- a/Engine/source/ts/tsShapeEdit.cpp +++ b/Engine/source/ts/tsShapeEdit.cpp @@ -45,8 +45,8 @@ S32 TSShape::addName(const String& name) if (index >= 0) return index; - names.push_back(StringTable->insert(name)); - return names.size()-1; + mNames.push_back(StringTable->insert(name)); + return mNames.size()-1; } void TSShape::updateSmallestVisibleDL() @@ -55,14 +55,14 @@ void TSShape::updateSmallestVisibleDL() mSmallestVisibleDL = -1; mSmallestVisibleSize = F32_MAX; F32 maxSize = 0.0f; - for (S32 i = 0; i < details.size(); i++) + for (S32 i = 0; i < mDetails.size(); i++) { - maxSize = getMax( maxSize, details[i].size ); + maxSize = getMax( maxSize, mDetails[i].size ); - if ((details[i].size >= 0) && (details[i].size < mSmallestVisibleSize)) + if ((mDetails[i].size >= 0) && (mDetails[i].size < mSmallestVisibleSize)) { mSmallestVisibleDL = i; - mSmallestVisibleSize = details[i].size; + mSmallestVisibleSize = mDetails[i].size; } } @@ -73,20 +73,20 @@ void TSShape::updateSmallestVisibleDL() F32 pixelSize = (F32)l; S32 dl = -1; - for ( U32 d=0; d < details.size(); d++ ) + for ( U32 d=0; d < mDetails.size(); d++ ) { // Break when we get to hidden detail // levels like collision shapes. - if ( details[d].size < 0 ) + if ( mDetails[d].size < 0 ) break; - if ( pixelSize > details[d].size ) + if ( pixelSize > mDetails[d].size ) { dl = d; break; } - if ( d + 1 >= details.size() || details[d+1].size < 0 ) + if ( d + 1 >= mDetails.size() || mDetails[d+1].size < 0 ) { // We've run out of details and haven't found anything? // Let's just grab this one. @@ -99,8 +99,8 @@ void TSShape::updateSmallestVisibleDL() F32 intraDL = 0; if ( dl > -1 ) { - F32 curSize = details[dl].size; - F32 nextSize = dl == 0 ? 2.0f * curSize : details[dl - 1].size; + F32 curSize = mDetails[dl].size; + F32 nextSize = dl == 0 ? 2.0f * curSize : mDetails[dl - 1].size; intraDL = mClampF( nextSize - curSize > 0.01f ? (pixelSize - curSize) / (nextSize - curSize) : 1.0f, 0, 1 ); } @@ -113,7 +113,7 @@ void TSShape::updateSmallestVisibleDL() // See setDetailFromDistance(). // mUseDetailFromScreenError = mSmallestVisibleDL >= 0 && - details.first().maxError >= 0; + mDetails.first().maxError >= 0; } S32 TSShape::addDetail(const String& dname, S32 size, S32 subShapeNum) @@ -122,20 +122,20 @@ S32 TSShape::addDetail(const String& dname, S32 size, S32 subShapeNum) // Check if this detail size has already been added S32 index; - for (index = 0; index < details.size(); index++) + for (index = 0; index < mDetails.size(); index++) { - if ((details[index].size == size) && - (details[index].subShapeNum == subShapeNum) && - (details[index].nameIndex == nameIndex)) + if ((mDetails[index].size == size) && + (mDetails[index].subShapeNum == subShapeNum) && + (mDetails[index].nameIndex == nameIndex)) return index; - if (details[index].size < size) + if (mDetails[index].size < size) break; } // Create a new detail level at the right index, so array // remains sorted by detail size (from largest to smallest) - details.insert(index); - TSShape::Detail &detail = details[index]; + mDetails.insert(index); + TSShape::Detail &detail = mDetails[index]; // Clear the detail to ensure no garbage values // are left in any vars we don't set. @@ -151,15 +151,15 @@ S32 TSShape::addDetail(const String& dname, S32 size, S32 subShapeNum) detail.polyCount = 0; // Resize alpha vectors - alphaIn.increment(); - alphaOut.increment(); + mAlphaIn.increment(); + mAlphaOut.increment(); // Fixup objectDetailNum in other detail levels - for (S32 i = index+1; i < details.size(); i++) + for (S32 i = index+1; i < mDetails.size(); i++) { - if ((details[i].subShapeNum >= 0) && - ((subShapeNum == -1) || (details[i].subShapeNum == subShapeNum))) - details[i].objectDetailNum++; + if ((mDetails[i].subShapeNum >= 0) && + ((subShapeNum == -1) || (mDetails[i].subShapeNum == subShapeNum))) + mDetails[i].objectDetailNum++; } // Update smallest visible detail @@ -179,7 +179,7 @@ S32 TSShape::addImposter(const String& cachePath, S32 size, S32 numEquatorSteps, { // Size is in use. If the detail is already an imposter, we can just change // the settings, otherwise quit - if ( details[detIndex].subShapeNum >= 0 ) + if ( mDetails[detIndex].subShapeNum >= 0 ) { Con::errorf( "TSShape::addImposter: A non-billboard detail already " "exists at size %d", size ); @@ -190,16 +190,16 @@ S32 TSShape::addImposter(const String& cachePath, S32 size, S32 numEquatorSteps, { // Size is not in use. If an imposter already exists, change its size, otherwise // create a new detail - for ( detIndex = 0; detIndex < details.size(); ++detIndex ) + for ( detIndex = 0; detIndex < mDetails.size(); ++detIndex ) { - if ( details[detIndex].subShapeNum < 0 ) + if ( mDetails[detIndex].subShapeNum < 0 ) { // Change the imposter detail size - setDetailSize( details[detIndex].size, size ); + setDetailSize( mDetails[detIndex].size, size ); break; } } - if ( detIndex == details.size() ) + if ( detIndex == mDetails.size() ) { isNewDetail = true; detIndex = addDetail( "bbDetail", size, -1 ); @@ -207,7 +207,7 @@ S32 TSShape::addImposter(const String& cachePath, S32 size, S32 numEquatorSteps, } // Now set the billboard properties. - Detail &detail = details[detIndex]; + Detail &detail = mDetails[detIndex]; // In prior to DTS version 26 we would pack the autobillboard // into this single 32bit value. This was prone to overflows @@ -228,14 +228,14 @@ S32 TSShape::addImposter(const String& cachePath, S32 size, S32 numEquatorSteps, if ( isNewDetail ) { // Add NULL meshes for this detail - for ( S32 iObj = 0; iObj < objects.size(); ++iObj ) + for ( S32 iObj = 0; iObj < mObjects.size(); ++iObj ) { - if ( detIndex < objects[iObj].numMeshes ) + if ( detIndex < mObjects[iObj].numMeshes ) { - objects[iObj].numMeshes++; - meshes.insert( objects[iObj].startMeshIndex + detIndex, NULL ); - for (S32 j = iObj + 1; j < objects.size(); ++j ) - objects[j].startMeshIndex++; + mObjects[iObj].numMeshes++; + mMeshes.insert( mObjects[iObj].startMeshIndex + detIndex, NULL ); + for (S32 j = iObj + 1; j < mObjects.size(); ++j ) + mObjects[j].startMeshIndex++; } } @@ -243,15 +243,15 @@ S32 TSShape::addImposter(const String& cachePath, S32 size, S32 numEquatorSteps, if ( GFXDevice::devicePresent() ) setupBillboardDetails( cachePath ); - while ( detailCollisionAccelerators.size() < details.size() ) - detailCollisionAccelerators.push_back( NULL ); + while ( mDetailCollisionAccelerators.size() < mDetails.size() ) + mDetailCollisionAccelerators.push_back( NULL ); } else { - if ( billboardDetails.size() && GFXDevice::devicePresent() ) + if ( mBillboardDetails.size() && GFXDevice::devicePresent() ) { - delete billboardDetails[detIndex]; - billboardDetails[detIndex] = new TSLastDetail( + delete mBillboardDetails[detIndex]; + mBillboardDetails[detIndex] = new TSLastDetail( this, cachePath, detail.bbEquatorSteps, @@ -261,7 +261,7 @@ S32 TSShape::addImposter(const String& cachePath, S32 size, S32 numEquatorSteps, detail.bbDetailLevel, detail.bbDimension ); - billboardDetails[detIndex]->update( true ); + mBillboardDetails[detIndex]->update( true ); } } @@ -272,41 +272,41 @@ bool TSShape::removeImposter() { // Find the imposter detail level S32 detIndex; - for ( detIndex = 0; detIndex < details.size(); ++detIndex ) + for ( detIndex = 0; detIndex < mDetails.size(); ++detIndex ) { - if ( details[detIndex].subShapeNum < 0 ) + if ( mDetails[detIndex].subShapeNum < 0 ) break; } - if ( detIndex == details.size() ) + if ( detIndex == mDetails.size() ) { Con::errorf( "TSShape::removeImposter: No imposter detail level found in shape" ); return false; } // Remove the detail level - details.erase( detIndex ); + mDetails.erase( detIndex ); - if ( detIndex < billboardDetails.size() ) + if ( detIndex < mBillboardDetails.size() ) { // Delete old textures - TSLastDetail* bb = billboardDetails[detIndex]; + TSLastDetail* bb = mBillboardDetails[detIndex]; bb->deleteImposterCacheTextures(); - delete billboardDetails[detIndex]; + delete mBillboardDetails[detIndex]; } - billboardDetails.clear(); + mBillboardDetails.clear(); - detailCollisionAccelerators.erase( detIndex ); + mDetailCollisionAccelerators.erase( detIndex ); // Remove the (NULL) meshes from each object - for ( S32 iObj = 0; iObj < objects.size(); ++iObj ) + for ( S32 iObj = 0; iObj < mObjects.size(); ++iObj ) { - if ( detIndex < objects[iObj].numMeshes ) + if ( detIndex < mObjects[iObj].numMeshes ) { - objects[iObj].numMeshes--; - meshes.erase( objects[iObj].startMeshIndex + detIndex ); - for (S32 j = iObj + 1; j < objects.size(); ++j ) - objects[j].startMeshIndex--; + mObjects[iObj].numMeshes--; + mMeshes.erase( mObjects[iObj].startMeshIndex + detIndex ); + for (S32 j = iObj + 1; j < mObjects.size(); ++j ) + mObjects[j].startMeshIndex--; } } @@ -339,19 +339,19 @@ bool TSShape::removeName(const String& name) { // Check if the name is still in use S32 nameIndex = findName(name); - if ((findByName(nodes, nameIndex) >= 0) || - (findByName(objects, nameIndex) >= 0) || - (findByName(sequences, nameIndex) >= 0) || - (findByName(details, nameIndex) >= 0)) + if ((findByName(mNodes, nameIndex) >= 0) || + (findByName(mObjects, nameIndex) >= 0) || + (findByName(mSequences, nameIndex) >= 0) || + (findByName(mDetails, nameIndex) >= 0)) return false; // Remove the name, then update nameIndex for affected elements - names.erase(nameIndex); + mNames.erase(nameIndex); - adjustForNameRemoval(nodes, nameIndex); - adjustForNameRemoval(objects, nameIndex); - adjustForNameRemoval(sequences, nameIndex); - adjustForNameRemoval(details, nameIndex); + adjustForNameRemoval(mNodes, nameIndex); + adjustForNameRemoval(mObjects, nameIndex); + adjustForNameRemoval(mSequences, nameIndex); + adjustForNameRemoval(mDetails, nameIndex); return true; } @@ -387,22 +387,22 @@ template bool doRename(TSShape* shape, Vector& group, const String& bool TSShape::renameNode(const String& oldName, const String& newName) { - return doRename(this, nodes, oldName, newName); + return doRename(this, mNodes, oldName, newName); } bool TSShape::renameObject(const String& oldName, const String& newName) { - return doRename(this, objects, oldName, newName); + return doRename(this, mObjects, oldName, newName); } bool TSShape::renameDetail(const String& oldName, const String& newName) { - return doRename(this, details, oldName, newName); + return doRename(this, mDetails, oldName, newName); } bool TSShape::renameSequence(const String& oldName, const String& newName) { - return doRename(this, sequences, oldName, newName); + return doRename(this, mSequences, oldName, newName); } //----------------------------------------------------------------------------- @@ -410,7 +410,7 @@ bool TSShape::renameSequence(const String& oldName, const String& newName) bool TSShape::addNode(const String& name, const String& parentName, const Point3F& pos, const QuatF& rot) { // Check that adding this node would not exceed the maximum count - if (nodes.size() >= MAX_TS_SET_SIZE) + if (mNodes.size() >= MAX_TS_SET_SIZE) { Con::errorf("TSShape::addNode: Cannot add node, shape already has maximum (%d) nodes", MAX_TS_SET_SIZE); return false; @@ -437,18 +437,18 @@ bool TSShape::addNode(const String& name, const String& parentName, const Point3 // Insert node at the end of the subshape S32 subShapeIndex = (parentIndex >= 0) ? getSubShapeForNode(parentIndex) : 0; - S32 nodeIndex = subShapeNumNodes[subShapeIndex]; + S32 nodeIndex = mSubShapeNumNodes[subShapeIndex]; // Adjust subshape node indices - subShapeNumNodes[subShapeIndex]++; - for (S32 i = subShapeIndex + 1; i < subShapeFirstNode.size(); i++) - subShapeFirstNode[i]++; + mSubShapeNumNodes[subShapeIndex]++; + for (S32 i = subShapeIndex + 1; i < mSubShapeFirstNode.size(); i++) + mSubShapeFirstNode[i]++; // Update animation sequences - for (S32 iSeq = 0; iSeq < sequences.size(); iSeq++) + for (S32 iSeq = 0; iSeq < mSequences.size(); iSeq++) { // Update animation matters arrays (new node is not animated) - TSShape::Sequence& seq = sequences[iSeq]; + TSShape::Sequence& seq = mSequences[iSeq]; seq.translationMatters.insert(nodeIndex, false); seq.rotationMatters.insert(nodeIndex, false); seq.scaleMatters.insert(nodeIndex, false); @@ -461,30 +461,30 @@ bool TSShape::addNode(const String& name, const String& parentName, const Point3 node.firstChild = -1; node.firstObject = -1; node.nextSibling = -1; - nodes.insert(nodeIndex, node); + mNodes.insert(nodeIndex, node); // Insert node default translation and rotation Quat16 rot16; rot16.set(rot); - defaultTranslations.insert(nodeIndex, pos); - defaultRotations.insert(nodeIndex, rot16); + mDefaultTranslations.insert(nodeIndex, pos); + mDefaultRotations.insert(nodeIndex, rot16); // Fixup node indices - for (S32 i = 0; i < nodes.size(); i++) + for (S32 i = 0; i < mNodes.size(); i++) { - if (nodes[i].parentIndex >= nodeIndex) - nodes[i].parentIndex++; + if (mNodes[i].parentIndex >= nodeIndex) + mNodes[i].parentIndex++; } - for (S32 i = 0; i < objects.size(); i++) + for (S32 i = 0; i < mObjects.size(); i++) { - if (objects[i].nodeIndex >= nodeIndex) - objects[i].nodeIndex++; + if (mObjects[i].nodeIndex >= nodeIndex) + mObjects[i].nodeIndex++; } - for (S32 i = 0; i < meshes.size(); i++) + for (S32 i = 0; i < mMeshes.size(); i++) { - if (meshes[i] && (meshes[i]->getMeshType() == TSMesh::SkinMeshType)) + if (mMeshes[i] && (mMeshes[i]->getMeshType() == TSMesh::SkinMeshType)) { - TSSkinMesh* skin = dynamic_cast(meshes[i]); + TSSkinMesh* skin = dynamic_cast(mMeshes[i]); for (S32 j = 0; j < skin->mBatchData.nodeIndex.size(); j++) { if (skin->mBatchData.nodeIndex[j] >= nodeIndex) @@ -536,7 +536,7 @@ bool TSShape::removeNode(const String& name) return false; } - S32 nodeParentIndex = nodes[nodeIndex].parentIndex; + S32 nodeParentIndex = mNodes[nodeIndex].parentIndex; // Warn if there are objects attached to this node Vector nodeObjects; @@ -545,30 +545,30 @@ bool TSShape::removeNode(const String& name) { Con::warnf("TSShape::removeNode: Node '%s' has %d objects attached, these " "will be reassigned to the node's parent ('%s')", name.c_str(), nodeObjects.size(), - ((nodeParentIndex >= 0) ? getName(nodes[nodeParentIndex].nameIndex).c_str() : "null")); + ((nodeParentIndex >= 0) ? getName(mNodes[nodeParentIndex].nameIndex).c_str() : "null")); } // Update animation sequences - for (S32 iSeq = 0; iSeq < sequences.size(); iSeq++) + for (S32 iSeq = 0; iSeq < mSequences.size(); iSeq++) { - TSShape::Sequence& seq = sequences[iSeq]; + TSShape::Sequence& seq = mSequences[iSeq]; // Remove animated node transforms if (seq.translationMatters.test(nodeIndex)) - eraseStates(nodeTranslations, seq.translationMatters, seq.baseTranslation, seq.numKeyframes, nodeIndex); + eraseStates(mNodeTranslations, seq.translationMatters, seq.baseTranslation, seq.numKeyframes, nodeIndex); if (seq.rotationMatters.test(nodeIndex)) - eraseStates(nodeRotations, seq.rotationMatters, seq.baseRotation, seq.numKeyframes, nodeIndex); + eraseStates(mNodeRotations, seq.rotationMatters, seq.baseRotation, seq.numKeyframes, nodeIndex); if (seq.scaleMatters.test(nodeIndex)) { if (seq.flags & TSShape::ArbitraryScale) { - eraseStates(nodeArbitraryScaleRots, seq.scaleMatters, seq.baseScale, seq.numKeyframes, nodeIndex); - eraseStates(nodeArbitraryScaleFactors, seq.scaleMatters, seq.baseScale, seq.numKeyframes, nodeIndex); + eraseStates(mNodeArbitraryScaleRots, seq.scaleMatters, seq.baseScale, seq.numKeyframes, nodeIndex); + eraseStates(mNodeArbitraryScaleFactors, seq.scaleMatters, seq.baseScale, seq.numKeyframes, nodeIndex); } else if (seq.flags & TSShape::AlignedScale) - eraseStates(nodeAlignedScales, seq.scaleMatters, seq.baseScale, seq.numKeyframes, nodeIndex); + eraseStates(mNodeAlignedScales, seq.scaleMatters, seq.baseScale, seq.numKeyframes, nodeIndex); else - eraseStates(nodeUniformScales, seq.scaleMatters, seq.baseScale, seq.numKeyframes, nodeIndex); + eraseStates(mNodeUniformScales, seq.scaleMatters, seq.baseScale, seq.numKeyframes, nodeIndex); } seq.translationMatters.erase(nodeIndex); @@ -577,42 +577,42 @@ bool TSShape::removeNode(const String& name) } // Remove the node - nodes.erase(nodeIndex); - defaultTranslations.erase(nodeIndex); - defaultRotations.erase(nodeIndex); + mNodes.erase(nodeIndex); + mDefaultTranslations.erase(nodeIndex); + mDefaultRotations.erase(nodeIndex); // Adjust subshape node indices S32 subShapeIndex = getSubShapeForNode(nodeIndex); - subShapeNumNodes[subShapeIndex]--; - for (S32 i = subShapeIndex + 1; i < subShapeFirstNode.size(); i++) - subShapeFirstNode[i]--; + mSubShapeNumNodes[subShapeIndex]--; + for (S32 i = subShapeIndex + 1; i < mSubShapeFirstNode.size(); i++) + mSubShapeFirstNode[i]--; // Fixup node parent indices - for (S32 i = 0; i < nodes.size(); i++) + for (S32 i = 0; i < mNodes.size(); i++) { - if (nodes[i].parentIndex == nodeIndex) - nodes[i].parentIndex = -1; - else if (nodes[i].parentIndex > nodeIndex) - nodes[i].parentIndex--; + if (mNodes[i].parentIndex == nodeIndex) + mNodes[i].parentIndex = -1; + else if (mNodes[i].parentIndex > nodeIndex) + mNodes[i].parentIndex--; } if (nodeParentIndex > nodeIndex) nodeParentIndex--; // Fixup object node indices, and re-assign attached objects to node's parent - for (S32 i = 0; i < objects.size(); i++) + for (S32 i = 0; i < mObjects.size(); i++) { - if (objects[i].nodeIndex == nodeIndex) - objects[i].nodeIndex = nodeParentIndex; - if (objects[i].nodeIndex > nodeIndex) - objects[i].nodeIndex--; + if (mObjects[i].nodeIndex == nodeIndex) + mObjects[i].nodeIndex = nodeParentIndex; + if (mObjects[i].nodeIndex > nodeIndex) + mObjects[i].nodeIndex--; } // Fixup skin weight node indices, and re-assign weights for deleted node to its parent - for (S32 i = 0; i < meshes.size(); i++) + for (S32 i = 0; i < mMeshes.size(); i++) { - if (meshes[i] && (meshes[i]->getMeshType() == TSMesh::SkinMeshType)) + if (mMeshes[i] && (mMeshes[i]->getMeshType() == TSMesh::SkinMeshType)) { - TSSkinMesh* skin = dynamic_cast(meshes[i]); + TSSkinMesh* skin = dynamic_cast(mMeshes[i]); for (S32 j = 0; j < skin->mBatchData.nodeIndex.size(); j++) { if (skin->mBatchData.nodeIndex[j] == nodeIndex) @@ -645,8 +645,8 @@ bool TSShape::setNodeTransform(const String& name, const Point3F& pos, const Qua } // Update initial node position and rotation - defaultTranslations[nodeIndex] = pos; - defaultRotations[nodeIndex].set(rot); + mDefaultTranslations[nodeIndex] = pos; + mDefaultRotations[nodeIndex].set(rot); return true; } @@ -655,39 +655,39 @@ bool TSShape::setNodeTransform(const String& name, const Point3F& pos, const Qua S32 TSShape::addObject(const String& objName, S32 subShapeIndex) { - S32 objIndex = subShapeNumObjects[subShapeIndex]; + S32 objIndex = mSubShapeNumObjects[subShapeIndex]; // Add object to subshape - subShapeNumObjects[subShapeIndex]++; - for (S32 i = subShapeIndex + 1; i < subShapeFirstObject.size(); i++) - subShapeFirstObject[i]++; + mSubShapeNumObjects[subShapeIndex]++; + for (S32 i = subShapeIndex + 1; i < mSubShapeFirstObject.size(); i++) + mSubShapeFirstObject[i]++; TSShape::Object obj; obj.nameIndex = addName(objName); obj.nodeIndex = 0; obj.numMeshes = 0; - obj.startMeshIndex = (objIndex == 0) ? 0 : objects[objIndex-1].startMeshIndex + objects[objIndex-1].numMeshes; + obj.startMeshIndex = (objIndex == 0) ? 0 : mObjects[objIndex-1].startMeshIndex + mObjects[objIndex-1].numMeshes; obj.firstDecal = 0; obj.nextSibling = 0; - objects.insert(objIndex, obj); + mObjects.insert(objIndex, obj); // Add default object state TSShape::ObjectState state; state.frameIndex = 0; state.matFrameIndex = 0; state.vis = 1.0f; - objectStates.insert(objIndex, state); + mObjectStates.insert(objIndex, state); // Fixup sequences - for (S32 i = 0; i < sequences.size(); i++) - sequences[i].baseObjectState++; + for (S32 i = 0; i < mSequences.size(); i++) + mSequences[i].baseObjectState++; return objIndex; } void TSShape::addMeshToObject(S32 objIndex, S32 meshIndex, TSMesh* mesh) { - TSShape::Object& obj = objects[objIndex]; + TSShape::Object& obj = mObjects[objIndex]; // Pad with NULLs if required S32 oldNumMeshes = obj.numMeshes; @@ -695,13 +695,13 @@ void TSShape::addMeshToObject(S32 objIndex, S32 meshIndex, TSMesh* mesh) { for (S32 i = obj.numMeshes; i < meshIndex; i++) { - meshes.insert(obj.startMeshIndex + i, NULL); + mMeshes.insert(obj.startMeshIndex + i, NULL); obj.numMeshes++; } } // Insert the new mesh - meshes.insert(obj.startMeshIndex + meshIndex, mesh); + mMeshes.insert(obj.startMeshIndex + meshIndex, mesh); obj.numMeshes++; // Skinned meshes are not attached to any node @@ -709,26 +709,26 @@ void TSShape::addMeshToObject(S32 objIndex, S32 meshIndex, TSMesh* mesh) obj.nodeIndex = -1; // Fixup mesh indices for other objects - for (S32 i = 0; i < objects.size(); i++) + for (S32 i = 0; i < mObjects.size(); i++) { - if ((i != objIndex) && (objects[i].startMeshIndex >= obj.startMeshIndex)) - objects[i].startMeshIndex += (obj.numMeshes - oldNumMeshes); + if ((i != objIndex) && (mObjects[i].startMeshIndex >= obj.startMeshIndex)) + mObjects[i].startMeshIndex += (obj.numMeshes - oldNumMeshes); } } void TSShape::removeMeshFromObject(S32 objIndex, S32 meshIndex) { - TSShape::Object& obj = objects[objIndex]; + TSShape::Object& obj = mObjects[objIndex]; // Remove the mesh, but do not destroy it (this must be done by the caller) - meshes[obj.startMeshIndex + meshIndex] = NULL; + mMeshes[obj.startMeshIndex + meshIndex] = NULL; // Check if there are any objects remaining that have a valid mesh at this // detail size bool removeDetail = true; - for (S32 i = 0; i < objects.size(); i++) + for (S32 i = 0; i < mObjects.size(); i++) { - if ((meshIndex < objects[i].numMeshes) && meshes[objects[i].startMeshIndex + meshIndex]) + if ((meshIndex < mObjects[i].numMeshes) && mMeshes[mObjects[i].startMeshIndex + meshIndex]) { removeDetail = false; break; @@ -738,17 +738,17 @@ void TSShape::removeMeshFromObject(S32 objIndex, S32 meshIndex) // Remove detail level if possible if (removeDetail) { - for (S32 i = 0; i < objects.size(); i++) + for (S32 i = 0; i < mObjects.size(); i++) { - if (meshIndex < objects[i].numMeshes) + if (meshIndex < mObjects[i].numMeshes) { - meshes.erase(objects[i].startMeshIndex + meshIndex); - objects[i].numMeshes--; + mMeshes.erase(mObjects[i].startMeshIndex + meshIndex); + mObjects[i].numMeshes--; - for (S32 j = 0; j < objects.size(); j++) + for (S32 j = 0; j < mObjects.size(); j++) { - if (objects[j].startMeshIndex > objects[i].startMeshIndex) - objects[j].startMeshIndex--; + if (mObjects[j].startMeshIndex > mObjects[i].startMeshIndex) + mObjects[j].startMeshIndex--; } } } @@ -758,27 +758,27 @@ void TSShape::removeMeshFromObject(S32 objIndex, S32 meshIndex) for (S32 i = 0; i < validDetails.size(); i++) { - TSShape::Detail& detail = details[validDetails[i]]; + TSShape::Detail& detail = mDetails[validDetails[i]]; if (detail.objectDetailNum > meshIndex) detail.objectDetailNum--; } - details.erase(validDetails[meshIndex]); + mDetails.erase(validDetails[meshIndex]); } // Remove trailing NULL meshes from the object S32 oldNumMeshes = obj.numMeshes; - while (obj.numMeshes && !meshes[obj.startMeshIndex + obj.numMeshes - 1]) + while (obj.numMeshes && !mMeshes[obj.startMeshIndex + obj.numMeshes - 1]) { - meshes.erase(obj.startMeshIndex + obj.numMeshes - 1); + mMeshes.erase(obj.startMeshIndex + obj.numMeshes - 1); obj.numMeshes--; } // Fixup mesh indices for other objects - for (S32 i = 0; i < objects.size(); i++) + for (S32 i = 0; i < mObjects.size(); i++) { - if (objects[i].startMeshIndex > obj.startMeshIndex) - objects[i].startMeshIndex -= (oldNumMeshes - obj.numMeshes); + if (mObjects[i].startMeshIndex > obj.startMeshIndex) + mObjects[i].startMeshIndex -= (oldNumMeshes - obj.numMeshes); } } @@ -805,7 +805,7 @@ bool TSShape::setObjectNode(const String& objName, const String& nodeName) } } - objects[objIndex].nodeIndex = nodeIndex; + mObjects[objIndex].nodeIndex = nodeIndex; return true; } @@ -821,31 +821,31 @@ bool TSShape::removeObject(const String& name) } // Destroy all meshes in the object - TSShape::Object& obj = objects[objIndex]; + TSShape::Object& obj = mObjects[objIndex]; while ( obj.numMeshes ) { - destructInPlace(meshes[obj.startMeshIndex + obj.numMeshes - 1]); + destructInPlace(mMeshes[obj.startMeshIndex + obj.numMeshes - 1]); removeMeshFromObject(objIndex, obj.numMeshes - 1); } // Remove the object from the shape - objects.erase(objIndex); + mObjects.erase(objIndex); S32 subShapeIndex = getSubShapeForObject(objIndex); - subShapeNumObjects[subShapeIndex]--; - for (S32 i = subShapeIndex + 1; i < subShapeFirstObject.size(); i++) - subShapeFirstObject[i]--; + mSubShapeNumObjects[subShapeIndex]--; + for (S32 i = subShapeIndex + 1; i < mSubShapeFirstObject.size(); i++) + mSubShapeFirstObject[i]--; // Remove the object from all sequences - for (S32 i = 0; i < sequences.size(); i++) + for (S32 i = 0; i < mSequences.size(); i++) { - TSShape::Sequence& seq = sequences[i]; + TSShape::Sequence& seq = mSequences[i]; TSIntegerSet objMatters(seq.frameMatters); objMatters.overlap(seq.matFrameMatters); objMatters.overlap(seq.visMatters); if (objMatters.test(objIndex)) - eraseStates(objectStates, objMatters, seq.baseObjectState, seq.numKeyframes, objIndex); + eraseStates(mObjectStates, objMatters, seq.baseObjectState, seq.numKeyframes, objIndex); seq.frameMatters.erase(objIndex); seq.matFrameMatters.erase(objIndex); @@ -966,11 +966,11 @@ bool TSShape::addMesh(TSMesh* mesh, const String& meshName) S32 objIndex = findObject(objName); if (objIndex < 0) objIndex = addObject(objName, 0); - AssertFatal(objIndex >= 0 && objIndex < objects.size(), "Invalid object index!"); + AssertFatal(objIndex >= 0 && objIndex < mObjects.size(), "Invalid object index!"); // Determine the subshape this object belongs to S32 subShapeIndex = getSubShapeForObject(objIndex); - AssertFatal(subShapeIndex < subShapeFirstObject.size(), "Could not find subshape for object!"); + AssertFatal(subShapeIndex < mSubShapeFirstObject.size(), "Could not find subshape for object!"); // Get the existing detail levels for the subshape Vector validDetails; @@ -981,7 +981,7 @@ bool TSShape::addMesh(TSMesh* mesh, const String& meshName) bool newDetail = true; for (detIndex = 0; detIndex < validDetails.size(); detIndex++) { - const TSShape::Detail& det = details[validDetails[detIndex]]; + const TSShape::Detail& det = mDetails[validDetails[detIndex]]; if (detailSize >= det.size) { newDetail = (det.size != detailSize); @@ -1002,7 +1002,7 @@ bool TSShape::addMesh(TSMesh* mesh, const String& meshName) detailName = "detail"; S32 index = addDetail(detailName, detailSize, subShapeIndex); - details[index].objectDetailNum = detIndex; + mDetails[index].objectDetailNum = detIndex; } // Adding a new mesh or detail level is a bit tricky, since each @@ -1020,10 +1020,10 @@ bool TSShape::addMesh(TSMesh* mesh, const String& meshName) // 2 | | | 2 // Add meshes as required for each object - for (S32 i = 0; i < subShapeNumObjects[subShapeIndex]; i++) + for (S32 i = 0; i < mSubShapeNumObjects[subShapeIndex]; i++) { - S32 index = subShapeFirstObject[subShapeIndex] + i; - const TSShape::Object& obj = objects[index]; + S32 index = mSubShapeFirstObject[subShapeIndex] + i; + const TSShape::Object& obj = mObjects[index]; if (index == objIndex) { @@ -1031,9 +1031,9 @@ bool TSShape::addMesh(TSMesh* mesh, const String& meshName) // if required. if (!newDetail && (detIndex < obj.numMeshes)) { - if ( meshes[obj.startMeshIndex + detIndex] ) - destructInPlace(meshes[obj.startMeshIndex + detIndex]); - meshes[obj.startMeshIndex + detIndex] = mesh; + if ( mMeshes[obj.startMeshIndex + detIndex] ) + destructInPlace(mMeshes[obj.startMeshIndex + detIndex]); + mMeshes[obj.startMeshIndex + detIndex] = mesh; } else addMeshToObject(index, detIndex, mesh); @@ -1069,16 +1069,16 @@ bool TSShape::addMesh(TSShape* srcShape, const String& srcMeshName, const String TSSkinMesh *srcSkin = dynamic_cast(srcMesh); // Check that the source skin is compatible with our skeleton - Vector nodeMap(srcShape->nodes.size()); - for (S32 i = 0; i < srcShape->nodes.size(); i++) - nodeMap.push_back( findNode( srcShape->getName(srcShape->nodes[i].nameIndex) ) ); + Vector nodeMap(srcShape->mNodes.size()); + for (S32 i = 0; i < srcShape->mNodes.size(); i++) + nodeMap.push_back( findNode( srcShape->getName(srcShape->mNodes[i].nameIndex) ) ); for (S32 i = 0; i < srcSkin->mBoneIndex.size(); i++) { S32 srcNode = srcSkin->mBoneIndex[i]; if (nodeMap[srcNode] == -1) { - const char* name = srcShape->getName(srcShape->nodes[srcNode].nameIndex).c_str(); + const char* name = srcShape->getName(srcShape->mNodes[srcNode].nameIndex).c_str(); Con::errorf("TSShape::addMesh: Skin is weighted to node (%s) that " "does not exist in this shape", name); return false; @@ -1109,14 +1109,14 @@ bool TSShape::addMesh(TSShape* srcShape, const String& srcMeshName, const String { S32 drawType = (mesh->mPrimitives[i].matIndex & (~TSDrawPrimitive::MaterialMask)); S32 srcMatIndex = mesh->mPrimitives[i].matIndex & TSDrawPrimitive::MaterialMask; - const String& matName = srcShape->materialList->getMaterialName(srcMatIndex); + const String& matName = srcShape->mMaterialList->getMaterialName(srcMatIndex); // Add the material if it does not already exist - S32 destMatIndex = materialList->getMaterialNameList().find_next(matName); + S32 destMatIndex = mMaterialList->getMaterialNameList().find_next(matName); if (destMatIndex < 0) { - destMatIndex = materialList->size(); - materialList->push_back(matName, srcShape->materialList->getFlags(srcMatIndex)); + destMatIndex = mMaterialList->size(); + mMaterialList->push_back(matName, srcShape->mMaterialList->getFlags(srcMatIndex)); } mesh->mPrimitives[i].matIndex = drawType | destMatIndex; @@ -1131,15 +1131,15 @@ bool TSShape::setMeshSize(const String& meshName, S32 size) { S32 objIndex, meshIndex; if (!findMeshIndex(meshName, objIndex, meshIndex) || - !meshes[objects[objIndex].startMeshIndex + meshIndex]) + !mMeshes[mObjects[objIndex].startMeshIndex + meshIndex]) { Con::errorf("TSShape::setMeshSize: Could not find mesh '%s'", meshName.c_str()); return false; } // Remove the mesh from the object, but don't destroy it - TSShape::Object& obj = objects[objIndex]; - TSMesh* mesh = meshes[obj.startMeshIndex + meshIndex]; + TSShape::Object& obj = mObjects[objIndex]; + TSMesh* mesh = mMeshes[obj.startMeshIndex + meshIndex]; removeMeshFromObject(objIndex, meshIndex); // Add the mesh back at the new position @@ -1158,15 +1158,15 @@ bool TSShape::removeMesh(const String& meshName) { S32 objIndex, meshIndex; if (!findMeshIndex(meshName, objIndex, meshIndex) || - !meshes[objects[objIndex].startMeshIndex + meshIndex]) + !mMeshes[mObjects[objIndex].startMeshIndex + meshIndex]) { Con::errorf("TSShape::removeMesh: Could not find mesh '%s'", meshName.c_str()); return false; } // Destroy and remove the mesh - TSShape::Object& obj = objects[objIndex]; - destructInPlace(meshes[obj.startMeshIndex + meshIndex]); + TSShape::Object& obj = mObjects[objIndex]; + destructInPlace(mMeshes[obj.startMeshIndex + meshIndex]); removeMeshFromObject(objIndex, meshIndex); // Remove the object if there are no meshes left @@ -1226,20 +1226,20 @@ S32 TSShape::setDetailSize(S32 oldSize, S32 newSize) } // Remove this detail from the list - TSShape::Detail tmpDetail = details[oldIndex]; + TSShape::Detail tmpDetail = mDetails[oldIndex]; tmpDetail.size = newSize; - details.erase(oldIndex); + mDetails.erase(oldIndex); // Determine the new position for the detail (details are sorted by size) S32 newIndex = 0; - for ( newIndex = 0; newIndex < details.size(); ++newIndex ) + for ( newIndex = 0; newIndex < mDetails.size(); ++newIndex ) { - if ( newSize > details[newIndex].size ) + if ( newSize > mDetails[newIndex].size ) break; } // Add the detail at its new position - details.insert( newIndex, tmpDetail ); + mDetails.insert( newIndex, tmpDetail ); // Rename the detail so its trailing size value is correct { @@ -1253,38 +1253,38 @@ S32 TSShape::setDetailSize(S32 oldSize, S32 newSize) if ( newIndex != oldIndex ) { // Fixup details - for ( S32 iDet = 0; iDet < details.size(); iDet++ ) + for ( S32 iDet = 0; iDet < mDetails.size(); iDet++ ) { - if ( details[iDet].subShapeNum < 0 ) + if ( mDetails[iDet].subShapeNum < 0 ) { - if ( details[iDet].bbDetailLevel == oldIndex ) - details[iDet].bbDetailLevel = newIndex; + if ( mDetails[iDet].bbDetailLevel == oldIndex ) + mDetails[iDet].bbDetailLevel = newIndex; } else { - details[iDet].objectDetailNum = iDet; + mDetails[iDet].objectDetailNum = iDet; } } // Fixup Billboard details - _PadMoveAndTrim( billboardDetails, 0, billboardDetails.size(), - details.size(), oldIndex, newIndex ); + _PadMoveAndTrim( mBillboardDetails, 0, mBillboardDetails.size(), + mDetails.size(), oldIndex, newIndex ); // Now move the mesh for each object in the subshape (adding and removing // NULLs as appropriate) - for ( S32 iObj = 0; iObj < objects.size(); ++iObj ) + for ( S32 iObj = 0; iObj < mObjects.size(); ++iObj ) { - TSShape::Object& obj = objects[iObj]; - S32 oldMeshCount = meshes.size(); + TSShape::Object& obj = mObjects[iObj]; + S32 oldMeshCount = mMeshes.size(); - _PadMoveAndTrim( meshes, obj.startMeshIndex, obj.numMeshes, - details.size(), oldIndex, newIndex ); + _PadMoveAndTrim( mMeshes, obj.startMeshIndex, obj.numMeshes, + mDetails.size(), oldIndex, newIndex ); - obj.numMeshes += ( meshes.size() - oldMeshCount ); + obj.numMeshes += ( mMeshes.size() - oldMeshCount ); // Fixup startMeshIndex for remaining objects - for ( S32 j = iObj + 1; j < objects.size(); ++j ) - objects[j].startMeshIndex += ( meshes.size() - oldMeshCount ); + for ( S32 j = iObj + 1; j < mObjects.size(); ++j ) + mObjects[j].startMeshIndex += ( mMeshes.size() - oldMeshCount ); } } @@ -1301,20 +1301,20 @@ bool TSShape::removeDetail( S32 size ) { S32 dl = findDetailBySize( size ); - if ( ( dl < 0 ) || ( dl >= details.size() ) ) + if ( ( dl < 0 ) || ( dl >= mDetails.size() ) ) { Con::errorf( "TSShape::removeDetail: Invalid detail index (%d)", dl ); return false; } // Destroy and remove each mesh in the detail level - for ( S32 objIndex = objects.size()-1; objIndex >= 0; objIndex-- ) + for ( S32 objIndex = mObjects.size()-1; objIndex >= 0; objIndex-- ) { - TSShape::Object& obj = objects[objIndex]; + TSShape::Object& obj = mObjects[objIndex]; if ( dl < obj.numMeshes ) { - if ( meshes[obj.startMeshIndex + dl] ) - destructInPlace( meshes[obj.startMeshIndex + dl] ); + if ( mMeshes[obj.startMeshIndex + dl] ) + destructInPlace( mMeshes[obj.startMeshIndex + dl] ); removeMeshFromObject(objIndex, dl); // Remove the object if there are no meshes left @@ -1324,16 +1324,16 @@ bool TSShape::removeDetail( S32 size ) } // Destroy billboard detail level - if ( dl < billboardDetails.size() ) + if ( dl < mBillboardDetails.size() ) { - if ( billboardDetails[dl] ) + if ( mBillboardDetails[dl] ) { // Delete old textures - billboardDetails[dl]->deleteImposterCacheTextures(); - delete billboardDetails[dl]; + mBillboardDetails[dl]->deleteImposterCacheTextures(); + delete mBillboardDetails[dl]; } - billboardDetails.erase( dl ); + mBillboardDetails.erase( dl ); } // Update smallest visible detail @@ -1354,7 +1354,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, if (path.getExtension().equal("dsq", String::NoCase)) { - S32 oldSeqCount = sequences.size(); + S32 oldSeqCount = mSequences.size(); // DSQ source file char filenameBuf[1024]; @@ -1377,37 +1377,37 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, // Rename the new sequence if required (avoid rename if name is not // unique (this will be fixed up later, and we don't need 2 errors about it!) if (oldName.isEmpty()) - oldName = getName(sequences.last().nameIndex); + oldName = getName(mSequences.last().nameIndex); if (!oldName.equal(name)) { if (findSequence(name) == -1) { // Use a dummy intermediate name since we might be renaming from an // existing name (and we want to rename the right sequence!) - sequences.last().nameIndex = addName("__dummy__"); + mSequences.last().nameIndex = addName("__dummy__"); renameSequence("__dummy__", name); } } // Check that sequences have unique names bool lastSequenceRejected = false; - for (S32 i = sequences.size()-1; i >= oldSeqCount; i--) + for (S32 i = mSequences.size()-1; i >= oldSeqCount; i--) { - S32 nameIndex = (i == sequences.size()-1) ? findName(name) : sequences[i].nameIndex; + S32 nameIndex = (i == mSequences.size()-1) ? findName(name) : mSequences[i].nameIndex; S32 seqIndex = findSequence(nameIndex); if ((seqIndex != -1) && (seqIndex != i)) { Con::errorf("TSShape::addSequence: Failed to add sequence '%s' " "(name already exists)", getName(nameIndex).c_str()); - sequences[i].nameIndex = addName("__dummy__"); + mSequences[i].nameIndex = addName("__dummy__"); removeSequence("__dummy__"); - if (i == sequences.size()) + if (i == mSequences.size()) lastSequenceRejected = true; } } // @todo:Need to remove keyframes if start!=0 and end!=-1 - TSShape::Sequence& seq = sequences.last(); + TSShape::Sequence& seq = mSequences.last(); // Store information about how this sequence was created seq.sourceData.from = String::ToString("%s\t%s", filenameBuf, name.c_str()); @@ -1415,7 +1415,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, seq.sourceData.start = ((startFrame < 0) || (startFrame >= seq.numKeyframes)) ? 0 : startFrame; seq.sourceData.end = ((endFrame < 0) || (endFrame >= seq.numKeyframes)) ? seq.numKeyframes-1 : endFrame; - return (sequences.size() != oldSeqCount); + return (mSequences.size() != oldSeqCount); } /* Check that sequence to be added does not already exist */ @@ -1442,7 +1442,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, return false; } srcShape = const_cast((const TSShape*)hSrcShape); - if (!srcShape->sequences.size()) + if (!srcShape->mSequences.size()) { Con::errorf("TSShape::addSequence: Source shape '%s' does not contain any sequences", path.getFullPath().c_str()); return false; @@ -1450,7 +1450,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, // If no sequence name is specified, just use the first one if (oldName.isEmpty()) - oldName = srcShape->getName(srcShape->sequences[0].nameIndex); + oldName = srcShape->getName(srcShape->mSequences[0].nameIndex); } else { @@ -1467,7 +1467,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, } // Check keyframe range - const TSShape::Sequence* srcSeq = &srcShape->sequences[seqIndex]; + const TSShape::Sequence* srcSeq = &srcShape->mSequences[seqIndex]; if ((startFrame < 0) || (startFrame >= srcSeq->numKeyframes)) { Con::warnf("TSShape::addSequence: Start keyframe (%d) out of range (0-%d) for sequence '%s'", @@ -1484,21 +1484,21 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, } // Create array to map source nodes to our nodes - Vector nodeMap(srcShape->nodes.size()); - for (S32 i = 0; i < srcShape->nodes.size(); i++) - nodeMap.push_back(findNode(srcShape->getName(srcShape->nodes[i].nameIndex))); + Vector nodeMap(srcShape->mNodes.size()); + for (S32 i = 0; i < srcShape->mNodes.size(); i++) + nodeMap.push_back(findNode(srcShape->getName(srcShape->mNodes[i].nameIndex))); // Create array to map source objects to our objects - Vector objectMap(srcShape->objects.size()); - for (S32 i = 0; i < srcShape->objects.size(); i++) - objectMap.push_back(findObject(srcShape->getName(srcShape->objects[i].nameIndex))); + Vector objectMap(srcShape->mObjects.size()); + for (S32 i = 0; i < srcShape->mObjects.size(); i++) + objectMap.push_back(findObject(srcShape->getName(srcShape->mObjects[i].nameIndex))); // Copy the source sequence (need to do it this ugly way instead of just // using push_back since srcSeq pointer may change if copying a sequence // from inside the shape itself - sequences.increment(); - TSShape::Sequence& seq = sequences.last(); - srcSeq = &srcShape->sequences[seqIndex]; // update pointer as it may have changed! + mSequences.increment(); + TSShape::Sequence& seq = mSequences.last(); + srcSeq = &srcShape->mSequences[seqIndex]; // update pointer as it may have changed! seq = *srcSeq; seq.nameIndex = addName(name); @@ -1519,7 +1519,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, if (srcSeq->visMatters.test(i)) { // Check if visibility is animated within the frames to be copied - const F32 defaultVis = srcShape->objectStates[i].vis; + const F32 defaultVis = srcShape->mObjectStates[i].vis; S32 objNum = srcSeq->visMatters.count(i); for (S32 iFrame = startFrame; iFrame <= endFrame; iFrame++) { @@ -1540,8 +1540,8 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, objectStateSet.overlap(seq.matFrameMatters); objectStateSet.overlap(seq.visMatters); - seq.baseObjectState = objectStates.size(); - objectStates.increment(objectStateSet.count()*seq.numKeyframes); + seq.baseObjectState = mObjectStates.size(); + mObjectStates.increment(objectStateSet.count()*seq.numKeyframes); for (S32 i = 0; i < objectMap.size(); i++) { if (objectMap[i] < 0) @@ -1552,7 +1552,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, { S32 src = srcSeq->baseObjectState + srcSeq->numKeyframes * srcObjectStateSet.count(i) + startFrame; S32 dest = seq.baseObjectState + seq.numKeyframes * objectStateSet.count(objectMap[i]); - dCopyArray(&objectStates[dest], &srcShape->objectStates[src], seq.numKeyframes); + dCopyArray(&mObjectStates[dest], &srcShape->mObjectStates[src], seq.numKeyframes); } } @@ -1561,27 +1561,27 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, S32 groundBase = srcSeq->firstGroundFrame + startFrame*ratio; seq.numGroundFrames *= ratio; - seq.firstGroundFrame = groundTranslations.size(); - groundTranslations.reserve(groundTranslations.size() + seq.numGroundFrames); - groundRotations.reserve(groundRotations.size() + seq.numGroundFrames); + seq.firstGroundFrame = mGroundTranslations.size(); + mGroundTranslations.reserve(mGroundTranslations.size() + seq.numGroundFrames); + mGroundRotations.reserve(mGroundRotations.size() + seq.numGroundFrames); for (S32 i = 0; i < seq.numGroundFrames; i++) { - groundTranslations.push_back(srcShape->groundTranslations[groundBase + i]); - groundRotations.push_back(srcShape->groundRotations[groundBase + i]); + mGroundTranslations.push_back(srcShape->mGroundTranslations[groundBase + i]); + mGroundRotations.push_back(srcShape->mGroundRotations[groundBase + i]); } // Add triggers seq.numTriggers = 0; - seq.firstTrigger = triggers.size(); + seq.firstTrigger = mTriggers.size(); F32 seqStartPos = (F32)startFrame / seq.numKeyframes; F32 seqEndPos = (F32)endFrame / seq.numKeyframes; for (S32 i = 0; i < srcSeq->numTriggers; i++) { - const TSShape::Trigger& srcTrig = srcShape->triggers[srcSeq->firstTrigger + i]; + const TSShape::Trigger& srcTrig = srcShape->mTriggers[srcSeq->firstTrigger + i]; if ((srcTrig.pos >= seqStartPos) && (srcTrig.pos <= seqEndPos)) { - triggers.push_back(srcTrig); - triggers.last().pos -= seqStartPos; + mTriggers.push_back(srcTrig); + mTriggers.last().pos -= seqStartPos; seq.numTriggers++; } } @@ -1598,7 +1598,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, if (srcSeq->translationMatters.test(i)) { // Check if node position is animated within the frames to be copied - const Point3F& defaultTrans = srcShape->defaultTranslations[i]; + const Point3F& defaultTrans = srcShape->mDefaultTranslations[i]; S32 tranNum = srcSeq->translationMatters.count(i); for (S32 iFrame = startFrame; iFrame <= endFrame; iFrame++) { @@ -1613,7 +1613,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, if (srcSeq->rotationMatters.test(i)) { // Check if node rotation is animated within the frames to be copied - const QuatF defaultRot = srcShape->defaultRotations[i].getQuatF(); + const QuatF defaultRot = srcShape->mDefaultRotations[i].getQuatF(); S32 rotNum = srcSeq->rotationMatters.count(i); for (S32 iFrame = startFrame; iFrame <= endFrame; iFrame++) { @@ -1672,26 +1672,26 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, } // Resize the node transform arrays - seq.baseTranslation = nodeTranslations.size(); - nodeTranslations.increment(seq.translationMatters.count()*seq.numKeyframes); - seq.baseRotation = nodeRotations.size(); - nodeRotations.increment(seq.rotationMatters.count()*seq.numKeyframes); + seq.baseTranslation = mNodeTranslations.size(); + mNodeTranslations.increment(seq.translationMatters.count()*seq.numKeyframes); + seq.baseRotation = mNodeRotations.size(); + mNodeRotations.increment(seq.rotationMatters.count()*seq.numKeyframes); if (seq.flags & TSShape::ArbitraryScale) { S32 scaleCount = seq.scaleMatters.count(); - seq.baseScale = nodeArbitraryScaleRots.size(); - nodeArbitraryScaleRots.increment(scaleCount*seq.numKeyframes); - nodeArbitraryScaleFactors.increment(scaleCount*seq.numKeyframes); + seq.baseScale = mNodeArbitraryScaleRots.size(); + mNodeArbitraryScaleRots.increment(scaleCount*seq.numKeyframes); + mNodeArbitraryScaleFactors.increment(scaleCount*seq.numKeyframes); } else if (seq.flags & TSShape::AlignedScale) { - seq.baseScale = nodeAlignedScales.size(); - nodeAlignedScales.increment(seq.scaleMatters.count()*seq.numKeyframes); + seq.baseScale = mNodeAlignedScales.size(); + mNodeAlignedScales.increment(seq.scaleMatters.count()*seq.numKeyframes); } else { - seq.baseScale = nodeUniformScales.size(); - nodeUniformScales.increment(seq.scaleMatters.count()*seq.numKeyframes); + seq.baseScale = mNodeUniformScales.size(); + mNodeUniformScales.increment(seq.scaleMatters.count()*seq.numKeyframes); } // Add node transforms (remap from source node indices to our node indices). As @@ -1707,28 +1707,28 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, { S32 src = srcSeq->baseTranslation + srcSeq->numKeyframes * srcSeq->translationMatters.count(i) + startFrame; S32 dest = seq.baseTranslation + seq.numKeyframes * seq.translationMatters.count(nodeMap[i]); - dCopyArray(&nodeTranslations[dest], &srcShape->nodeTranslations[src], seq.numKeyframes); + dCopyArray(&mNodeTranslations[dest], &srcShape->mNodeTranslations[src], seq.numKeyframes); } - else if (padTransKeys && (defaultTranslations[nodeMap[i]] != srcShape->defaultTranslations[i])) + else if (padTransKeys && (mDefaultTranslations[nodeMap[i]] != srcShape->mDefaultTranslations[i])) { seq.translationMatters.set(nodeMap[i]); S32 dest = seq.baseTranslation + seq.numKeyframes * seq.translationMatters.count(nodeMap[i]); for (S32 j = 0; j < seq.numKeyframes; j++) - nodeTranslations.insert(dest, srcShape->defaultTranslations[i]); + mNodeTranslations.insert(dest, srcShape->mDefaultTranslations[i]); } if (seq.rotationMatters.test(nodeMap[i])) { S32 src = srcSeq->baseRotation + srcSeq->numKeyframes * srcSeq->rotationMatters.count(i) + startFrame; S32 dest = seq.baseRotation + seq.numKeyframes * seq.rotationMatters.count(nodeMap[i]); - dCopyArray(&nodeRotations[dest], &srcShape->nodeRotations[src], seq.numKeyframes); + dCopyArray(&mNodeRotations[dest], &srcShape->mNodeRotations[src], seq.numKeyframes); } - else if (padRotKeys && (defaultRotations[nodeMap[i]] != srcShape->defaultRotations[i])) + else if (padRotKeys && (mDefaultRotations[nodeMap[i]] != srcShape->mDefaultRotations[i])) { seq.rotationMatters.set(nodeMap[i]); S32 dest = seq.baseRotation + seq.numKeyframes * seq.rotationMatters.count(nodeMap[i]); for (S32 j = 0; j < seq.numKeyframes; j++) - nodeRotations.insert(dest, srcShape->defaultRotations[i]); + mNodeRotations.insert(dest, srcShape->mDefaultRotations[i]); } if (seq.scaleMatters.test(nodeMap[i])) @@ -1737,13 +1737,13 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, S32 dest = seq.baseScale + seq.numKeyframes * seq.scaleMatters.count(nodeMap[i]); if (seq.flags & TSShape::ArbitraryScale) { - dCopyArray(&nodeArbitraryScaleRots[dest], &srcShape->nodeArbitraryScaleRots[src], seq.numKeyframes); - dCopyArray(&nodeArbitraryScaleFactors[dest], &srcShape->nodeArbitraryScaleFactors[src], seq.numKeyframes); + dCopyArray(&mNodeArbitraryScaleRots[dest], &srcShape->mNodeArbitraryScaleRots[src], seq.numKeyframes); + dCopyArray(&mNodeArbitraryScaleFactors[dest], &srcShape->mNodeArbitraryScaleFactors[src], seq.numKeyframes); } else if (seq.flags & TSShape::AlignedScale) - dCopyArray(&nodeAlignedScales[dest], &srcShape->nodeAlignedScales[src], seq.numKeyframes); + dCopyArray(&mNodeAlignedScales[dest], &srcShape->mNodeAlignedScales[src], seq.numKeyframes); else - dCopyArray(&nodeUniformScales[dest], &srcShape->nodeUniformScales[src], seq.numKeyframes); + dCopyArray(&mNodeUniformScales[dest], &srcShape->mNodeUniformScales[src], seq.numKeyframes); } } @@ -1782,47 +1782,47 @@ bool TSShape::removeSequence(const String& name) return false; } - TSShape::Sequence& seq = sequences[seqIndex]; + TSShape::Sequence& seq = mSequences[seqIndex]; // Remove the node transforms for this sequence - S32 transCount = eraseStates(nodeTranslations, seq.translationMatters, seq.baseTranslation, seq.numKeyframes); - S32 rotCount = eraseStates(nodeRotations, seq.rotationMatters, seq.baseRotation, seq.numKeyframes); + S32 transCount = eraseStates(mNodeTranslations, seq.translationMatters, seq.baseTranslation, seq.numKeyframes); + S32 rotCount = eraseStates(mNodeRotations, seq.rotationMatters, seq.baseRotation, seq.numKeyframes); S32 scaleCount = 0; if (seq.flags & TSShape::ArbitraryScale) { - scaleCount = eraseStates(nodeArbitraryScaleRots, seq.scaleMatters, seq.baseScale, seq.numKeyframes); - eraseStates(nodeArbitraryScaleFactors, seq.scaleMatters, seq.baseScale, seq.numKeyframes); + scaleCount = eraseStates(mNodeArbitraryScaleRots, seq.scaleMatters, seq.baseScale, seq.numKeyframes); + eraseStates(mNodeArbitraryScaleFactors, seq.scaleMatters, seq.baseScale, seq.numKeyframes); } else if (seq.flags & TSShape::AlignedScale) - scaleCount = eraseStates(nodeAlignedScales, seq.scaleMatters, seq.baseScale, seq.numKeyframes); + scaleCount = eraseStates(mNodeAlignedScales, seq.scaleMatters, seq.baseScale, seq.numKeyframes); else - scaleCount = eraseStates(nodeUniformScales, seq.scaleMatters, seq.baseScale, seq.numKeyframes); + scaleCount = eraseStates(mNodeUniformScales, seq.scaleMatters, seq.baseScale, seq.numKeyframes); // Remove the object states for this sequence TSIntegerSet objMatters(seq.frameMatters); objMatters.overlap(seq.matFrameMatters); objMatters.overlap(seq.visMatters); - S32 objCount = eraseStates(objectStates, objMatters, seq.baseObjectState, seq.numKeyframes); + S32 objCount = eraseStates(mObjectStates, objMatters, seq.baseObjectState, seq.numKeyframes); // Remove groundframes and triggers TSIntegerSet dummy; - eraseStates(groundTranslations, dummy, seq.firstGroundFrame, seq.numGroundFrames, 0); - eraseStates(groundRotations, dummy, seq.firstGroundFrame, seq.numGroundFrames, 0); - eraseStates(triggers, dummy, seq.firstTrigger, seq.numTriggers, 0); + eraseStates(mGroundTranslations, dummy, seq.firstGroundFrame, seq.numGroundFrames, 0); + eraseStates(mGroundRotations, dummy, seq.firstGroundFrame, seq.numGroundFrames, 0); + eraseStates(mTriggers, dummy, seq.firstTrigger, seq.numTriggers, 0); // Fixup the base indices of the other sequences - for (S32 i = seqIndex + 1; i < sequences.size(); i++) + for (S32 i = seqIndex + 1; i < mSequences.size(); i++) { - sequences[i].baseTranslation -= transCount; - sequences[i].baseRotation -= rotCount; - sequences[i].baseScale -= scaleCount; - sequences[i].baseObjectState -= objCount; - sequences[i].firstGroundFrame -= seq.numGroundFrames; - sequences[i].firstTrigger -= seq.numTriggers; + mSequences[i].baseTranslation -= transCount; + mSequences[i].baseRotation -= rotCount; + mSequences[i].baseScale -= scaleCount; + mSequences[i].baseObjectState -= objCount; + mSequences[i].firstGroundFrame -= seq.numGroundFrames; + mSequences[i].firstTrigger -= seq.numTriggers; } // Remove the sequence itself - sequences.erase(seqIndex); + mSequences.erase(seqIndex); // Remove the sequence name if it is no longer in use removeName(name); @@ -1842,7 +1842,7 @@ bool TSShape::addTrigger(const String& seqName, S32 keyframe, S32 state) return false; } - TSShape::Sequence& seq = sequences[seqIndex]; + TSShape::Sequence& seq = mSequences[seqIndex]; if (keyframe >= seq.numKeyframes) { Con::errorf("TSShape::addTrigger: Keyframe out of range (0-%d for sequence '%s')", @@ -1861,14 +1861,14 @@ bool TSShape::addTrigger(const String& seqName, S32 keyframe, S32 state) { seq.firstTrigger = 0; for (S32 i = 0; i < seqIndex; i++) - seq.firstTrigger += sequences[i].numTriggers; + seq.firstTrigger += mSequences[i].numTriggers; } // Find where to insert the trigger (sorted by keyframe) S32 trigIndex; for (trigIndex = seq.firstTrigger; trigIndex < (seq.firstTrigger + seq.numTriggers); trigIndex++) { - const TSShape::Trigger& trig = triggers[trigIndex]; + const TSShape::Trigger& trig = mTriggers[trigIndex]; if ((S32)(trig.pos * seq.numKeyframes) > keyframe) break; } @@ -1877,7 +1877,7 @@ bool TSShape::addTrigger(const String& seqName, S32 keyframe, S32 state) TSShape::Trigger trig; trig.pos = (F32)keyframe / getMax(1, seq.numKeyframes-1); trig.state = state; - triggers.insert(trigIndex, trig); + mTriggers.insert(trigIndex, trig); seq.numTriggers++; // set invert for other triggers if needed @@ -1886,16 +1886,16 @@ bool TSShape::addTrigger(const String& seqName, S32 keyframe, S32 state) U32 offTrigger = (trig.state & TSShape::Trigger::StateMask); for (S32 i = 0; i < seq.numTriggers; i++) { - if (triggers[seq.firstTrigger + i].state & offTrigger) - triggers[seq.firstTrigger + i].state |= TSShape::Trigger::InvertOnReverse; + if (mTriggers[seq.firstTrigger + i].state & offTrigger) + mTriggers[seq.firstTrigger + i].state |= TSShape::Trigger::InvertOnReverse; } } // fixup firstTrigger index for other sequences - for (S32 i = seqIndex + 1; i < sequences.size(); i++) + for (S32 i = seqIndex + 1; i < mSequences.size(); i++) { - if (sequences[i].numTriggers > 0) - sequences[i].firstTrigger++; + if (mSequences[i].numTriggers > 0) + mSequences[i].firstTrigger++; } // set MakePath flag so triggers will be animated @@ -1914,7 +1914,7 @@ bool TSShape::removeTrigger(const String& seqName, S32 keyframe, S32 state) return false; } - TSShape::Sequence& seq = sequences[seqIndex]; + TSShape::Sequence& seq = mSequences[seqIndex]; if (keyframe >= seq.numKeyframes) { Con::errorf("TSShape::removeTrigger: Keyframe out of range (0-%d for sequence '%s')", @@ -1931,20 +1931,20 @@ bool TSShape::removeTrigger(const String& seqName, S32 keyframe, S32 state) // Find and remove the trigger for (S32 trigIndex = seq.firstTrigger; trigIndex < (seq.firstTrigger + seq.numTriggers); trigIndex++) { - TSShape::Trigger& trig = triggers[trigIndex]; + TSShape::Trigger& trig = mTriggers[trigIndex]; S32 cmpFrame = (S32)(trig.pos * (seq.numKeyframes-1) + 0.5f); S32 cmpState = trig.state & (~TSShape::Trigger::InvertOnReverse); if ((cmpFrame == keyframe) && (cmpState == state)) { - triggers.erase(trigIndex); + mTriggers.erase(trigIndex); seq.numTriggers--; // Fix up firstTrigger for other sequences - for (S32 i = seqIndex + 1; i < sequences.size(); i++) + for (S32 i = seqIndex + 1; i < mSequences.size(); i++) { - if (sequences[i].numTriggers > 0) - sequences[i].firstTrigger--; + if (mSequences[i].numTriggers > 0) + mSequences[i].firstTrigger--; } // Clear MakePath flag if no more triggers @@ -1968,19 +1968,19 @@ void TSShape::getNodeKeyframe(S32 nodeIndex, const TSShape::Sequence& seq, S32 k if (seq.rotationMatters.test(nodeIndex)) { S32 index = seq.rotationMatters.count(nodeIndex) * seq.numKeyframes + keyframe; - nodeRotations[seq.baseRotation + index].getQuatF(&rot); + mNodeRotations[seq.baseRotation + index].getQuatF(&rot); } else - defaultRotations[nodeIndex].getQuatF(&rot); + mDefaultRotations[nodeIndex].getQuatF(&rot); Point3F trans; if (seq.translationMatters.test(nodeIndex)) { S32 index = seq.translationMatters.count(nodeIndex) * seq.numKeyframes + keyframe; - trans = nodeTranslations[seq.baseTranslation + index]; + trans = mNodeTranslations[seq.baseTranslation + index]; } else - trans = defaultTranslations[nodeIndex]; + trans = mDefaultTranslations[nodeIndex]; // Set the keyframe matrix rot.setMatrix(mat); @@ -1996,7 +1996,7 @@ bool TSShape::setSequenceBlend(const String& seqName, bool blend, const String& Con::errorf("TSShape::setSequenceBlend: Could not find sequence named '%s'", seqName.c_str()); return false; } - TSShape::Sequence& seq = sequences[seqIndex]; + TSShape::Sequence& seq = mSequences[seqIndex]; // Ignore if blend flag is already correct if (seq.isBlend() == blend) @@ -2009,7 +2009,7 @@ bool TSShape::setSequenceBlend(const String& seqName, bool blend, const String& Con::errorf("TSShape::setSequenceBlend: Could not find reference sequence named '%s'", blendRefSeqName.c_str()); return false; } - TSShape::Sequence& blendRefSeq = sequences[blendRefSeqIndex]; + TSShape::Sequence& blendRefSeq = mSequences[blendRefSeqIndex]; if ((blendRefFrame < 0) || (blendRefFrame >= blendRefSeq.numKeyframes)) { @@ -2060,9 +2060,9 @@ bool TSShape::setSequenceBlend(const String& seqName, bool blend, const String& newMat.mul(refMat, oldMat); if (updateRot) - nodeRotations[rotOffset + frame].set(QuatF(newMat)); + mNodeRotations[rotOffset + frame].set(QuatF(newMat)); if (updateTrans) - nodeTranslations[transOffset + frame] = newMat.getPosition(); + mNodeTranslations[transOffset + frame] = newMat.getPosition(); } } @@ -2082,7 +2082,7 @@ bool TSShape::setSequenceGroundSpeed(const String& seqName, const Point3F& trans Con::errorf("setSequenceGroundSpeed: Could not find sequence named '%s'", seqName.c_str()); return false; } - TSShape::Sequence& seq = sequences[seqIndex]; + TSShape::Sequence& seq = mSequences[seqIndex]; // Determine how many ground-frames to generate (FPS=10, at least 1 frame) const F32 groundFrameRate = 10.0f; @@ -2094,20 +2094,20 @@ bool TSShape::setSequenceGroundSpeed(const String& seqName, const Point3F& trans { if (frameAdjust > 0) { - groundTranslations.insert(seq.firstGroundFrame); - groundRotations.insert(seq.firstGroundFrame); + mGroundTranslations.insert(seq.firstGroundFrame); + mGroundRotations.insert(seq.firstGroundFrame); } else { - groundTranslations.erase(seq.firstGroundFrame); - groundRotations.erase(seq.firstGroundFrame); + mGroundTranslations.erase(seq.firstGroundFrame); + mGroundRotations.erase(seq.firstGroundFrame); } } // Fixup ground frame indices seq.numGroundFrames += frameAdjust; - for (S32 i = seqIndex+1; i < sequences.size(); i++) - sequences[i].firstGroundFrame += frameAdjust; + for (S32 i = seqIndex+1; i < mSequences.size(); i++) + mSequences[i].firstGroundFrame += frameAdjust; // Generate the ground-frames Point3F adjTrans = trans; @@ -2121,8 +2121,8 @@ bool TSShape::setSequenceGroundSpeed(const String& seqName, const Point3F& trans QuatF groundRot(rotSpeed); for (S32 i = 0; i < seq.numGroundFrames; i++) { - groundTranslations[seq.firstGroundFrame + i] = adjTrans * (i + 1); - groundRotations[seq.firstGroundFrame + i].set(groundRot); + mGroundTranslations[seq.firstGroundFrame + i] = adjTrans * (i + 1); + mGroundRotations[seq.firstGroundFrame + i].set(groundRot); groundRot *= rotSpeed; } diff --git a/Engine/source/ts/tsShapeInstance.cpp b/Engine/source/ts/tsShapeInstance.cpp index d8722b6f9..722561c1f 100644 --- a/Engine/source/ts/tsShapeInstance.cpp +++ b/Engine/source/ts/tsShapeInstance.cpp @@ -176,7 +176,7 @@ void TSShapeInstance::buildInstanceData(TSShape * _shape, bool loadMaterials) mScaleCurrentlyAnimated = false; if(loadMaterials) - setMaterialList(mShape->materialList); + setMaterialList(mShape->mMaterialList); // set up node data initNodeTransforms(); @@ -185,7 +185,7 @@ void TSShapeInstance::buildInstanceData(TSShape * _shape, bool loadMaterials) initMeshObjects(); // set up subtree data - S32 ss = mShape->subShapeFirstNode.size(); // we have this many subtrees + S32 ss = mShape->mSubShapeFirstNode.size(); // we have this many subtrees mDirtyFlags = new U32[ss]; mGroundThread = NULL; @@ -201,18 +201,18 @@ void TSShapeInstance::buildInstanceData(TSShape * _shape, bool loadMaterials) void TSShapeInstance::initNodeTransforms() { // set up node data - S32 numNodes = mShape->nodes.size(); + S32 numNodes = mShape->mNodes.size(); mNodeTransforms.setSize(numNodes); } void TSShapeInstance::initMeshObjects() { // add objects to trees - S32 numObjects = mShape->objects.size(); + S32 numObjects = mShape->mObjects.size(); mMeshObjects.setSize(numObjects); for (S32 i=0; iobjects[i]; + const TSObject * obj = &mShape->mObjects[i]; MeshObjectInstance * objInst = &mMeshObjects[i]; // hook up the object to it's node and transforms. @@ -221,7 +221,7 @@ void TSShapeInstance::initMeshObjects() // set up list of meshes if (obj->numMeshes) - objInst->meshList = &mShape->meshes[obj->startMeshIndex]; + objInst->meshList = &mShape->mMeshes[obj->startMeshIndex]; else objInst->meshList = NULL; @@ -328,7 +328,7 @@ void TSShapeInstance::renderDebugNormals( F32 normalScalar, S32 dl ) if ( dl < 0 ) return; - AssertFatal( dl >= 0 && dl < mShape->details.size(), + AssertFatal( dl >= 0 && dl < mShape->mDetails.size(), "TSShapeInstance::renderDebugNormals() - Bad detail level!" ); static GFXStateBlockRef sb; @@ -344,13 +344,13 @@ void TSShapeInstance::renderDebugNormals( F32 normalScalar, S32 dl ) } GFX->setStateBlock( sb ); - const TSDetail *detail = &mShape->details[dl]; + const TSDetail *detail = &mShape->mDetails[dl]; const S32 ss = detail->subShapeNum; if ( ss < 0 ) return; - const S32 start = mShape->subShapeFirstObject[ss]; - const S32 end = start + mShape->subShapeNumObjects[ss]; + const S32 start = mShape->mSubShapeFirstObject[ss]; + const S32 end = start + mShape->mSubShapeNumObjects[ss]; for ( S32 i = start; i < end; i++ ) { @@ -446,8 +446,8 @@ void TSShapeInstance::render( const TSRenderState &rdata ) // 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 - F32 alphaOut = mShape->alphaOut[mCurrentDetailLevel]; - F32 alphaIn = mShape->alphaIn[mCurrentDetailLevel]; + F32 alphaOut = mShape->mAlphaOut[mCurrentDetailLevel]; + F32 alphaIn = mShape->mAlphaIn[mCurrentDetailLevel]; F32 saveAA = mAlphaAlways ? mAlphaAlwaysValue : 1.0f; /// This first case is the single detail level render. @@ -459,7 +459,7 @@ void TSShapeInstance::render( const TSRenderState &rdata ) // alpha=1-(intraDl-alphaOut)/alphaIn // first draw next detail level - if ( mCurrentDetailLevel + 1 < mShape->details.size() && mShape->details[ mCurrentDetailLevel + 1 ].size > 0.0f ) + if ( mCurrentDetailLevel + 1 < mShape->mDetails.size() && mShape->mDetails[ mCurrentDetailLevel + 1 ].size > 0.0f ) { setAlphaAlways( saveAA * ( alphaIn + alphaOut - mCurrentIntraDetailLevel ) / alphaIn ); render( rdata, mCurrentDetailLevel + 1, 0.0f ); @@ -474,7 +474,7 @@ void TSShapeInstance::render( const TSRenderState &rdata ) // alpha = 1-intraDL/alphaOut // first draw next detail level - if ( mCurrentDetailLevel + 1 < mShape->details.size() && mShape->details[ mCurrentDetailLevel + 1 ].size > 0.0f ) + if ( mCurrentDetailLevel + 1 < mShape->mDetails.size() && mShape->mDetails[ mCurrentDetailLevel + 1 ].size > 0.0f ) render( rdata, mCurrentDetailLevel+1, 0.0f ); setAlphaAlways( saveAA * mCurrentIntraDetailLevel / alphaOut ); @@ -489,7 +489,7 @@ void TSShapeInstance::setMeshForceHidden( const char *meshName, bool hidden ) for ( ; iter != mMeshObjects.end(); iter++ ) { S32 nameIndex = iter->object->nameIndex; - const char *name = mShape->names[ nameIndex ]; + const char *name = mShape->mNames[ nameIndex ]; if ( dStrcmp( meshName, name ) == 0 ) { @@ -509,11 +509,11 @@ void TSShapeInstance::setMeshForceHidden( S32 meshIndex, bool hidden ) void TSShapeInstance::render( const TSRenderState &rdata, S32 dl, F32 intraDL ) { - AssertFatal( dl >= 0 && dl < mShape->details.size(),"TSShapeInstance::render" ); + AssertFatal( dl >= 0 && dl < mShape->mDetails.size(),"TSShapeInstance::render" ); S32 i; - const TSDetail * detail = &mShape->details[dl]; + const TSDetail * detail = &mShape->mDetails[dl]; S32 ss = detail->subShapeNum; S32 od = detail->objectDetailNum; @@ -523,14 +523,14 @@ void TSShapeInstance::render( const TSRenderState &rdata, S32 dl, F32 intraDL ) PROFILE_SCOPE( TSShapeInstance_RenderBillboards ); if ( !rdata.isNoRenderTranslucent() && ( TSLastDetail::smCanShadow || !rdata.getSceneState()->isShadowPass() ) ) - mShape->billboardDetails[ dl ]->render( rdata, mAlphaAlways ? mAlphaAlwaysValue : 1.0f ); + mShape->mBillboardDetails[ dl ]->render( rdata, mAlphaAlways ? mAlphaAlwaysValue : 1.0f ); return; } // run through the meshes - S32 start = rdata.isNoRenderNonTranslucent() ? mShape->subShapeFirstTranslucentObject[ss] : mShape->subShapeFirstObject[ss]; - S32 end = rdata.isNoRenderTranslucent() ? mShape->subShapeFirstTranslucentObject[ss] : mShape->subShapeFirstObject[ss] + mShape->subShapeNumObjects[ss]; + S32 start = rdata.isNoRenderNonTranslucent() ? mShape->mSubShapeFirstTranslucentObject[ss] : mShape->mSubShapeFirstObject[ss]; + S32 end = rdata.isNoRenderTranslucent() ? mShape->mSubShapeFirstTranslucentObject[ss] : mShape->mSubShapeFirstObject[ss] + mShape->mSubShapeNumObjects[ss]; for (i=start; iradius / scaledDistance ) * state->getWorldToScreenScale().y * pixelScale; + F32 pixelRadius = ( mShape->mRadius / scaledDistance ) * state->getWorldToScreenScale().y * pixelScale; F32 pixelSize = pixelRadius * smDetailAdjust; if ( pixelSize < smSmallestVisiblePixelSize ) { @@ -671,7 +671,7 @@ S32 TSShapeInstance::setDetailFromScreenError( F32 errorTolerance ) if ( mShape->mSmallestVisibleDL < 0 ) prevErr = 0.0f; else - prevErr = 10.0f * mShape->details[mShape->mSmallestVisibleDL].averageError * 20.0f; + prevErr = 10.0f * mShape->mDetails[mShape->mSmallestVisibleDL].averageError * 20.0f; if ( mShape->mSmallestVisibleDL < 0 || prevErr < errorTolerance ) { // draw last detail @@ -688,7 +688,7 @@ S32 TSShapeInstance::setDetailFromScreenError( F32 errorTolerance ) // we use the next highest detail (higher error) for (S32 i = mShape->mSmallestVisibleDL; i >= 0; i-- ) { - F32 err0 = 10.0f * mShape->details[i].averageError; + F32 err0 = 10.0f * mShape->mDetails[i].averageError; if ( err0 < errorTolerance ) { // ok, stop here @@ -776,10 +776,10 @@ void TSShapeInstance::prepCollision() PROFILE_SCOPE( TSShapeInstance_PrepCollision ); // Iterate over all our meshes and call prepCollision on them... - for(S32 i=0; imeshes.size(); i++) + for(S32 i=0; imMeshes.size(); i++) { - if(mShape->meshes[i]) - mShape->meshes[i]->prepOpcodeCollision(); + if(mShape->mMeshes[i]) + mShape->mMeshes[i]->prepOpcodeCollision(); } } diff --git a/Engine/source/ts/tsShapeInstance.h b/Engine/source/ts/tsShapeInstance.h index f507f7153..c526aeff0 100644 --- a/Engine/source/ts/tsShapeInstance.h +++ b/Engine/source/ts/tsShapeInstance.h @@ -531,7 +531,7 @@ protected: void deltaGround1(TSThread *, F32 start, F32 end, MatrixF& mat); /// @} - U32 getNumDetails() const { return mShape ? mShape->details.size() : 0; } + U32 getNumDetails() const { return mShape ? mShape->mDetails.size() : 0; } S32 getCurrentDetail() const { return mCurrentDetailLevel; } @@ -785,7 +785,7 @@ public: TSShapeInstance * getShapeInstance() { return mShapeInstance; } bool hasSequence() const { return sequence >= 0; } U32 getSeqIndex() const { return sequence; } - const TSSequence* getSequence() const { return &(mShapeInstance->mShape->sequences[sequence]); } + const TSSequence* getSequence() const { return &(mShapeInstance->mShape->mSequences[sequence]); } const String& getSequenceName() const { return mShapeInstance->mShape->getSequenceName(sequence); } S32 operator<(const TSThread &) const; }; diff --git a/Engine/source/ts/tsShapeOldRead.cpp b/Engine/source/ts/tsShapeOldRead.cpp index e76198de3..e46971813 100644 --- a/Engine/source/ts/tsShapeOldRead.cpp +++ b/Engine/source/ts/tsShapeOldRead.cpp @@ -33,12 +33,12 @@ void TSShape::fixupOldSkins(S32 numMeshes, S32 numSkins, S32 numDetails, S32 * d { #if !defined(TORQUE_MAX_LIB) // this method not necessary in exporter, and a couple lines won't compile for exporter - if (!objects.address() || !meshes.address() || !numSkins) + if (!mObjects.address() || !mMeshes.address() || !numSkins) // not ready for this yet, will catch it on the next pass return; - S32 numObjects = objects.size(); - TSObject * newObjects = objects.address() + objects.size(); - TSSkinMesh ** skins = (TSSkinMesh**)&meshes[numMeshes]; + S32 numObjects = mObjects.size(); + TSObject * newObjects = mObjects.address() + mObjects.size(); + TSSkinMesh ** skins = (TSSkinMesh**)&mMeshes[numMeshes]; Vector skinsCopy; // Note: newObjects has as much free space as we need, so we just need to keep track of the // number of objects we use and then update objects.size @@ -52,7 +52,7 @@ void TSShape::fixupOldSkins(S32 numMeshes, S32 numSkins, S32 numDetails, S32 * d while (skinsUsedwrite(sz); - for (i=0;iwrite(0); @@ -208,71 +208,71 @@ void TSShape::exportSequences(Stream * s) // on import, we will need to adjust keyframe data based on number of // nodes/objects in this shape...number of nodes can be inferred from // above, but number of objects cannot be. Write that quantity here: - s->write(objects.size()); + s->write(mObjects.size()); // write node states -- skip default node states - s->write(nodeRotations.size()); - for (i=0;iwrite(mNodeRotations.size()); + for (i=0;iwrite(nodeRotations[i].x); - s->write(nodeRotations[i].y); - s->write(nodeRotations[i].z); - s->write(nodeRotations[i].w); + s->write(mNodeRotations[i].x); + s->write(mNodeRotations[i].y); + s->write(mNodeRotations[i].z); + s->write(mNodeRotations[i].w); } - s->write(nodeTranslations.size()); - for (i=0;iwrite(mNodeTranslations.size()); + for (i=0;iwrite(nodeTranslations[i].x); - s->write(nodeTranslations[i].y); - s->write(nodeTranslations[i].z); + s->write(mNodeTranslations[i].x); + s->write(mNodeTranslations[i].y); + s->write(mNodeTranslations[i].z); } - s->write(nodeUniformScales.size()); - for (i=0;iwrite(nodeUniformScales[i]); - s->write(nodeAlignedScales.size()); - for (i=0;iwrite(mNodeUniformScales.size()); + for (i=0;iwrite(mNodeUniformScales[i]); + s->write(mNodeAlignedScales.size()); + for (i=0;iwrite(nodeAlignedScales[i].x); - s->write(nodeAlignedScales[i].y); - s->write(nodeAlignedScales[i].z); + s->write(mNodeAlignedScales[i].x); + s->write(mNodeAlignedScales[i].y); + s->write(mNodeAlignedScales[i].z); } - s->write(nodeArbitraryScaleRots.size()); - for (i=0;iwrite(mNodeArbitraryScaleRots.size()); + for (i=0;iwrite(nodeArbitraryScaleRots[i].x); - s->write(nodeArbitraryScaleRots[i].y); - s->write(nodeArbitraryScaleRots[i].z); - s->write(nodeArbitraryScaleRots[i].w); + s->write(mNodeArbitraryScaleRots[i].x); + s->write(mNodeArbitraryScaleRots[i].y); + s->write(mNodeArbitraryScaleRots[i].z); + s->write(mNodeArbitraryScaleRots[i].w); } - for (i=0;iwrite(nodeArbitraryScaleFactors[i].x); - s->write(nodeArbitraryScaleFactors[i].y); - s->write(nodeArbitraryScaleFactors[i].z); + s->write(mNodeArbitraryScaleFactors[i].x); + s->write(mNodeArbitraryScaleFactors[i].y); + s->write(mNodeArbitraryScaleFactors[i].z); } - s->write(groundTranslations.size()); - for (i=0;iwrite(mGroundTranslations.size()); + for (i=0;iwrite(groundTranslations[i].x); - s->write(groundTranslations[i].y); - s->write(groundTranslations[i].z); + s->write(mGroundTranslations[i].x); + s->write(mGroundTranslations[i].y); + s->write(mGroundTranslations[i].z); } - for (i=0;iwrite(groundRotations[i].x); - s->write(groundRotations[i].y); - s->write(groundRotations[i].z); - s->write(groundRotations[i].w); + s->write(mGroundRotations[i].x); + s->write(mGroundRotations[i].y); + s->write(mGroundRotations[i].z); + s->write(mGroundRotations[i].w); } // write object states -- legacy..no object states s->write((S32)0); // write sequences - s->write(sequences.size()); - for (i=0;iwrite(mSequences.size()); + for (i=0;iwrite(triggers.size()); - for (i=0; iwrite(mTriggers.size()); + for (i=0; iwrite(triggers[i].state); - s->write(triggers[i].pos); + s->write(mTriggers[i].state); + s->write(mTriggers[i].pos); } } @@ -303,9 +303,9 @@ void TSShape::exportSequence(Stream * s, const TSShape::Sequence& seq, bool save s->write(smVersion); // write node names - s->write( nodes.size() ); - for ( S32 i = 0; i < nodes.size(); i++ ) - writeName( s, nodes[i].nameIndex ); + s->write( mNodes.size() ); + for ( S32 i = 0; i < mNodes.size(); i++ ) + writeName( s, mNodes[i].nameIndex ); // legacy write -- write zero objects, don't pretend to support object export anymore s->write( (S32)0 ); @@ -313,26 +313,26 @@ void TSShape::exportSequence(Stream * s, const TSShape::Sequence& seq, bool save // on import, we will need to adjust keyframe data based on number of // nodes/objects in this shape...number of nodes can be inferred from // above, but number of objects cannot be. Write that quantity here: - s->write( objects.size() ); + s->write( mObjects.size() ); // write node states -- skip default node states S32 count = seq.rotationMatters.count() * seq.numKeyframes; s->write( count ); for ( S32 i = seq.baseRotation; i < seq.baseRotation + count; i++ ) { - s->write( nodeRotations[i].x ); - s->write( nodeRotations[i].y ); - s->write( nodeRotations[i].z ); - s->write( nodeRotations[i].w ); + s->write( mNodeRotations[i].x ); + s->write( mNodeRotations[i].y ); + s->write( mNodeRotations[i].z ); + s->write( mNodeRotations[i].w ); } count = seq.translationMatters.count() * seq.numKeyframes; s->write( count ); for ( S32 i = seq.baseTranslation; i < seq.baseTranslation + count; i++ ) { - s->write( nodeTranslations[i].x ); - s->write( nodeTranslations[i].y ); - s->write( nodeTranslations[i].z ); + s->write( mNodeTranslations[i].x ); + s->write( mNodeTranslations[i].y ); + s->write( mNodeTranslations[i].z ); } count = seq.scaleMatters.count() * seq.numKeyframes; @@ -340,7 +340,7 @@ void TSShape::exportSequence(Stream * s, const TSShape::Sequence& seq, bool save { s->write( count ); for ( S32 i = seq.baseScale; i < seq.baseScale + count; i++ ) - s->write( nodeUniformScales[i] ); + s->write( mNodeUniformScales[i] ); } else s->write( (S32)0 ); @@ -350,9 +350,9 @@ void TSShape::exportSequence(Stream * s, const TSShape::Sequence& seq, bool save s->write( count ); for ( S32 i = seq.baseScale; i < seq.baseScale + count; i++ ) { - s->write( nodeAlignedScales[i].x ); - s->write( nodeAlignedScales[i].y ); - s->write( nodeAlignedScales[i].z ); + s->write( mNodeAlignedScales[i].x ); + s->write( mNodeAlignedScales[i].y ); + s->write( mNodeAlignedScales[i].z ); } } else @@ -363,16 +363,16 @@ void TSShape::exportSequence(Stream * s, const TSShape::Sequence& seq, bool save s->write( count ); for ( S32 i = seq.baseScale; i < seq.baseScale + count; i++ ) { - s->write( nodeArbitraryScaleRots[i].x ); - s->write( nodeArbitraryScaleRots[i].y ); - s->write( nodeArbitraryScaleRots[i].z ); - s->write( nodeArbitraryScaleRots[i].w ); + s->write( mNodeArbitraryScaleRots[i].x ); + s->write( mNodeArbitraryScaleRots[i].y ); + s->write( mNodeArbitraryScaleRots[i].z ); + s->write( mNodeArbitraryScaleRots[i].w ); } for ( S32 i = seq.baseScale; i < seq.baseScale + count; i++ ) { - s->write( nodeArbitraryScaleFactors[i].x ); - s->write( nodeArbitraryScaleFactors[i].y ); - s->write( nodeArbitraryScaleFactors[i].z ); + s->write( mNodeArbitraryScaleFactors[i].x ); + s->write( mNodeArbitraryScaleFactors[i].y ); + s->write( mNodeArbitraryScaleFactors[i].z ); } } else @@ -381,16 +381,16 @@ void TSShape::exportSequence(Stream * s, const TSShape::Sequence& seq, bool save s->write( seq.numGroundFrames ); for ( S32 i = seq.firstGroundFrame; i < seq.firstGroundFrame + seq.numGroundFrames; i++ ) { - s->write( groundTranslations[i].x ); - s->write( groundTranslations[i].y ); - s->write( groundTranslations[i].z ); + s->write( mGroundTranslations[i].x ); + s->write( mGroundTranslations[i].y ); + s->write( mGroundTranslations[i].z ); } for ( S32 i = seq.firstGroundFrame; i < seq.firstGroundFrame + seq.numGroundFrames; i++ ) { - s->write( groundRotations[i].x ); - s->write( groundRotations[i].y ); - s->write( groundRotations[i].z ); - s->write( groundRotations[i].w ); + s->write( mGroundRotations[i].x ); + s->write( mGroundRotations[i].y ); + s->write( mGroundRotations[i].z ); + s->write( mGroundRotations[i].w ); } // write object states -- legacy..no object states @@ -417,8 +417,8 @@ void TSShape::exportSequence(Stream * s, const TSShape::Sequence& seq, bool save s->write( seq.numTriggers ); for ( S32 i = seq.firstTrigger; i < seq.firstTrigger + seq.numTriggers; i++ ) { - s->write( triggers[i].state ); - s->write( triggers[i].pos ); + s->write( mTriggers[i].state ); + s->write( mTriggers[i].pos ); } smVersion = currentVersion; @@ -460,7 +460,7 @@ bool TSShape::importSequences(Stream * s, const String& sequencePath) for (i=0;i remove the added node name - if (names.size() != startSize) + if (mNames.size() != startSize) { - names.decrement(); + mNames.decrement(); - if (names.size() != startSize) - Con::errorf(ConsoleLogEntry::General, "TSShape::importSequence: failed to remove unused node correctly for dsq %s.", names[nameIndex].c_str(), sequencePath.c_str()); + if (mNames.size() != startSize) + Con::errorf(ConsoleLogEntry::General, "TSShape::importSequence: failed to remove unused node correctly for dsq %s.", mNames[nameIndex].c_str(), sequencePath.c_str()); } } } @@ -487,9 +487,9 @@ bool TSShape::importSequences(Stream * s, const String& sequencePath) s->read(&oldShapeNumObjects); // adjust all the new keyframes - S32 adjNodeRots = smReadVersion<22 ? nodeRotations.size() - nodeMap.size() : nodeRotations.size(); - S32 adjNodeTrans = smReadVersion<22 ? nodeTranslations.size() - nodeMap.size() : nodeTranslations.size(); - S32 adjGroundStates = smReadVersion<22 ? 0 : groundTranslations.size(); // groundTrans==groundRot + S32 adjNodeRots = smReadVersion<22 ? mNodeRotations.size() - nodeMap.size() : mNodeRotations.size(); + S32 adjNodeTrans = smReadVersion<22 ? mNodeTranslations.size() - nodeMap.size() : mNodeTranslations.size(); + S32 adjGroundStates = smReadVersion<22 ? 0 : mGroundTranslations.size(); // groundTrans==groundRot // Read the node states into temporary vectors, then use the // nodeMap to discard unused transforms and map others to our nodes @@ -551,21 +551,21 @@ bool TSShape::importSequences(Stream * s, const String& sequencePath) // ground transforms can be read directly into the shape (none will be // discarded) s->read(&sz); - S32 oldSz = groundTranslations.size(); - groundTranslations.setSize(sz+oldSz); + S32 oldSz = mGroundTranslations.size(); + mGroundTranslations.setSize(sz+oldSz); for (i=oldSz;iread(&groundTranslations[i].x); - s->read(&groundTranslations[i].y); - s->read(&groundTranslations[i].z); + s->read(&mGroundTranslations[i].x); + s->read(&mGroundTranslations[i].y); + s->read(&mGroundTranslations[i].z); } - groundRotations.setSize(sz+oldSz); + mGroundRotations.setSize(sz+oldSz); for (i=oldSz;iread(&groundRotations[i].x); - s->read(&groundRotations[i].y); - s->read(&groundRotations[i].z); - s->read(&groundRotations[i].w); + s->read(&mGroundRotations[i].x); + s->read(&mGroundRotations[i].y); + s->read(&mGroundRotations[i].z); + s->read(&mGroundRotations[i].w); } } else @@ -590,28 +590,28 @@ bool TSShape::importSequences(Stream * s, const String& sequencePath) // read sequences s->read(&sz); - S32 startSeqNum = sequences.size(); + S32 startSeqNum = mSequences.size(); for (i=0;i 21) { if (seq.animatesUniformScale()) - seq.baseScale = nodeUniformScales.size(); + seq.baseScale = mNodeUniformScales.size(); else if (seq.animatesAlignedScale()) - seq.baseScale = nodeAlignedScales.size(); + seq.baseScale = mNodeAlignedScales.size(); else if (seq.animatesArbitraryScale()) - seq.baseScale = nodeArbitraryScaleFactors.size(); + seq.baseScale = mNodeArbitraryScaleFactors.size(); } // remap the node matters arrays @@ -633,18 +633,18 @@ bool TSShape::importSequences(Stream * s, const String& sequencePath) } // resize node transform arrays - nodeTranslations.increment(newTransMembership.count() * seq.numKeyframes); - nodeRotations.increment(newRotMembership.count() * seq.numKeyframes); + mNodeTranslations.increment(newTransMembership.count() * seq.numKeyframes); + mNodeRotations.increment(newRotMembership.count() * seq.numKeyframes); if (seq.flags & TSShape::ArbitraryScale) { S32 scaleCount = newScaleMembership.count() * seq.numKeyframes; - nodeArbitraryScaleRots.increment(scaleCount); - nodeArbitraryScaleFactors.increment(scaleCount); + mNodeArbitraryScaleRots.increment(scaleCount); + mNodeArbitraryScaleFactors.increment(scaleCount); } else if (seq.flags & TSShape::AlignedScale) - nodeAlignedScales.increment(newScaleMembership.count() * seq.numKeyframes); + mNodeAlignedScales.increment(newScaleMembership.count() * seq.numKeyframes); else - nodeUniformScales.increment(newScaleMembership.count() * seq.numKeyframes); + mNodeUniformScales.increment(newScaleMembership.count() * seq.numKeyframes); // remap node transforms from temporary arrays for (S32 j = 0; j < nodeMap.size(); j++) @@ -656,13 +656,13 @@ bool TSShape::importSequences(Stream * s, const String& sequencePath) { S32 src = seq.numKeyframes * seq.translationMatters.count(j); S32 dest = seq.baseTranslation + seq.numKeyframes * newTransMembership.count(nodeMap[j]); - dCopyArray(&nodeTranslations[dest], &seqTranslations[src], seq.numKeyframes); + dCopyArray(&mNodeTranslations[dest], &seqTranslations[src], seq.numKeyframes); } if (newRotMembership.test(nodeMap[j])) { S32 src = seq.numKeyframes * seq.rotationMatters.count(j); S32 dest = seq.baseRotation + seq.numKeyframes * newRotMembership.count(nodeMap[j]); - dCopyArray(&nodeRotations[dest], &seqRotations[src], seq.numKeyframes); + dCopyArray(&mNodeRotations[dest], &seqRotations[src], seq.numKeyframes); } if (newScaleMembership.test(nodeMap[j])) { @@ -670,13 +670,13 @@ bool TSShape::importSequences(Stream * s, const String& sequencePath) S32 dest = seq.baseScale + seq.numKeyframes * newScaleMembership.count(nodeMap[j]); if (seq.flags & TSShape::ArbitraryScale) { - dCopyArray(&nodeArbitraryScaleRots[dest], &seqArbitraryScaleRots[src], seq.numKeyframes); - dCopyArray(&nodeArbitraryScaleFactors[dest], &seqArbitraryScaleFactors[src], seq.numKeyframes); + dCopyArray(&mNodeArbitraryScaleRots[dest], &seqArbitraryScaleRots[src], seq.numKeyframes); + dCopyArray(&mNodeArbitraryScaleFactors[dest], &seqArbitraryScaleFactors[src], seq.numKeyframes); } else if (seq.flags & TSShape::AlignedScale) - dCopyArray(&nodeAlignedScales[dest], &seqAlignedScales[src], seq.numKeyframes); + dCopyArray(&mNodeAlignedScales[dest], &seqAlignedScales[src], seq.numKeyframes); else - dCopyArray(&nodeUniformScales[dest], &seqUniformScales[src], seq.numKeyframes); + dCopyArray(&mNodeUniformScales[dest], &seqUniformScales[src], seq.numKeyframes); } } @@ -685,7 +685,7 @@ bool TSShape::importSequences(Stream * s, const String& sequencePath) seq.scaleMatters = newScaleMembership; // adjust trigger numbers...we'll read triggers after sequences... - seq.firstTrigger += triggers.size(); + seq.firstTrigger += mTriggers.size(); // finally, adjust ground transform's nodes states seq.firstGroundFrame += adjGroundStates; @@ -693,30 +693,30 @@ bool TSShape::importSequences(Stream * s, const String& sequencePath) if (smReadVersion<22) { - for (i=startSeqNum; iread(&sz); - triggers.setSize(oldSz+sz); + mTriggers.setSize(oldSz+sz); for (S32 i=0; iread(&triggers[i+oldSz].state); - s->read(&triggers[i+oldSz].pos); + s->read(&mTriggers[i+oldSz].state); + s->read(&mTriggers[i+oldSz].pos); } if (smInitOnRead) @@ -846,7 +846,7 @@ void TSShape::writeName(Stream * s, S32 nameIndex) { const char * name = ""; if (nameIndex>=0) - name = names[nameIndex]; + name = mNames[nameIndex]; S32 sz = (S32)dStrlen(name); s->write(sz); if (sz) @@ -876,9 +876,9 @@ S32 TSShape::readName(Stream * s, bool addName) if (nameIndex<0 && addName) { - nameIndex = names.size(); - names.increment(); - names.last() = buffer; + nameIndex = mNames.size(); + mNames.increment(); + mNames.last() = buffer; } } diff --git a/Engine/source/ts/tsThread.cpp b/Engine/source/ts/tsThread.cpp index 7cb543c9e..03a82f40d 100644 --- a/Engine/source/ts/tsThread.cpp +++ b/Engine/source/ts/tsThread.cpp @@ -139,8 +139,8 @@ void TSThread::getGround(F32 t, MatrixF * pMat) // assumed to be ident. and not found in the list. if (frame) { - p1 = &mShapeInstance->mShape->groundTranslations[getSequence()->firstGroundFrame + frame - 1]; - q1 = &mShapeInstance->mShape->groundRotations[getSequence()->firstGroundFrame + frame - 1].getQuatF(&rot1); + p1 = &mShapeInstance->mShape->mGroundTranslations[getSequence()->firstGroundFrame + frame - 1]; + q1 = &mShapeInstance->mShape->mGroundRotations[getSequence()->firstGroundFrame + frame - 1].getQuatF(&rot1); } else { @@ -149,8 +149,8 @@ void TSThread::getGround(F32 t, MatrixF * pMat) } // similar to above, ground keyframe number 'frame+1' is actually offset by 'frame' - p2 = &mShapeInstance->mShape->groundTranslations[getSequence()->firstGroundFrame + frame]; - q2 = &mShapeInstance->mShape->groundRotations[getSequence()->firstGroundFrame + frame].getQuatF(&rot2); + p2 = &mShapeInstance->mShape->mGroundTranslations[getSequence()->firstGroundFrame + frame]; + q2 = &mShapeInstance->mShape->mGroundRotations[getSequence()->firstGroundFrame + frame].getQuatF(&rot2); QuatF q; Point3F p; @@ -163,7 +163,7 @@ void TSThread::setSequence(S32 seq, F32 toPos) { const TSShape * shape = mShapeInstance->mShape; - AssertFatal(shape && shape->sequences.size()>seq && toPos>=0.0f && toPos<=1.0f, + AssertFatal(shape && shape->mSequences.size()>seq && toPos>=0.0f && toPos<=1.0f, "TSThread::setSequence: invalid shape handle, sequence number, or position."); mShapeInstance->clearTransition(this); @@ -287,12 +287,12 @@ void TSThread::activateTriggers(F32 a, F32 b) for (i=firstTrigger; ilastPos && a<=shape->triggers[i].pos) + if (a>lastPos && a<=shape->mTriggers[i].pos) aIndex = i; // is b between this trigger and previous one... - if (b>lastPos && b<=shape->triggers[i].pos) + if (b>lastPos && b<=shape->mTriggers[i].pos) bIndex = i; - lastPos = shape->triggers[i].pos; + lastPos = shape->mTriggers[i].pos; } // activate triggers between aIndex and bIndex (depends on direction) @@ -300,7 +300,7 @@ void TSThread::activateTriggers(F32 a, F32 b) { for (i=aIndex; itriggers[i].state; + U32 state = shape->mTriggers[i].state; bool on = (state & TSShape::Trigger::StateOn)!=0; mShapeInstance->setTriggerStateBit(state & TSShape::Trigger::StateMask, on); } @@ -309,7 +309,7 @@ void TSThread::activateTriggers(F32 a, F32 b) { for (i=aIndex-1; i>=bIndex; i--) { - U32 state = shape->triggers[i].state; + U32 state = shape->mTriggers[i].state; bool on = (state & TSShape::Trigger::StateOn)!=0; if (state & TSShape::Trigger::InvertOnReverse) on = !on; @@ -354,7 +354,7 @@ void TSThread::advancePos(F32 delta) { // make dirty what this thread changes U32 dirtyFlags = getSequence()->dirtyFlags | (transitionData.inTransition ? TSShapeInstance::TransformDirty : 0); - for (S32 i=0; igetShape()->subShapeFirstNode.size(); i++) + for (S32 i=0; igetShape()->mSubShapeFirstNode.size(); i++) mShapeInstance->mDirtyFlags[i] |= dirtyFlags; } @@ -500,7 +500,7 @@ S32 TSThread::operator<(const TSThread & th2) const TSThread * TSShapeInstance::addThread() { - if (mShape->sequences.empty()) + if (mShape->mSequences.empty()) return NULL; mThreadList.increment(); @@ -656,9 +656,9 @@ void TSShapeInstance::updateTransitions() updateTransitionNodeTransforms(transitionNodes); S32 i; - mNodeReferenceRotations.setSize(mShape->nodes.size()); - mNodeReferenceTranslations.setSize(mShape->nodes.size()); - for (i=0; inodes.size(); i++) + mNodeReferenceRotations.setSize(mShape->mNodes.size()); + mNodeReferenceTranslations.setSize(mShape->mNodes.size()); + for (i=0; imNodes.size(); i++) { if (mTransitionRotationNodes.test(i)) mNodeReferenceRotations[i].set(smNodeCurrentRotations[i]); @@ -674,8 +674,8 @@ void TSShapeInstance::updateTransitions() if (animatesUniformScale()) { - mNodeReferenceUniformScales.setSize(mShape->nodes.size()); - for (i=0; inodes.size(); i++) + mNodeReferenceUniformScales.setSize(mShape->mNodes.size()); + for (i=0; imNodes.size(); i++) { if (mTransitionScaleNodes.test(i)) mNodeReferenceUniformScales[i] = smNodeCurrentUniformScales[i]; @@ -683,8 +683,8 @@ void TSShapeInstance::updateTransitions() } else if (animatesAlignedScale()) { - mNodeReferenceScaleFactors.setSize(mShape->nodes.size()); - for (i=0; inodes.size(); i++) + mNodeReferenceScaleFactors.setSize(mShape->mNodes.size()); + for (i=0; imNodes.size(); i++) { if (mTransitionScaleNodes.test(i)) mNodeReferenceScaleFactors[i] = smNodeCurrentAlignedScales[i]; @@ -692,9 +692,9 @@ void TSShapeInstance::updateTransitions() } else { - mNodeReferenceScaleFactors.setSize(mShape->nodes.size()); - mNodeReferenceArbitraryScaleRots.setSize(mShape->nodes.size()); - for (i=0; inodes.size(); i++) + mNodeReferenceScaleFactors.setSize(mShape->mNodes.size()); + mNodeReferenceArbitraryScaleRots.setSize(mShape->mNodes.size()); + for (i=0; imNodes.size(); i++) { if (mTransitionScaleNodes.test(i)) {