- data Octree a
- data Vector3 = Vector3 {}
- dist :: Vector v => v -> v -> Scalar
- fromList :: [(Vector3, a)] -> Octree a
- toList :: Octree t -> [(Vector3, t)]
- lookup :: Octree a -> Vector3 -> Maybe (Vector3, a)
- insert :: (Vector3, a) -> Octree a -> Octree a
- nearest :: Octree a -> Vector3 -> Maybe (Vector3, a)
- withinRange :: Scalar -> Vector3 -> Octree a -> [(Vector3, a)]

# Documentation

data Vector3

fromList :: [(Vector3, a)] -> Octree aSource

Creates an Octree from a list of (index, payload) tuples.

toList :: Octree t -> [(Vector3, t)]Source

Creates an Octree from list, trying to keep split points near centers | of mass for each subtree.

insert :: (Vector3, a) -> Octree a -> Octree aSource

Inserts a point into an Octree. | NOTE: insert accepts duplicate points, but lookup would not find them - use withinRange in such case.