bounds to mBounds conflict avoidance

This commit is contained in:
Azaezel 2018-03-13 01:05:15 -05:00
parent f08339c534
commit 242a51eefe
22 changed files with 50 additions and 50 deletions

View file

@ -254,8 +254,8 @@ void MeshComponent::updateShape()
mOwner->getWorldToObj().mulP(pos);
min = mMeshAsset->getShape()->bounds.minExtents;
max = mMeshAsset->getShape()->bounds.maxExtents;
min = mMeshAsset->getShape()->mBounds.minExtents;
max = mMeshAsset->getShape()->mBounds.maxExtents;
if (mInterfaceData)
{

View file

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

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

@ -358,7 +358,7 @@ bool PhysicsDebris::onAdd()
}
// Setup our bounding box
mObjBox = mDataBlock->shape->bounds;
mObjBox = mDataBlock->shape->mBounds;
resetWorldBox();
// Add it to the client scene.

View file

@ -308,10 +308,10 @@ bool PhysicsShapeData::preload( bool server, String &errorBuffer )
{
//no collision so we create a simple box collision shape from the shapes bounds and alert the user
Con::warnf( "PhysicsShapeData::preload - No collision found for shape '%s', auto-creating one", shapeName );
Point3F halfWidth = shape->bounds.getExtents() * 0.5f;
Point3F halfWidth = shape->mBounds.getExtents() * 0.5f;
colShape = PHYSICSMGR->createCollision();
MatrixF centerXfm(true);
centerXfm.setPosition(shape->bounds.getCenter());
centerXfm.setPosition(shape->mBounds.getCenter());
colShape->addBox(halfWidth, centerXfm);
return true;
}
@ -707,7 +707,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

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

@ -405,17 +405,17 @@ 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()))
{
if (!silent_bbox_check)
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)
{
if (!silent_bbox_check)
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
@ -482,7 +482,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;
// just parse up the string and collect the remappings in txr_tag_remappings.
@ -707,7 +707,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;
@ -1275,7 +1275,7 @@ bool ShapeBase::onNewDataBlock( GameBaseData *dptr, bool reload )
}
}
mObjBox = mDataBlock->mShape->bounds;
mObjBox = mDataBlock->mShape->mBounds;
resetWorldBox();
// Set the initial mesh hidden state.
@ -2801,7 +2801,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 );
}

View file

@ -373,7 +373,7 @@ bool TSStatic::_createShape()
NetConnection::filesWereDownloaded() )
return false;
mObjBox = mShape->bounds;
mObjBox = mShape->mBounds;
resetWorldBox();
mShapeInstance = new TSShapeInstance( mShape, isClientObject() );

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;

View file

@ -1116,7 +1116,7 @@ bool afxMagicMissile::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));
resetWorldBox();

View file

@ -397,7 +397,7 @@ bool afxModel::onAdd()
// setup our bounding box
if (mDataBlock->shape)
mObjBox = mDataBlock->shape->bounds;
mObjBox = mDataBlock->shape->mBounds;
else
mObjBox = Box3F(Point3F(-1, -1, -1), Point3F(1, 1, 1));

View file

@ -347,7 +347,7 @@ bool VolumetricFog::LoadShape()
return false;
}
mObjBox = mShape->bounds;
mObjBox = mShape->mBounds;
mRadius = mShape->radius;
resetWorldBox();
@ -560,7 +560,7 @@ U32 VolumetricFog::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
mShape = ResourceManager::get().load(mShapeName);
if (bool(mShape) == false)
return retMask;
mObjBox = mShape->bounds;
mObjBox = mShape->mBounds;
mRadius = mShape->radius;
resetWorldBox();
mObjSize = mWorldBox.getGreatestDiagonalLength();

View file

