mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-27 23:35:45 +00:00
Merge pull request #428 from Areloch/ConsolidatedTerrainCreation
Consolidates and standardizes terrain creation between the editor, asset browser and creator panel
This commit is contained in:
commit
578846ab6f
8 changed files with 104 additions and 125 deletions
|
|
@ -117,7 +117,7 @@ DefineEngineStaticMethod( TerrainBlock, createNew, S32, (String terrainName, U32
|
|||
return terrain->getId();
|
||||
}
|
||||
|
||||
DefineEngineStaticMethod( TerrainBlock, import, S32, (String terrainName, String heightMapFile, F32 metersPerPixel, F32 heightScale, String opacityLayerFiles, String materialsStr, bool flipYAxis), (true),
|
||||
DefineEngineStaticMethod( TerrainBlock, import, S32, (S32 terrainObjectId, String heightMapFile, F32 metersPerPixel, F32 heightScale, String opacityLayerFiles, String materialsStr, bool flipYAxis), (true),
|
||||
"" )
|
||||
{
|
||||
// First load the height map and validate it.
|
||||
|
|
@ -237,13 +237,12 @@ DefineEngineStaticMethod( TerrainBlock, import, S32, (String terrainName, String
|
|||
}
|
||||
|
||||
// Do we have an existing terrain with that name... then update it!
|
||||
TerrainBlock *terrain = dynamic_cast<TerrainBlock*>( Sim::findObject( terrainName.c_str() ) );
|
||||
TerrainBlock *terrain = dynamic_cast<TerrainBlock*>( Sim::findObject( terrainObjectId ) );
|
||||
if ( terrain )
|
||||
terrain->import( (*heightmap), heightScale, metersPerPixel, layerMap, materials, flipYAxis );
|
||||
else
|
||||
{
|
||||
terrain = new TerrainBlock();
|
||||
terrain->assignName( terrainName );
|
||||
terrain->import( (*heightmap), heightScale, metersPerPixel, layerMap, materials, flipYAxis );
|
||||
terrain->registerObject();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue