collision

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Circle

type Circle struct {
	Center vector.MutableVector
	Radius float64
}

func (Circle) Collides

func (c Circle) Collides(c2 Circle) bool

type Quadtree

type Quadtree[R Rectangler] struct {
	// contains filtered or unexported fields
}

func NewQuadtree

func NewQuadtree[R Rectangler](level int, bounds Rect) *Quadtree[R]

func (*Quadtree[R]) Clear

func (qt *Quadtree[R]) Clear()

func (*Quadtree[R]) Insert

func (qt *Quadtree[R]) Insert(rect R)

func (*Quadtree[R]) Retrieve

func (qt *Quadtree[R]) Retrieve(rect Rectangler) []R

func (*Quadtree[R]) Split

func (qt *Quadtree[R]) Split()

type Rect

type Rect struct {
	Origin        vector.MutableVector
	Width, Height float64
}

func NewRect

func NewRect(x, y, width, height float64) Rect

func (Rect) AlignedCollides

func (r Rect) AlignedCollides(r2 Rect) bool

type Rectangler

type Rectangler interface {
	Rect() Rect
}

Jump to

Keyboard shortcuts

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