collision

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ESTIMATED_COLLISIONS_PER_BODY int = 4

Functions

func GetEstimatedCollisionPairs

func GetEstimatedCollisionPairs(n int) int

func GetEstimatedCollisions

func GetEstimatedCollisions() int

func InitAbstractBounds

func InitAbstractBounds(a *AbstractBounds)

func InitAbstractBoundsTransform

func InitAbstractBoundsTransform(a *AbstractBounds, transform *geometry.Transform)

func NewCategoryFilter

func NewCategoryFilter()

Types

type AbstractBounds

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

func (*AbstractBounds) GetTransform

func (a *AbstractBounds) GetTransform() *geometry.Transform

func (*AbstractBounds) RotateAboutOrigin

func (a *AbstractBounds) RotateAboutOrigin(theta float64)

func (*AbstractBounds) RotateAboutVector2

func (a *AbstractBounds) RotateAboutVector2(theta float64, point *geometry.Vector2)

func (*AbstractBounds) RotateAboutXY

func (a *AbstractBounds) RotateAboutXY(theta, x, y float64)

func (*AbstractBounds) ShiftCoordinates

func (a *AbstractBounds) ShiftCoordinates(shift *geometry.Vector2)

func (*AbstractBounds) TranslateVector2

func (a *AbstractBounds) TranslateVector2(vector *geometry.Vector2)

func (*AbstractBounds) TranslateXY

func (a *AbstractBounds) TranslateXY(x, y float64)

type AxisAlignedBounds

type AxisAlignedBounds struct {
	AbstractBounds
	// contains filtered or unexported fields
}

func NewAxisAlignedBounds

func NewAxisAlignedBounds(width, height float64) *AxisAlignedBounds

func (*AxisAlignedBounds) GetBounds

func (a *AxisAlignedBounds) GetBounds() *geometry.AABB

func (*AxisAlignedBounds) GetHeight

func (a *AxisAlignedBounds) GetHeight() float64

func (*AxisAlignedBounds) GetTranslation

func (a *AxisAlignedBounds) GetTranslation() *geometry.Vector2

func (*AxisAlignedBounds) GetWidth

func (a *AxisAlignedBounds) GetWidth() float64

func (*AxisAlignedBounds) IsOutside

func (a *AxisAlignedBounds) IsOutside(collidable Collider) bool

func (*AxisAlignedBounds) RotateAboutOrigin

func (a *AxisAlignedBounds) RotateAboutOrigin(theta float64)

func (*AxisAlignedBounds) RotateAboutVector2

func (a *AxisAlignedBounds) RotateAboutVector2(theta float64, point *geometry.Vector2)

func (*AxisAlignedBounds) RotateAboutXY

func (a *AxisAlignedBounds) RotateAboutXY(theta, x, y float64)

type Bounder

type Bounder interface {
	geometry.Transformer
	GetTransform() *geometry.Transform
	ShiftCoordinates(shift *geometry.Vector2)
	IsOutside(collider Collider)
}

type BoundsAdapter

type BoundsAdapter struct{}

func (*BoundsAdapter) Outside

func (b *BoundsAdapter) Outside(collidable Collider)

type BoundsListener

type BoundsListener interface {
	dyn4go.Listener
	Outside(collidable Collider)
}

type CategoryFilter

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

func (*CategoryFilter) GetCategory

func (c *CategoryFilter) GetCategory() int

func (*CategoryFilter) GetMask

func (c *CategoryFilter) GetMask() int

func (*CategoryFilter) IsAllowed

func (c *CategoryFilter) IsAllowed(filter Filterer) bool

func (*CategoryFilter) SetCategory

func (c *CategoryFilter) SetCategory(category int)

func (*CategoryFilter) SetMask

func (c *CategoryFilter) SetMask(mask int)

type Collider

type Collider interface {
	geometry.Transformer
	GetID() string
	CreateAABB() *geometry.AABB
	GetFixture(index int) Fixturer
	GetFixtureCount() int
	GetFixtures() []Fixturer
	GetTransform() *geometry.Transform
}

type DefaultFilter

type DefaultFilter struct{}

func (*DefaultFilter) IsAllowed

func (d *DefaultFilter) IsAllowed(filter Filterer) bool

type Filterer

type Filterer interface {
	IsAllowed(filter Filterer) bool
}

func NewDefaultFilter

func NewDefaultFilter() Filterer

type Fixture

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

func NewFixture

func NewFixture(shape geometry.Convexer) *Fixture

func (*Fixture) GetFilter

func (f *Fixture) GetFilter() Filterer

func (*Fixture) GetID

func (f *Fixture) GetID() string

func (*Fixture) GetShape

func (f *Fixture) GetShape() geometry.Convexer

func (*Fixture) GetUserData

func (f *Fixture) GetUserData() interface{}

func (*Fixture) IsSensor

func (f *Fixture) IsSensor() bool

func (*Fixture) SetFilter

func (f *Fixture) SetFilter(filter Filterer)

func (*Fixture) SetSensor

func (f *Fixture) SetSensor(sensor bool)

func (*Fixture) SetUserData

func (f *Fixture) SetUserData(data interface{})

type Fixturer

type Fixturer interface {
	GetID() string
	GetShape() geometry.Convexer
	GetFilter() Filterer
	SetFilter(filter Filterer)
	IsSensor() bool
	SetSensor(sensor bool)
	GetUserData() interface{}
	SetUserData(data interface{})
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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