mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Merge pull request #687 from eightyeight/procedural-terrain-coverage
Add coverage option to procedural terrain generator
This commit is contained in:
commit
a90be04041
4 changed files with 170 additions and 10 deletions
|
|
@ -2870,7 +2870,7 @@ ConsoleMethod( TerrainEditor, setSlopeLimitMaxAngle, F32, 3, 3, 0)
|
|||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void TerrainEditor::autoMaterialLayer( F32 mMinHeight, F32 mMaxHeight, F32 mMinSlope, F32 mMaxSlope )
|
||||
void TerrainEditor::autoMaterialLayer( F32 mMinHeight, F32 mMaxHeight, F32 mMinSlope, F32 mMaxSlope, F32 mCoverage )
|
||||
{
|
||||
if (!mActiveTerrain)
|
||||
return;
|
||||
|
|
@ -2896,6 +2896,9 @@ void TerrainEditor::autoMaterialLayer( F32 mMinHeight, F32 mMaxHeight, F32 mMinS
|
|||
|
||||
if (gi.mMaterial == mat)
|
||||
continue;
|
||||
|
||||
if (mRandI(0, 100) > mCoverage)
|
||||
continue;
|
||||
|
||||
Point3F wp;
|
||||
gridToWorld(gp, wp);
|
||||
|
|
@ -2935,7 +2938,7 @@ void TerrainEditor::autoMaterialLayer( F32 mMinHeight, F32 mMaxHeight, F32 mMinS
|
|||
scheduleMaterialUpdate();
|
||||
}
|
||||
|
||||
ConsoleMethod( TerrainEditor, autoMaterialLayer, void, 6, 6, "(float minHeight, float maxHeight, float minSlope, float maxSlope)")
|
||||
ConsoleMethod( TerrainEditor, autoMaterialLayer, void, 7, 7, "(float minHeight, float maxHeight, float minSlope, float maxSlope, float coverage)")
|
||||
{
|
||||
object->autoMaterialLayer( dAtof(argv[2]), dAtof(argv[3]), dAtof(argv[4]), dAtof(argv[5]) );
|
||||
object->autoMaterialLayer( dAtof(argv[2]), dAtof(argv[3]), dAtof(argv[4]), dAtof(argv[5]), dAtof(argv[6]));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ class TerrainEditor : public EditTSCtrl
|
|||
void submitMaterialUndo( String actionName );
|
||||
void onMaterialUndo( TerrainBlock *terr );
|
||||
|
||||
void autoMaterialLayer( F32 mMinHeight, F32 mMaxHeight, F32 mMinSlope, F32 mMaxSlope );
|
||||
void autoMaterialLayer( F32 mMinHeight, F32 mMaxHeight, F32 mMinSlope, F32 mMaxSlope, F32 mCoverage );
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue