trees

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: MIT Imports: 3 Imported by: 0

README

Trees

Package dedicated to different trees used for spatially organizing 3D elements for aiding lookups in other packages in this repository like rendering and marching.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OctreeDepthFromCount

func OctreeDepthFromCount(count int) int

Types

type Element

type Element interface {
	BoundingBox() geometry.AABB
	ClosestPoint(p vector3.Float64) vector3.Float64
}

type KDTree

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

func NewKDTreeWithDepth

func NewKDTreeWithDepth(elements []Element, maxDepth int) *KDTree

func (KDTree) BoundingBox

func (kdt KDTree) BoundingBox() geometry.AABB

type OctTree

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

func NewOctree

func NewOctree(elements []Element) *OctTree

func NewOctreeWithDepth

func NewOctreeWithDepth(elements []Element, maxDepth int) *OctTree

func (OctTree) BoundingBox

func (ot OctTree) BoundingBox() geometry.AABB

func (OctTree) ClosestPoint

func (ot OctTree) ClosestPoint(v vector3.Float64) (int, vector3.Float64)

func (OctTree) ElementsContainingPoint

func (ot OctTree) ElementsContainingPoint(v vector3.Float64) []int

func (*OctTree) ElementsIntersectingRay

func (ot *OctTree) ElementsIntersectingRay(ray geometry.Ray, min, max float64) []int

type Tree

type Tree interface {
	ElementsContainingPoint(v vector3.Float64) []int
	ClosestPoint(v vector3.Float64) (int, vector3.Float64)
	ElementsIntersectingRay(ray geometry.Ray, min, max float64) []int
	BoundingBox() geometry.AABB
}

Jump to

Keyboard shortcuts

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