matrix

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AABBNullNode = 0xffffffff

Variables

This section is empty.

Functions

func CalcDistance

func CalcDistance(x1 float64, y1 float64, x2 float64, y2 float64) float64

func Hex128

func Hex128(uuid [24]byte) string

func NextUUId

func NextUUId() string

func ValidHex128

func ValidHex128(id string) bool

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) Nodes

func (a *AABBTree) Nodes() map[IAABB]uint

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
	Id       string
	Mass     float64
	VxMin    float64
	Vx       float64
	VyMin    float64
	Vy       float64
	Friction float64
	G        float64
	GForce   float64

	//breaker  *Entity
	Collider *Entity
	// contains filtered or unexported fields
}

func NewEntity

func NewEntity(x float64, y float64, w float64, h float64, mass float64) *Entity

func (*Entity) Compute

func (e *Entity) Compute() bool

func (*Entity) Distance

func (e *Entity) Distance(collider *Entity) float64

func (*Entity) HasCollision

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

func (*Entity) Invalidate

func (e *Entity) Invalidate()

func (*Entity) Move

func (e *Entity) Move()

func (*Entity) MoveTest

func (e *Entity) MoveTest() (float64, float64)

func (*Entity) SetupCollision

func (e *Entity) SetupCollision(collider *Entity)

func (*Entity) SetupInelasticCollision

func (e *Entity) SetupInelasticCollision(collider *Entity)

type Generator

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

func MustNewGenerator

func MustNewGenerator() *Generator

func NewGenerator

func NewGenerator() (*Generator, error)

func (*Generator) Hex128

func (g *Generator) Hex128() string

func (*Generator) Next

func (g *Generator) Next() [24]byte

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) GetCenterX

func (r *Rect) GetCenterX() float64

func (*Rect) GetCenterY

func (r *Rect) GetCenterY() float64

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) Intersect

func (r *Rect) Intersect(x2 float64, y2 float64, w2 float64, h2 float64) bool

func (*Rect) IntersectRect

func (r *Rect) IntersectRect(r2 *Rect) bool

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

Jump to

Keyboard shortcuts

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