nav

package
v0.0.0-...-20810c9 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	Start int
	End   int
	Cost  int
	Types uint64
	Size  float32
}

type Mesh

type Mesh[V any] struct {
	Nodes ds.SparseList[Node[V]]
	Edges ds.SparseList[Edge]
}

func (Mesh[V]) FindPath

func (m Mesh[V]) FindPath(start V, end V, match util.Match[uint64]) Path

type Node

type Node[V any] struct {
	Shape Shape[V]
	Cost  int
	Types uint64
	Size  float32
	Edges []int
}

type Path

type Path struct {
	Edges []int
	Cost  int
}

type Shape

type Shape[V any] interface {
	Distance(shape Shape[V]) ShapeDistance
}

type ShapeDistance

type ShapeDistance struct {
	Min float32
	Max float32
}

func (ShapeDistance) InIntersecting

func (sr ShapeDistance) InIntersecting() bool

func (ShapeDistance) IsInside

func (sr ShapeDistance) IsInside() bool

func (ShapeDistance) IsOutside

func (sr ShapeDistance) IsOutside() bool

type Space

type Space[V any] interface {
	Add(node Node[V])
	Knn(shape Shape[V], out []SpaceKnn[V])
	Relative(shape Shape[V], dist ShapeDistance, listener SpaceListener[V])
}

type SpaceKnn

type SpaceKnn[V any] struct {
	Node     Node[V]
	Distance float32
	Near     bool
}

type SpaceListener

type SpaceListener[V any] func(shape Shape[V], dist ShapeDistance) bool

Jump to

Keyboard shortcuts

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