mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
work towards adding erosion noise
This commit is contained in:
parent
2eb2cbc302
commit
329ffab86c
2 changed files with 71 additions and 37 deletions
|
|
@ -307,18 +307,31 @@ class ThermalErosionAction : public TerrainAction
|
|||
{
|
||||
public:
|
||||
ThermalErosionAction(TerrainEditor * editor)
|
||||
: TerrainAction(editor)
|
||||
: TerrainAction(editor),
|
||||
mNoiseSize(256)
|
||||
{
|
||||
mNoise.setSeed( 1 );//Sim::getCurrentTime() );
|
||||
mNoiseData.setSize(mNoiseSize * mNoiseSize);
|
||||
mTerrainHeights.setSize(mNoiseSize * mNoiseSize);
|
||||
mNoise.fBm(&mNoiseData, mNoiseSize, 12, 1.0f, 5.0f);
|
||||
//Vector<F32> scratch = mNoiseData;
|
||||
//mNoise.rigidMultiFractal( &mNoiseData, &scratch, TerrainBlock::BlockSize, 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;
|
||||
Vector<F32> mTerrainHeights;
|
||||
Point2F mMinMaxNoise;
|
||||
Point2I mSelectionOrigin;
|
||||
F32 mScale;
|
||||
};
|
||||
|
||||
class HydraulicErosionAction : public TerrainAction
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue