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

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