noise

package
v0.0.0-...-17a2a95 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Noise

type Noise struct {
	Octaves     int
	Persistence float64
	Amplitudes  []float64
	Seed        int64
	OS          opensimplex.Noise
}

Noise is a wrapper for opensimplex.Noise, initialized with a given seed, persistence, and number of octaves.

func NewNoise

func NewNoise(octaves int, persistence float64, seed int64) *Noise

NewNoise returns a new Noise.

func ReadNoise

func ReadNoise(r io.Reader) (*Noise, error)

func (*Noise) Eval2

func (n *Noise) Eval2(x, y float64) float64

Eval2 returns the noise value at the given point.

func (*Noise) Eval3

func (n *Noise) Eval3(x, y, z float64) float64

Eval3 returns the noise value at the given point.

func (*Noise) PlusOneOctave

func (n *Noise) PlusOneOctave() *Noise

PlusOneOctave returns a new Noise with one more octave.

func (*Noise) WriteTo

func (n *Noise) WriteTo(w io.Writer) error

Jump to

Keyboard shortcuts

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