genmapvoronoi

package
v0.0.0-...-ce97658 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

README

genmapvoronoi

Map generator based on mewo2.com/notes/terrain/ :)

image: alt text

Documentation

Overview

Package genmapvoronoi is based on https://mewo2.com/notes/terrain/.

Index

Constants

This section is empty.

Variables

View Source
var DefaultExtent = &Extent{
	Width:  1,
	Height: 1,
}
View Source
var DefaultParams = &Params{
	Extent:         DefaultExtent,
	NumPoints:      16384,
	NumCities:      15,
	NumTerritories: 5,
	RiverThreshold: 0.005,
}

Functions

func HeightCleanCoast

func HeightCleanCoast(h *vmesh.Heightmap, iters int) *vmesh.Heightmap

func HeightFillSinks

func HeightFillSinks(h *vmesh.Heightmap) *vmesh.Heightmap

func HeightNormalize

func HeightNormalize(h *vmesh.Heightmap) *vmesh.Heightmap

func HeightPeaky

func HeightPeaky(h *vmesh.Heightmap) *vmesh.Heightmap

func HeightRelax

func HeightRelax(h *vmesh.Heightmap) *vmesh.Heightmap

func HeightSetSeaLevel

func HeightSetSeaLevel(h *vmesh.Heightmap, q float64) *vmesh.Heightmap

func MeshCone

func MeshCone(m *vmesh.Mesh, slope float64) *vmesh.Heightmap

func MeshHills

func MeshHills(m *vmesh.Mesh, n int, r float64) *vmesh.Heightmap

func MeshMountains

func MeshMountains(m *vmesh.Mesh, n int, r float64) *vmesh.Heightmap

func MeshNoise

func MeshNoise(m *vmesh.Mesh, slope float64) *vmesh.Heightmap

func MeshRidges

func MeshRidges(m *vmesh.Mesh, direction vectors.Vec2) *vmesh.Heightmap

func MeshSlope

func MeshSlope(m *vmesh.Mesh, direction vectors.Vec2) *vmesh.Heightmap

func MeshVolCone

func MeshVolCone(m *vmesh.Mesh, slope float64) *vmesh.Heightmap

Types

type Extent

type Extent struct {
	Width  float64
	Height float64
}

type Item

type Item struct {
	// contains filtered or unexported fields
}

An Item is something we manage in a priority queue.

type Params

type Params struct {
	Extent         *Extent
	NumPoints      int
	NumCities      int
	NumTerritories int
	RiverThreshold float64
}

type PriorityQueue

type PriorityQueue []*queueEntry

A PriorityQueue implements heap.Interface and holds Items.

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() interface{}

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x interface{})

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

type Terrain

type Terrain struct {
	// contains filtered or unexported fields
}

func NewTerrain

func NewTerrain(params *Params) *Terrain

func (*Terrain) ExportOBJ

func (r *Terrain) ExportOBJ(path string) error

ExportOBJ returns a Wavefront OBJ file representing the heightmap.

func (*Terrain) ExportSVG

func (r *Terrain) ExportSVG(path string) error

ExportSVG exports the terrain as SVG to the given path.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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