bvh

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TouchBound

func TouchBound[B interface{ Touch(B) bool }](other B) func(bound B) bool

func TouchPoint

func TouchPoint[Vec any, B interface{ WithIn(Vec) bool }](point Vec) func(bound B) bool

Types

type AABB

type AABB[I constraints.Signed | constraints.Float, V interface {
	Add(V) V
	Sub(V) V
	Max(V) V
	Min(V) V
	Less(V) bool
	More(V) bool
	Sum() I
}] struct{ Upper, Lower V }

func (AABB[I, V]) Surface

func (aabb AABB[I, V]) Surface() I

func (AABB[I, V]) Touch

func (aabb AABB[I, V]) Touch(other AABB[I, V]) bool

func (AABB[I, V]) Union

func (aabb AABB[I, V]) Union(other AABB[I, V]) AABB[I, V]

func (AABB[I, V]) WithIn

func (aabb AABB[I, V]) WithIn(point V) bool

type Node

type Node[I constraints.Float, B interface {
	Union(B) B
	Surface() I
}, V any] struct {
	Box   B
	Value V
	// contains filtered or unexported fields
}

func (*Node[I, B, V]) String

func (n *Node[I, B, V]) String() string

type Sphere

type Sphere[I constraints.Float, V interface {
	Add(V) V
	Sub(V) V
	Mul(I) V
	Max(V) V
	Min(V) V
	Less(V) bool
	More(V) bool
	Norm() I
	Sum() I
}] struct {
	Center V
	R      I
}

func (Sphere[I, V]) Surface

func (s Sphere[I, V]) Surface() I

func (Sphere[I, V]) Touch

func (s Sphere[I, V]) Touch(other Sphere[I, V]) bool

func (Sphere[I, V]) Union

func (s Sphere[I, V]) Union(other Sphere[I, V]) Sphere[I, V]

func (Sphere[I, V]) WithIn

func (s Sphere[I, V]) WithIn(point V) bool

type Tree

type Tree[I constraints.Float, B interface {
	Union(B) B
	Surface() I
}, V any] struct {
	// contains filtered or unexported fields
}

func (*Tree[I, B, V]) Delete

func (t *Tree[I, B, V]) Delete(n *Node[I, B, V]) any

func (*Tree[I, B, V]) Find

func (t *Tree[I, B, V]) Find(test func(bound B) bool, foreach func(n *Node[I, B, V]) bool)

func (*Tree[I, B, V]) Insert

func (t *Tree[I, B, V]) Insert(leaf B, value V) (n *Node[I, B, V])

func (Tree[I, B, V]) String

func (t Tree[I, B, V]) String() string

type Vec2

type Vec2[I constraints.Signed | constraints.Float] [2]I

func (Vec2[I]) Add

func (v Vec2[I]) Add(other Vec2[I]) Vec2[I]

func (Vec2[I]) Less

func (v Vec2[I]) Less(other Vec2[I]) bool

func (Vec2[I]) Max

func (v Vec2[I]) Max(other Vec2[I]) Vec2[I]

func (Vec2[I]) Min

func (v Vec2[I]) Min(other Vec2[I]) Vec2[I]

func (Vec2[I]) More

func (v Vec2[I]) More(other Vec2[I]) bool

func (Vec2[I]) Mul

func (v Vec2[I]) Mul(i I) Vec2[I]

func (Vec2[I]) Norm

func (v Vec2[I]) Norm() float64

func (Vec2[I]) Sub

func (v Vec2[I]) Sub(other Vec2[I]) Vec2[I]

func (Vec2[I]) Sum

func (v Vec2[I]) Sum() I

type Vec3

type Vec3[I constraints.Signed | constraints.Float] [3]I

func (Vec3[I]) Add

func (v Vec3[I]) Add(other Vec3[I]) Vec3[I]

func (Vec3[I]) Less

func (v Vec3[I]) Less(other Vec3[I]) bool

func (Vec3[I]) Max

func (v Vec3[I]) Max(other Vec3[I]) Vec3[I]

func (Vec3[I]) Min

func (v Vec3[I]) Min(other Vec3[I]) Vec3[I]

func (Vec3[I]) More

func (v Vec3[I]) More(other Vec3[I]) bool

func (Vec3[I]) Mul

func (v Vec3[I]) Mul(i I) Vec3[I]

func (Vec3[I]) Norm

func (v Vec3[I]) Norm() float64

func (Vec3[I]) Sub

func (v Vec3[I]) Sub(other Vec3[I]) Vec3[I]

func (Vec3[I]) Sum

func (v Vec3[I]) Sum() I

Jump to

Keyboard shortcuts

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