Documentation ¶
Overview ¶
Package octree provides parallelizable functions for a linear octree.
Interleaved values are given as a morton encoding, also known as Z ordering. This is given by spacing the bits out of a uint by two bits. Naturally sorting the resulting uints provides locality and can be searched with common methods such as binary search.
Index ¶
- func Children16(n uint64) (a, b, c, d, e, f, g, h uint64)
- func Deinterleave16(a uint64) (x, y, z, w uint16)
- func Deinterleave8(a uint32) (x, y, z, w uint8)
- func Dilate16(x uint16) uint64
- func Dilate8(x uint8) uint32
- func Interleave16(x, y, z, w uint16) uint64
- func Interleave8(x, y, z, w uint8) uint32
- func SortU32s(a []uint32)
- func SortU64s(a []uint64)
- func Subdivide16(u uint64, lvl int, p *[]uint64)
- func Undilate16(x uint64) uint16
- func Undilate8(x uint32) uint8
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Children16 ¶
Children16 assumes n is a node in a point-based tree and subdivides n into eight equal spaces.
func Deinterleave16 ¶
Deinterleave16 deinterleaves a uint64 into four uint16s.
func Deinterleave8 ¶
Deinterleave8 deinterleaves a uint32 into four uint16s.
func Interleave16 ¶
Interleave16 returns x, y, z interleaved and w occupying the least significant bits.
func Interleave8 ¶
Interleave8 returns x, y, z interleaved and w occupying the least significant bits.
func SortU32s ¶
func SortU32s(a []uint32)
SortU32s is a convenience method for sorting a slice of uint32s.
func SortU64s ¶
func SortU64s(a []uint64)
SortU64s is a convenience method for sorting a slice of uint64s.
func Subdivide16 ¶
Subdivide16 treats u as a node in a point tree and recursively subdivides u up to lvl, collecting results at lvl into p.
func Undilate16 ¶
Undilate16 constricts the bits of a uint64 removing two bits starting with the least significant bit and every third bit there-after.
Types ¶
This section is empty.