matrix

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const AABBNullNode = 0xffffffff

Variables

This section is empty.

Functions

This section is empty.

Types

type AABB

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

func NewAABB

func NewAABB(minX float64, minY float64, minZ float64, maxX float64, maxY float64, maxZ float64) *AABB

type AABBNode

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

func NewAABBNode

func NewAABBNode() *AABBNode

type AABBTree

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

func NewAABBTree

func NewAABBTree(initialSize uint) *AABBTree

func (*AABBTree) InsertObject

func (a *AABBTree) InsertObject(object IAABB)

func (*AABBTree) QueryOverlaps

func (a *AABBTree) QueryOverlaps(object IAABB) []IAABB

func (*AABBTree) RemoveObject

func (a *AABBTree) RemoveObject(object IAABB)

func (*AABBTree) UpdateObject

func (a *AABBTree) UpdateObject(object IAABB)

type Entity

type Entity struct {
	Rect
	Mass float64
	Vx   float64
	Vy   float64

	Bounce  bool
	Gravity bool
	// contains filtered or unexported fields
}

func NewEntity

func NewEntity(base rune, x int, y int, mass float64, vx float64, vy float64, raw []string, startIdx int) *Entity

func (*Entity) DoPhysics

func (e *Entity) DoPhysics(obj2 *Entity) bool

func (*Entity) Draw

func (e *Entity) Draw(surface interfaces.ISurface)

func (*Entity) HasCollision

func (e *Entity) HasCollision(obj2 *Entity) bool

func (*Entity) Next

func (e *Entity) Next()

type IAABB

type IAABB interface {
	GetAABB() *AABB
}

type Point

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

func NewPointFloat

func NewPointFloat(x float64, y float64) Point

func (*Point) AddTo

func (p *Point) AddTo(x float64, y float64)

func (*Point) AddToX

func (p *Point) AddToX(x float64)

func (*Point) AddToY

func (p *Point) AddToY(y float64)

func (*Point) GetX

func (p *Point) GetX() float64

func (*Point) GetY

func (p *Point) GetY() float64

func (*Point) MoveTo

func (p *Point) MoveTo(x float64, y float64)

func (*Point) MoveToX

func (p *Point) MoveToX(x float64)

func (*Point) MoveToY

func (p *Point) MoveToY(y float64)

type Rect

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

func NewRect

func NewRect(x float64, y float64, w float64, h float64, z float64) Rect

func (*Rect) AddTo

func (r *Rect) AddTo(x float64, y float64)

func (*Rect) AddToX

func (r *Rect) AddToX(x float64)

func (*Rect) AddToY

func (r *Rect) AddToY(y float64)

func (*Rect) GetAABB

func (r *Rect) GetAABB() *AABB

func (*Rect) GetHeight

func (r *Rect) GetHeight() float64

func (*Rect) GetWidth

func (r *Rect) GetWidth() float64

func (*Rect) GetX

func (r *Rect) GetX() float64

func (*Rect) GetY

func (r *Rect) GetY() float64

func (*Rect) MoveTo

func (r *Rect) MoveTo(x float64, y float64)

func (*Rect) MoveToX

func (r *Rect) MoveToX(x float64)

func (*Rect) MoveToY

func (r *Rect) MoveToY(y float64)

func (*Rect) SetSize

func (r *Rect) SetSize(w float64, h float64)

type Size

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

func NewSize

func NewSize(w float64, h float64) Size

func (*Size) GetHeight

func (s *Size) GetHeight() float64

func (*Size) GetWidth

func (s *Size) GetWidth() float64

type Sprite

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

func NewSprite

func NewSprite(raw string, base rune) *Sprite

Jump to

Keyboard shortcuts

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