mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
simplify erosion calcs
This commit is contained in:
parent
e106871350
commit
f9eeaf8869
2 changed files with 20 additions and 76 deletions
|
|
@ -307,48 +307,23 @@ class ThermalErosionAction : public TerrainAction
|
|||
{
|
||||
public:
|
||||
ThermalErosionAction(TerrainEditor * editor)
|
||||
: TerrainAction(editor),
|
||||
mNoiseSize(256)
|
||||
: TerrainAction(editor)
|
||||
{
|
||||
mNoise.setSeed( 1 );//Sim::getCurrentTime() );
|
||||
mNoiseData.setSize(mNoiseSize * mNoiseSize);
|
||||
mNoise.fBm(&mNoiseData, mNoiseSize, 12, 1.0f, 5.0f);
|
||||
mNoise.getMinMax(&mNoiseData, &mMinMaxNoise.x, &mMinMaxNoise.y, mNoiseSize);
|
||||
mScale = 1.5f / (mMinMaxNoise.x - mMinMaxNoise.y);
|
||||
}
|
||||
|
||||
}
|
||||
StringTableEntry getName(){return("thermalErode");}
|
||||
|
||||
void process(Selection * sel, const Gui3DMouseEvent & event, bool selChanged, Type type);
|
||||
|
||||
const U32 mNoiseSize;
|
||||
Noise2D mNoise;
|
||||
Vector<F32> mNoiseData;
|
||||
Point2F mMinMaxNoise;
|
||||
F32 mScale;
|
||||
};
|
||||
|
||||
class HydraulicErosionAction : public TerrainAction
|
||||
{
|
||||
public:
|
||||
HydraulicErosionAction(TerrainEditor* editor)
|
||||
: TerrainAction(editor),
|
||||
mNoiseSize(256)
|
||||
: TerrainAction(editor)
|
||||
{
|
||||
mNoise.setSeed(1);//Sim::getCurrentTime() );
|
||||
mNoiseData.setSize(mNoiseSize * mNoiseSize);
|
||||
mNoise.fBm(&mNoiseData, mNoiseSize, 12, 1.0f, 5.0f);
|
||||
mNoise.getMinMax(&mNoiseData, &mMinMaxNoise.x, &mMinMaxNoise.y, mNoiseSize);
|
||||
mScale = 1.5f / (mMinMaxNoise.x - mMinMaxNoise.y);
|
||||
}
|
||||
|
||||
StringTableEntry getName() { return("hydraulicErode"); }
|
||||
void process(Selection* sel, const Gui3DMouseEvent& event, bool selChanged, Type type);
|
||||
const U32 mNoiseSize;
|
||||
Noise2D mNoise;
|
||||
Vector<F32> mNoiseData;
|
||||
Point2F mMinMaxNoise;
|
||||
F32 mScale;
|
||||
};
|
||||
|
||||
class TerrainScratchPad
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue