Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert recent style cleanup changes #1236

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Engine/source/T3D/debris.cpp
Expand Up @@ -573,7 +573,7 @@ bool Debris::onAdd()
// Setup our bounding box
if( mDataBlock->shape )
{
mObjBox = mDataBlock->shape->mBounds;
mObjBox = mDataBlock->shape->bounds;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/examples/renderShapeExample.cpp
Expand Up @@ -213,7 +213,7 @@ void RenderShapeExample::createShape()
}

// Update the bounding box
mObjBox = mShape->mBounds;
mObjBox = mShape->bounds;
resetWorldBox();
setRenderTransform(mObjToWorld);

Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/fx/explosion.cpp
Expand Up @@ -1252,7 +1252,7 @@ bool Explosion::explode()
mEndingMS = U32(mExplosionInstance->getScaledDuration(mExplosionThread) * 1000.0f);

mObjScale.convolve(mDataBlock->explosionScale);
mObjBox = mDataBlock->explosionShape->mBounds;
mObjBox = mDataBlock->explosionShape->bounds;
resetWorldBox();
}

Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/fx/groundCover.cpp
Expand Up @@ -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()->mBounds : Box3F();
const Box3F typeShapeBounds = typeIsShape ? mShapeInstances[ type ]->getShape()->bounds : Box3F();
const F32 typeWindScale = mWindScale[type];
StringTableEntry typeLayer = mLayer[type];
const bool typeInvertLayer = mInvertLayer[type];
Expand Down
6 changes: 3 additions & 3 deletions Engine/source/T3D/guiMaterialPreview.cpp
Expand Up @@ -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()->mCenter;
mMinOrbitDist = mModel->getShape()->mRadius;
mOrbitPos = mModel->getShape()->center;
mMinOrbitDist = mModel->getShape()->radius;

lastRenderTime = Platform::getVirtualMilliseconds();
}
Expand Down Expand Up @@ -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()->mCenter;
mOrbitPos = mModel->getShape()->center;

// Reset the viewport's lighting.
GuiMaterialPreview::mFakeSun->setColor( ColorF( 1.0f, 1.0f, 1.0f ) );
Expand Down
8 changes: 4 additions & 4 deletions Engine/source/T3D/guiObjectView.cpp
Expand Up @@ -366,8 +366,8 @@ void GuiObjectView::setObjectModel( const String& modelName )

// Initialize camera values.

mOrbitPos = mModel->getShape()->mCenter;
mMinOrbitDist = mModel->getShape()->mRadius;
mOrbitPos = mModel->getShape()->center;
mMinOrbitDist = mModel->getShape()->radius;

// Initialize animation.

Expand Down Expand Up @@ -645,7 +645,7 @@ void GuiObjectView::_initAnimation()

if( mAnimationSeq != -1 )
{
if( mAnimationSeq >= mModel->getShape()->mSequences.size() )
if( mAnimationSeq >= mModel->getShape()->sequences.size() )
{
Con::errorf( "GuiObjectView::_initAnimation - Sequence '%i' out of range for model '%s'",
mAnimationSeq,
Expand Down Expand Up @@ -694,7 +694,7 @@ void GuiObjectView::_initMount()

// Make sure mount node is valid.

if( mMountNode != -1 && mMountNode >= mModel->getShape()->mNodes.size() )
if( mMountNode != -1 && mMountNode >= mModel->getShape()->nodes.size() )
{
Con::errorf( "GuiObjectView::_initMount - Mount node index '%i' out of range for '%s'",
mMountNode,
Expand Down
12 changes: 6 additions & 6 deletions Engine/source/T3D/physics/physicsDebris.cpp
Expand Up @@ -358,7 +358,7 @@ bool PhysicsDebris::onAdd()
}

// Setup our bounding box
mObjBox = mDataBlock->shape->mBounds;
mObjBox = mDataBlock->shape->bounds;
resetWorldBox();

// Add it to the client scene.
Expand Down Expand Up @@ -696,20 +696,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->mNodes[colNode].parentIndex;
itr = shape->mNodes[itr].firstChild;
S32 itr = shape->nodes[colNode].parentIndex;
itr = shape->nodes[itr].firstChild;

while ( itr != -1 )
{
if ( itr != colNode )
nodeIds.push_back(itr);
itr = shape->mNodes[itr].nextSibling;
itr = shape->nodes[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->mNodes[colNode].parentIndex != -1 )
nodeIds.push_back( shape->mNodes[colNode].parentIndex );
if ( nodeIds.size() == 0 && shape->nodes[colNode].parentIndex != -1 )
nodeIds.push_back( shape->nodes[colNode].parentIndex );
}

extern bool gEditingMission;
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/physics/physicsShape.cpp
Expand Up @@ -698,7 +698,7 @@ bool PhysicsShape::_createShape()
return false;

// Set the world box.
mObjBox = db->shape->mBounds;
mObjBox = db->shape->bounds;
resetWorldBox();

// If this is the server and its a client only simulation
Expand Down
6 changes: 3 additions & 3 deletions Engine/source/T3D/player.cpp
Expand Up @@ -489,12 +489,12 @@ bool PlayerData::preload(bool server, String &errorStr)
if (dp->sequence != -1)
getGroundInfo(si,thread,dp);
}
for (S32 b = 0; b < mShape->mSequences.size(); b++)
for (S32 b = 0; b < mShape->sequences.size(); b++)
{
if (!isTableSequence(b))
{
dp->sequence = b;
dp->name = mShape->getName(mShape->mSequences[b].nameIndex);
dp->name = mShape->getName(mShape->sequences[b].nameIndex);
dp->velocityScale = false;
getGroundInfo(si,thread,dp++);
}
Expand Down Expand Up @@ -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()->mSequences[dp->sequence].numGroundFrames == 0)
if (si->getShape()->sequences[dp->sequence].numGroundFrames == 0)
si->getShape()->setSequenceGroundSpeed(dp->name, Point3F(0, 0, 0), Point3F(0, 0, 0));
}
else
Expand Down
2 changes: 1 addition & 1 deletion Engine/source/T3D/projectile.cpp
Expand Up @@ -771,7 +771,7 @@ bool Projectile::onAdd()

// Setup our bounding box
if (bool(mDataBlock->projectileShape) == true)
mObjBox = mDataBlock->projectileShape->mBounds;
mObjBox = mDataBlock->projectileShape->bounds;
else
mObjBox = Box3F(Point3F(0, 0, 0), Point3F(0, 0, 0));

Expand Down
52 changes: 26 additions & 26 deletions Engine/source/T3D/shapeBase.cpp
Expand Up @@ -323,9 +323,9 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
// Resolve details and camera node indexes.
static const String sCollisionStr( "collision-" );

for (i = 0; i < mShape->mDetails.size(); i++)
for (i = 0; i < mShape->details.size(); i++)
{
const String &name = mShape->mNames[mShape->mDetails[i].nameIndex];
const String &name = mShape->names[mShape->details[i].nameIndex];

if (name.compare( sCollisionStr, sCollisionStr.length(), String::NoCase ) == 0)
{
Expand All @@ -335,15 +335,15 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
mShape->computeBounds(collisionDetails.last(), collisionBounds.last());
mShape->getAccelerator(collisionDetails.last());

if (!mShape->mBounds.isContained(collisionBounds.last()))
if (!mShape->bounds.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->mBounds;
collisionBounds.last() = mShape->bounds;
}
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->mBounds;
collisionBounds.last() = mShape->bounds;
}

// The way LOS works is that it will check to see if there is a LOS detail that matches
Expand All @@ -364,9 +364,9 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
// Snag any "unmatched" LOS details
static const String sLOSStr( "LOS-" );

for (i = 0; i < mShape->mDetails.size(); i++)
for (i = 0; i < mShape->details.size(); i++)
{
const String &name = mShape->mNames[mShape->mDetails[i].nameIndex];
const String &name = mShape->names[mShape->details[i].nameIndex];

if (name.compare( sLOSStr, sLOSStr.length(), String::NoCase ) == 0)
{
Expand Down Expand Up @@ -410,7 +410,7 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
damageSequence = mShape->findSequence("Damage");

//
F32 w = mShape->mBounds.len_y() / 2;
F32 w = mShape->bounds.len_y() / 2;
if (cameraMaxDist < w)
cameraMaxDist = w;
}
Expand Down Expand Up @@ -606,7 +606,7 @@ DefineEngineMethod( ShapeBaseData, checkDeployPos, bool, ( TransformF txfm ),,

MatrixF mat = txfm.getMatrix();

Box3F objBox = object->mShape->mBounds;
Box3F objBox = object->mShape->bounds;
Point3F boxCenter = (objBox.minExtents + objBox.maxExtents) * 0.5f;
objBox.minExtents = boxCenter + (objBox.minExtents - boxCenter) * 0.9f;
objBox.maxExtents = boxCenter + (objBox.maxExtents - boxCenter) * 0.9f;
Expand Down Expand Up @@ -1097,11 +1097,11 @@ bool ShapeBase::onNewDataBlock( GameBaseData *dptr, bool reload )
if (isClientObject())
mShapeInstance->cloneMaterialList();

mObjBox = mDataBlock->mShape->mBounds;
mObjBox = mDataBlock->mShape->bounds;
resetWorldBox();

// Set the initial mesh hidden state.
mMeshHidden.setSize( mDataBlock->mShape->mObjects.size() );
mMeshHidden.setSize( mDataBlock->mShape->objects.size() );
mMeshHidden.clear();

// Initialize the threads
Expand All @@ -1126,8 +1126,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->mSequences[st.sequence];
const String &prevSeqName = prevShape->mNames[prevSeq.nameIndex];
const TSShape::Sequence &prevSeq = prevShape->sequences[st.sequence];
const String &prevSeqName = prevShape->names[prevSeq.nameIndex];

st.sequence = mDataBlock->mShape->findSequence( prevSeqName );

Expand Down Expand Up @@ -2123,7 +2123,7 @@ const char *ShapeBase::getThreadSequenceName( U32 slot )
}

// Name Index
const U32 nameIndex = getShape()->mSequences[st.sequence].nameIndex;
const U32 nameIndex = getShape()->sequences[st.sequence].nameIndex;

// Return Name.
return getShape()->getName( nameIndex );
Expand Down Expand Up @@ -2309,7 +2309,7 @@ void ShapeBase::advanceThreads(F32 dt)
for (U32 i = 0; i < MaxScriptThreads; i++) {
Thread& st = mScriptThread[i];
if (st.thread) {
if (!mShapeInstance->getShape()->mSequences[st.sequence].isCyclic() && !st.atEnd &&
if (!mShapeInstance->getShape()->sequences[st.sequence].isCyclic() && !st.atEnd &&
( ( st.timescale > 0.f )? mShapeInstance->getPos(st.thread) >= 1.0:
mShapeInstance->getPos(st.thread) <= 0)) {
st.atEnd = true;
Expand Down Expand Up @@ -2589,7 +2589,7 @@ void ShapeBase::_renderBoundingBox( ObjectRenderInst *ri, SceneRenderState *stat
MatrixF mat;
getRenderImageTransform( ri->objectIndex, &mat );

const Box3F &objBox = image.shapeInstance[getImageShapeIndex(image)]->getShape()->mBounds;
const Box3F &objBox = image.shapeInstance[getImageShapeIndex(image)]->getShape()->bounds;

drawer->drawCube( desc, objBox, ColorI( 255, 255, 255 ), &mat );
}
Expand Down Expand Up @@ -3277,17 +3277,17 @@ void ShapeBaseConvex::findNodeTransform()
TSShapeInstance* si = pShapeBase->getShapeInstance();
TSShape* shape = si->getShape();

const TSShape::Detail* detail = &shape->mDetails[dl];
const TSShape::Detail* detail = &shape->details[dl];
const S32 subs = detail->subShapeNum;
const S32 start = shape->mSubShapeFirstObject[subs];
const S32 end = start + shape->mSubShapeNumObjects[subs];
const S32 start = shape->subShapeFirstObject[subs];
const S32 end = start + shape->subShapeNumObjects[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->mObjects[i];
const TSShape::Object* obj = &shape->objects[i];
if (obj->numMeshes && detail->objectDetailNum < obj->numMeshes)
{
nodeTransform = &si->mNodeTransforms[obj->nodeIndex];
Expand Down Expand Up @@ -4857,7 +4857,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()->mMaterialList->getMaterialNameList().find_next(String(mapTo));
S32 matIndex = serverObj->getShape()->materialList->getMaterialNameList().find_next(String(mapTo));
if (matIndex < 0)
{
Con::errorf("ShapeBase::changeMaterial failed: Invalid mapTo name '%s'", mapTo);
Expand All @@ -4876,19 +4876,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()->mMaterialList->mMatInstList[matIndex];
serverObj->getShape()->mMaterialList->mMatInstList[matIndex] = newMat->createMatInstance();
delete serverObj->getShape()->materialList->mMatInstList[matIndex];
serverObj->getShape()->materialList->mMatInstList[matIndex] = newMat->createMatInstance();
if (clientObj)
{
delete clientObj->getShape()->mMaterialList->mMatInstList[matIndex];
clientObj->getShape()->mMaterialList->mMatInstList[matIndex] = newMat->createMatInstance();
delete clientObj->getShape()->materialList->mMatInstList[matIndex];
clientObj->getShape()->materialList->mMatInstList[matIndex] = newMat->createMatInstance();
}

// Finish up preparing the material instances for rendering
const GFXVertexFormat *flags = getGFXVertexFormat<GFXVertexPNTTB>();
FeatureSet features = MATMGR->getDefaultFeatures();

serverObj->getShape()->mMaterialList->getMaterialInst(matIndex)->init( features, flags );
serverObj->getShape()->materialList->getMaterialInst(matIndex)->init( features, flags );
if (clientObj)
clientObj->getShapeInstance()->mMaterialList->getMaterialInst(matIndex)->init( features, flags );
}
Expand Down
4 changes: 2 additions & 2 deletions Engine/source/T3D/shapeImage.cpp
Expand Up @@ -497,9 +497,9 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr)
do {
MatrixF nmat;
QuatF q;
TSTransform::setMatrix(shape[i]->mDefaultRotations[node].getQuatF(&q),shape[i]->mDefaultTranslations[node],&nmat);
TSTransform::setMatrix(shape[i]->defaultRotations[node].getQuatF(&q),shape[i]->defaultTranslations[node],&nmat);
total.mul(nmat);
node = shape[i]->mNodes[node].parentIndex;
node = shape[i]->nodes[node].parentIndex;
}
while(node != -1);
total.inverse();
Expand Down