@ -88,7 +88,7 @@ public:
const Vector<S32>& getLOSDetails() const { return mLOSDetails; }
// ForestItemData
const Box3F& getObjBox() const { return mShape ? mShape->bounds : Box3F::Zero; }
const Box3F& getObjBox() const { return mShape ? mShape->mBounds : Box3F::Zero; }
bool render( TSRenderState *rdata, const ForestItem& item ) const;
ForestCellBatch* allocateBatch() const;
bool canBillboard( const SceneRenderState *state, const ForestItem &item, F32 distToCamera ) const;

View file

@ -853,7 +853,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;
@ -1138,8 +1138,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)
{
@ -1442,7 +1442,7 @@ 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;
@ -1544,7 +1544,7 @@ void GuiShapeEdPreview::renderSunDirection() const
{
// Render four arrows aiming in the direction of the sun's light
ColorI color = LinearColorF( mFakeSun->getColor()).toColorI();
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();

View file

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

View file

@ -1220,12 +1220,12 @@ void TSShapeLoader::install()
}
}
computeBounds(shape->bounds);
if (!shape->bounds.isValidBox())
shape->bounds = Box3F(1.0f);
computeBounds(shape->mBounds);
if (!shape->mBounds.isValidBox())
shape->mBounds = Box3F(1.0f);
shape->bounds.getCenter(&shape->center);
shape->radius = (shape->bounds.maxExtents - shape->center).len();
shape->mBounds.getCenter(&shape->center);
shape->radius = (shape->mBounds.maxExtents - shape->center).len();
shape->tubeRadius = shape->radius;
shape->init();

View file

@ -414,7 +414,7 @@ void TSShapeInstance::computeBounds(S32 dl, Box3F & bounds)
// use shape bounds for imposter details
if (ss < 0)
{
bounds = mShape->bounds;
bounds = mShape->mBounds;
return;
}

View file

@ -1198,7 +1198,7 @@ void TSShape::assembleShape()
tsalloc.get32((S32*)&radius,1);
tsalloc.get32((S32*)&tubeRadius,1);
tsalloc.get32((S32*)&center,3);
tsalloc.get32((S32*)&bounds,6);
tsalloc.get32((S32*)&mBounds,6);
tsalloc.checkGuard();
@ -1673,7 +1673,7 @@ void TSShape::disassembleShape()
tsalloc.copyToBuffer32((S32*)&radius,1);
tsalloc.copyToBuffer32((S32*)&tubeRadius,1);
tsalloc.copyToBuffer32((S32*)&center,3);
tsalloc.copyToBuffer32((S32*)&bounds,6);
tsalloc.copyToBuffer32((S32*)&mBounds,6);
tsalloc.setGuard();
@ -2063,8 +2063,8 @@ void TSShape::createEmptyShape()
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);
mBounds.minExtents.set(-0.5f, 0.0f, -0.5f);
mBounds.maxExtents.set(0.5f, 1.0f, 0.5f);
mExporterVersion = 124;
mSmallestVisibleSize = 2;

View file

@ -357,7 +357,7 @@ class TSShape
F32 radius;
F32 tubeRadius;
Point3F center;
Box3F bounds;
Box3F mBounds;
/// @}

View file

@ -1445,7 +1445,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 ),,
@ -1457,9 +1457,9 @@ 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->mBounds = bbox;
shape->mBounds.getCenter( &shape->center );
shape->radius = ( shape->mBounds.maxExtents - shape->center ).len();
shape->tubeRadius = shape->radius;
ADD_TO_CHANGE_SET();
@ -2200,12 +2200,12 @@ void TSShapeConstructor::ChangeSet::write(TSShape* shape, Stream& stream, const
for (U32 j = 1; j < cmd.argc; j++)
{
// Use relative paths when possible
String str( cmd.argv[j] );
if ( str.startsWith( savePath ) )
str = str.substr( savePath.length() + 1 );
String relStr( cmd.argv[j] );
if (relStr.startsWith( savePath ) )
relStr = relStr.substr( savePath.length() + 1 );
stream.writeText( ", \"" );
stream.write( str.length(), str.c_str() );
stream.write(relStr.length(), relStr.c_str() );
stream.writeText( "\"" );
}
}