wgrandom

package
v0.0.0-...-2b27d95 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SEED_CONTINENTALNESS = iota
	SEED_EROSION
	SEED_TEMPERATURE
	SEED_HUMIDITY
	SEED_DENSITY
	SEED_WEIRDNESS
	SEED_SURFACE
)
View Source
const ALPHA = 2.0
View Source
const BETA = 2.0
View Source
const DEPTH_HEIGHT_SCALE = 43
View Source
const DEPTH_SCALE = 50
View Source
const ITERATIONS int32 = 1
View Source
const OVERWORLD_HEIGHT_SCALE = 85.5515
View Source
const OVERWORLD_SCALE = 171.103
View Source
const SURFACE_SCALE = 2.138

Variables

View Source
var ContinentalSpline = gospline.NewMonotoneSpline(
	[]float64{-1, -0.9, -0.47, -0.43, -0.19, -0.034, 0, 0.03, 1},
	[]float64{1, 0.1, 0.03, 0.3, 0.41, 0.9, 0.9, 0.93, 0.98},
)
View Source
var ErosionSpline = gospline.NewMonotoneSpline(
	[]float64{-1, -0.93, -0.76, -0.32, -0.12, 0.3, 0.5, 0.53, 0.67, 0.72, 1},
	[]float64{1, 0.75, 0.24, 0.26, 0.13, 0.11, 0.08, 0.12, 0.13, 0.06, 0},
)
View Source
var PVSpline = gospline.NewMonotoneSpline(
	[]float64{-1, -0.9, -0.85, 0, 0.4, 1},
	[]float64{0, 0.3, 0.53, 0.61, 0.9, 0.9},
)

Functions

func PeaksValleys

func PeaksValleys(Weirdness float64) float64

Types

type Chance

type Chance float64

func NewChance

func NewChance(Numerator, Denominator float64) Chance

func (Chance) Eval

func (c Chance) Eval(R *rand.Rand) bool

type WGRandom

type WGRandom struct {
	Seed int64

	Continentalness *perlin.Perlin
	Erosion         *perlin.Perlin

	Temperature *perlin.Perlin
	Humidity    *perlin.Perlin

	Density   *perlin.Perlin
	Weirdness *perlin.Perlin

	Surface *perlin.Perlin
}

func New

func New(Seed int64) *WGRandom

Jump to

Keyboard shortcuts

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