Documentation ¶
Index ¶
- Constants
- type Edge
- type Extent
- type Heightmap
- func (h *Heightmap) Add(hms ...*Heightmap)
- func (h *Heightmap) Diff(hms *Heightmap) *Heightmap
- func (h *Heightmap) Downhill() []int
- func (h *Heightmap) ExportOBJ(path string) error
- func (h *Heightmap) Len() int
- func (h *Heightmap) MapF(f func(float64) float64) *Heightmap
- func (h *Heightmap) MapFIdx(f func(val float64) float64) *Heightmap
- func (h *Heightmap) MinMax() (min, max float64)
- func (h *Heightmap) TriSlope(i int) [2]float64
- type Mesh
- func (m *Mesh) ApplyGen(f genheightmap.GenFunc) *Heightmap
- func (m *Mesh) Distance(i, j int) float64
- func (m *Mesh) IsEdge(i int) bool
- func (m *Mesh) IsNearEdge(i int) bool
- func (m *Mesh) MapF(f func(v voronoi.Vertex) float64) *Heightmap
- func (m *Mesh) Neighbours(vxIdx int) []int
- func (m *Mesh) Triangulate() (*delaunay.Triangulation, error)
Constants ¶
View Source
const ( VertexOutOfBounds = -2 VertexSink = -1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Heightmap ¶
func NewHeightmap ¶
type Mesh ¶
type Mesh struct { Points []voronoi.Vertex // Points used to generate the voronoi diagram Voronoi *voronoi.Diagram // Voronoi diagram Vertices []voronoi.Vertex // Vertex points sourrounding a cell AdjacentVxs map[int][]int // Vertex index to adjacent vertices VertexTris map[int][]*voronoi.Cell // Vertex index to bordering cells (triangles) Edges []Edge // Edges in voronoi diagram Extent *Extent }
func GenerateGoodMesh ¶
func (*Mesh) IsNearEdge ¶
func (*Mesh) Neighbours ¶
func (*Mesh) Triangulate ¶
func (m *Mesh) Triangulate() (*delaunay.Triangulation, error)
Click to show internal directories.
Click to hide internal directories.