mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
nother set of generic 'object' varnames, all of which referenced different things
This commit is contained in:
parent
fa2ee65d33
commit
bca01fa976
1 changed files with 17 additions and 17 deletions
|
|
@ -3036,25 +3036,25 @@ bool WorldEditor::alignByAxis( S32 axis )
|
||||||
if(mSelected->size() < 2)
|
if(mSelected->size() < 2)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
SceneObject* object = dynamic_cast< SceneObject* >( ( *mSelected )[ 0 ] );
|
SceneObject* primaryObj = dynamic_cast< SceneObject* >( ( *mSelected )[ 0 ] );
|
||||||
if( !object )
|
if( !primaryObj)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
submitUndo( mSelected, "Align By Axis" );
|
submitUndo( mSelected, "Align By Axis" );
|
||||||
|
|
||||||
// All objects will be repositioned to line up with the
|
// All objects will be repositioned to line up with the
|
||||||
// first selected object
|
// first selected object
|
||||||
Point3F pos = object->getPosition();
|
Point3F pos = primaryObj->getPosition();
|
||||||
|
|
||||||
for(S32 i=0; i<mSelected->size(); ++i)
|
for(S32 i=0; i<mSelected->size(); ++i)
|
||||||
{
|
{
|
||||||
SceneObject* object = dynamic_cast< SceneObject* >( ( *mSelected )[ i ] );
|
SceneObject* additionalObj = dynamic_cast< SceneObject* >( ( *mSelected )[ i ] );
|
||||||
if( !object )
|
if( !additionalObj)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Point3F objPos = object->getPosition();
|
Point3F objPos = additionalObj->getPosition();
|
||||||
objPos[axis] = pos[axis];
|
objPos[axis] = pos[axis];
|
||||||
object->setPosition(objPos);
|
additionalObj->setPosition(objPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -4050,8 +4050,8 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c
|
||||||
|
|
||||||
// Create the object.
|
// Create the object.
|
||||||
|
|
||||||
SceneObject* object = dynamic_cast< SceneObject* >( classRep->create() );
|
SceneObject* polyObj = dynamic_cast< SceneObject* >( classRep->create() );
|
||||||
if( !Object )
|
if( !polyObj)
|
||||||
{
|
{
|
||||||
Con::errorf( "WorldEditor::createPolyhedralObject - Could not create SceneObject with class '%s'", className );
|
Con::errorf( "WorldEditor::createPolyhedralObject - Could not create SceneObject with class '%s'", className );
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -4069,7 +4069,7 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c
|
||||||
for( U32 i = 0; i < numPoints; ++ i )
|
for( U32 i = 0; i < numPoints; ++ i )
|
||||||
{
|
{
|
||||||
static StringTableEntry sPoint = StringTable->insert( "point" );
|
static StringTableEntry sPoint = StringTable->insert( "point" );
|
||||||
object->setDataField( sPoint, NULL, EngineMarshallData( points[ i ] ) );
|
polyObj->setDataField( sPoint, NULL, EngineMarshallData( points[ i ] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the plane data.
|
// Add the plane data.
|
||||||
|
|
@ -4085,7 +4085,7 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c
|
||||||
char buffer[ 1024 ];
|
char buffer[ 1024 ];
|
||||||
dSprintf( buffer, sizeof( buffer ), "%g %g %g %g", plane.x, plane.y, plane.z, plane.d );
|
dSprintf( buffer, sizeof( buffer ), "%g %g %g %g", plane.x, plane.y, plane.z, plane.d );
|
||||||
|
|
||||||
object->setDataField( sPlane, NULL, buffer );
|
polyObj->setDataField( sPlane, NULL, buffer );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the edge data.
|
// Add the edge data.
|
||||||
|
|
@ -4104,24 +4104,24 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c
|
||||||
edge.vertex[ 0 ], edge.vertex[ 1 ]
|
edge.vertex[ 0 ], edge.vertex[ 1 ]
|
||||||
);
|
);
|
||||||
|
|
||||||
object->setDataField( sEdge, NULL, buffer );
|
polyObj->setDataField( sEdge, NULL, buffer );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the transform.
|
// Set the transform.
|
||||||
|
|
||||||
object->setTransform( savedTransform );
|
polyObj->setTransform( savedTransform );
|
||||||
object->setScale( savedScale );
|
polyObj->setScale( savedScale );
|
||||||
|
|
||||||
// Register and return the object.
|
// Register and return the object.
|
||||||
|
|
||||||
if( !object->registerObject() )
|
if( !polyObj->registerObject() )
|
||||||
{
|
{
|
||||||
Con::errorf( "WorldEditor::createPolyhedralObject - Failed to register object!" );
|
Con::errorf( "WorldEditor::createPolyhedralObject - Failed to register object!" );
|
||||||
delete object;
|
delete polyObj;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return object;
|
return polyObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue