Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // Scale is used as a multiplier for determining the surface normal at any given point. Increasing this value would cause a raindrop to move a farther distance, whereas decreasing it would cause it to move a shorter distance. This is because the scale directly affects the speed of the raindrop. Acceleration = force / mass, and this variable determines the force in that equation. Scale float64 // Density is used to calculate the acceleration of the raindrop as it flows across the heightmap. Acceleration = force / mass, and mass is calculated by volume * density. Therefore, increasing the density causes the raindrop to accelerate more slowly. Density float64 // Friction is a multiplier which effects the speed of the raindrop after it moves across a surface. Higher friction means lower speeds. Friction float64 // Deposition rate is a multiplier which controls how much sediment is deposited to the terrain. DepositionRate float64 // Evaporation rate is how many times the raindrop can move to a new position before it is terminated. By default, this number is set to the 1 / the length of the X axis. EvaporationRate float64 // The seed of randomness in each raindrop. RaindropRandomSeed int64 }
func DefaultOptions ¶
func DefaultOptions() *Options
DefaultOptions returns default simulation options
type Rainfall ¶
type Rainfall struct { // Terrain is a 2D array height map in range -1.0~1.0 Terrain [][]float64 Opt *Options // contains filtered or unexported fields }
func NewFromImage ¶
NewFromImage returns new Rainfall from image.Image
func NewFromImageFile ¶
NewFromImageFile returns new Rainfall from image file
func (*Rainfall) WriteToImageFile ¶
WriteToImageFile writes terrain to image file
Click to show internal directories.
Click to hide internal directories.