pkg

package
v0.0.0-...-997a9c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateNormal

func CalculateNormal(x, y int, hm HeightMap, length float64) mgl64.Vec3

Types

type HeightMap

type HeightMap [][]float64

func NewHeightMap

func NewHeightMap(size int) HeightMap

func NewPerlinMap

func NewPerlinMap(size, scale int) HeightMap

func (HeightMap) At

func (hm HeightMap) At(x int, y int) color.Color

At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.

func (HeightMap) Bounds

func (hm HeightMap) Bounds() image.Rectangle

Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0).

func (HeightMap) ColorModel

func (hm HeightMap) ColorModel() color.Model

ColorModel returns the Image's color model.

func (HeightMap) Get

func (hm HeightMap) Get(x, y int) float64

func (*HeightMap) Set

func (hm *HeightMap) Set(x, y int, val float64)

func (HeightMap) Truncate

func (hm HeightMap) Truncate() []float64

type NormalMap

type NormalMap [][]mgl64.Vec3

func NewNormalMap

func NewNormalMap(hm HeightMap, length float64) NormalMap

func (NormalMap) At

func (nm NormalMap) At(x int, y int) color.Color

At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.

func (NormalMap) Bounds

func (nm NormalMap) Bounds() image.Rectangle

Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0).

func (NormalMap) ColorModel

func (nm NormalMap) ColorModel() color.Model

ColorModel returns the Image's color model.

func (NormalMap) Truncate

func (nm NormalMap) Truncate() []mgl64.Vec3

type Particle

type Particle struct {
	Stopped bool
	// contains filtered or unexported fields
}

func NewParticle

func NewParticle(pos, vel mgl32.Vec2, vol, sed, den float32) *Particle

func (*Particle) Drop

func (p *Particle) Drop(hm *HeightMap, dt, friction, depositionRate, evaporationRate float32)

func (Particle) GetPosition

func (p Particle) GetPosition() mgl32.Vec2

func (Particle) X

func (p Particle) X() float32

func (Particle) Y

func (p Particle) Y() float32

type RainSim

type RainSim []*Particle

func (*RainSim) Update

func (rs *RainSim) Update(hm *HeightMap, dirty bool) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL