broadphase

package
v0.0.0-...-344f55e Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_AABB_EXPANSION float64 = 0.2

Functions

func InitAbstractAABBDetector

func InitAbstractAABBDetector(abstractAABBDetector *AbstractAABBDetector)

func NewSapIncrementalPairList

func NewSapIncrementalPairList() *sapIncrementalPairList

func NewsapBruteForcePairList

func NewsapBruteForcePairList() *sapBruteForcePairList

Types

type AbstractAABBDetector

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

func (*AbstractAABBDetector) DetectColliders

func (a *AbstractAABBDetector) DetectColliders(b, c collision.Collider) bool

func (*AbstractAABBDetector) DetectConvexTransform

func (a *AbstractAABBDetector) DetectConvexTransform(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform) bool

func (*AbstractAABBDetector) GetAABBExpansion

func (a *AbstractAABBDetector) GetAABBExpansion() float64

func (*AbstractAABBDetector) SetAABBExpansion

func (a *AbstractAABBDetector) SetAABBExpansion(expansion float64)

type BroadphaseDetector

type BroadphaseDetector interface {
	Add(collidable collision.Collider)
	Remove(collidable collision.Collider)
	Update(collidable collision.Collider)
	Clear()
	GetAABB(collidable collision.Collider) *geometry.AABB
	DetectAABB(aabb *geometry.AABB) []collision.Collider
	Raycast(ray *geometry.Ray, length float64) []collision.Collider
	Detect(a, b interface{}) bool
	DetectConvexTransform(convex1 geometry.Convexer, transform1 *geometry.Transform, convex2 geometry.Convexer, transform2 *geometry.Transform) bool
	GetAABBExpansion() float64
	SetAABBExpansion(expansion float64)
	ShiftCoordinates(shift *geometry.Vector2)
}

type BroadphasePair

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

func NewBroadphasePair

func NewBroadphasePair(a, b interface{}) *BroadphasePair

func (*BroadphasePair) GetA

func (b *BroadphasePair) GetA() interface{}

func (*BroadphasePair) GetB

func (b *BroadphasePair) GetB() interface{}

func (*BroadphasePair) SetA

func (b *BroadphasePair) SetA(val interface{})

func (*BroadphasePair) SetB

func (b *BroadphasePair) SetB(val interface{})

type DATNode

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

func (*DATNode) IsLeaf

func (d *DATNode) IsLeaf() bool

type DynamicAABBTree

type DynamicAABBTree struct {
	AbstractAABBDetector
	// contains filtered or unexported fields
}

func NewDynamicAABBTree

func NewDynamicAABBTree() *DynamicAABBTree

func NewDynamicAABBTreeInt

func NewDynamicAABBTreeInt(initialCapacity int) *DynamicAABBTree

func (*DynamicAABBTree) Add

func (d *DynamicAABBTree) Add(collidable collision.Collider)

func (*DynamicAABBTree) Clear

func (d *DynamicAABBTree) Clear()

func (*DynamicAABBTree) Detect

func (d *DynamicAABBTree) Detect() []*BroadphasePair

func (*DynamicAABBTree) DetectAABB

func (d *DynamicAABBTree) DetectAABB(aabb *geometry.AABB) []collision.Collider

func (*DynamicAABBTree) GetAABB

func (d *DynamicAABBTree) GetAABB(collidable collision.Collider) *geometry.AABB

func (*DynamicAABBTree) Raycast

func (d *DynamicAABBTree) Raycast(ray *geometry.Ray, length float64) []collision.Collider

func (*DynamicAABBTree) Remove

func (d *DynamicAABBTree) Remove(collidable collision.Collider)

func (*DynamicAABBTree) ShiftCoordinates

func (d *DynamicAABBTree) ShiftCoordinates(shift *geometry.Vector2)

func (*DynamicAABBTree) Update

func (d *DynamicAABBTree) Update(collidable collision.Collider)

type SapBruteForce

type SapBruteForce struct {
	AbstractAABBDetector
	// contains filtered or unexported fields
}

func NewSapBruteForce

func NewSapBruteForce() *SapBruteForce

func NewSapBruteForceInt

func NewSapBruteForceInt(initialCapacity int) *SapBruteForce

func (*SapBruteForce) Add

func (s *SapBruteForce) Add(collidable collision.Collider)

func (*SapBruteForce) Clear

func (s *SapBruteForce) Clear()

func (*SapBruteForce) Detect

func (s *SapBruteForce) Detect() []*BroadphasePair

func (*SapBruteForce) DetectAABB

func (s *SapBruteForce) DetectAABB(aabb *geometry.AABB) []collision.Collider

func (*SapBruteForce) GetAABB

func (s *SapBruteForce) GetAABB(collidable collision.Collider) *geometry.AABB

func (*SapBruteForce) Raycast

func (s *SapBruteForce) Raycast(ray *geometry.Ray, length float64) []collision.Collider

func (*SapBruteForce) Remove

func (s *SapBruteForce) Remove(collidable collision.Collider)

func (*SapBruteForce) ShiftCoordinates

func (s *SapBruteForce) ShiftCoordinates(shift *geometry.Vector2)

func (*SapBruteForce) Update

func (s *SapBruteForce) Update(collidable collision.Collider)

type SapIncremental

type SapIncremental struct {
	AbstractAABBDetector
	// contains filtered or unexported fields
}

func NewSapIncremental

func NewSapIncremental() *SapIncremental

func NewSapIncrementalInt

func NewSapIncrementalInt(initialCapacity int) *SapIncremental

func (*SapIncremental) Add

func (s *SapIncremental) Add(collidable collision.Collider)

func (*SapIncremental) Clear

func (s *SapIncremental) Clear()

func (*SapIncremental) Detect

func (s *SapIncremental) Detect() []*BroadphasePair

func (*SapIncremental) DetectAABB

func (s *SapIncremental) DetectAABB(aabb *geometry.AABB) []collision.Collider

func (*SapIncremental) GetAABB

func (s *SapIncremental) GetAABB(collidable collision.Collider) *geometry.AABB

func (*SapIncremental) Raycast

func (s *SapIncremental) Raycast(ray *geometry.Ray, length float64) []collision.Collider

func (*SapIncremental) Remove

func (s *SapIncremental) Remove(collidable collision.Collider)

func (*SapIncremental) ShiftCoordinates

func (s *SapIncremental) ShiftCoordinates(shift *geometry.Vector2)

func (*SapIncremental) Update

func (s *SapIncremental) Update(collidable collision.Collider)

type SapTree

type SapTree struct {
	AbstractAABBDetector
	// contains filtered or unexported fields
}

func NewSapTree

func NewSapTree() *SapTree

func NewSapTreeInt

func NewSapTreeInt(initialCapacity int) *SapTree

func (*SapTree) Add

func (s *SapTree) Add(collidable collision.Collider)

func (*SapTree) Clear

func (s *SapTree) Clear()

func (*SapTree) Detect

func (s *SapTree) Detect() []*BroadphasePair

func (*SapTree) DetectAABB

func (s *SapTree) DetectAABB(aabb *geometry.AABB) []collision.Collider

func (*SapTree) GetAABB

func (s *SapTree) GetAABB(collidable collision.Collider) *geometry.AABB

func (*SapTree) Raycast

func (s *SapTree) Raycast(ray *geometry.Ray, length float64) []collision.Collider

func (*SapTree) Remove

func (s *SapTree) Remove(collidable collision.Collider)

func (*SapTree) ShiftCoordinates

func (s *SapTree) ShiftCoordinates(shift *geometry.Vector2)

func (*SapTree) Update

func (s *SapTree) Update(collidable collision.Collider)

type SapTreePairList

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

func NewSapTreePairList

func NewSapTreePairList() *SapTreePairList

type SapTreeProxy

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

func (*SapTreeProxy) CompareTo

func (s *SapTreeProxy) CompareTo(o *SapTreeProxy) int

func (*SapTreeProxy) String

func (s *SapTreeProxy) String() string

Jump to

Keyboard shortcuts

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