Rename all member variables to follow the style guidelines (prefixed with the 'm') - class TSShape

This commit is contained in:
bank 2014-05-13 14:08:42 +04:00
parent 2112c81446
commit 69dbaf5b85
35 changed files with 1377 additions and 1377 deletions

View file

@ -568,7 +568,7 @@ bool Debris::onAdd()
// Setup our bounding box
if( mDataBlock->shape )
{
mObjBox = mDataBlock->shape->bounds;
mObjBox = mDataBlock->shape->mBounds;
}
else
{

View file

@ -213,7 +213,7 @@ void RenderShapeExample::createShape()
}
// Update the bounding box
mObjBox = mShape->bounds;
mObjBox = mShape->mBounds;
resetWorldBox();
setRenderTransform(mObjToWorld);

View file

@ -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();
}

View file

@ -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];

View file

@ -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 ) );

View file

@ -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,

View file

@ -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<U32> &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;

View file

@ -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

View file

@ -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

View file

@ -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));

View file

@ -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<GFXVertexPNTTB>();
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 );
}

View file

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

View file

@ -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<GFXVertexPNTTB>();
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 *, (),,

View file

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

View file

@ -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));