kd

package
v0.0.0-...-28575ab Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityLocation

type EntityLocation struct {
	common.Vec2f
	Heading float64
	Entity  ecs.Entity
}

func (EntityLocation) Compare

Compare returns the signed distance of p from the plane passing through c and perpendicular to the dimension d. The concrete type of c must be EntityLocation.

func (EntityLocation) Dims

func (p EntityLocation) Dims() int

Dims returns the number of dimensions described by the receiver.

func (EntityLocation) Distance

func (p EntityLocation) Distance(c kdtree.Comparable) float64

Distance returns the squared Euclidean distance between c and the receiver. The concrete type of c must be EntityLocation.

type EntityLocations

type EntityLocations []EntityLocation

func (EntityLocations) Index

func (p EntityLocations) Index(i int) kdtree.Comparable

func (EntityLocations) Len

func (p EntityLocations) Len() int

func (EntityLocations) Pivot

func (p EntityLocations) Pivot(d kdtree.Dim) int

func (EntityLocations) Slice

func (p EntityLocations) Slice(start, end int) kdtree.Interface

type NDistKeeper

type NDistKeeper struct {
	kdtree.Heap
}

NDistKeeper keeps man number and distance

func NewNDistKeeper

func NewNDistKeeper(n int, d float64) *NDistKeeper

NewNDistKeeper returns an NDistKeeper with the maximum value of the heap set to d.

func (*NDistKeeper) Keep

func (k *NDistKeeper) Keep(c kdtree.ComparableDist)

Keep adds c to the heap if its distance is less than or equal to the max value of the heap.

Jump to

Keyboard shortcuts

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