rect2

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rect2

type Rect2 struct {
	Position Vector2
	Size     Vector2
}

func New

func New(pos, size vector2.Vector2) Rect2

func Zero

func Zero() Rect2

func (*Rect2) ABS

func (r *Rect2) ABS() Rect2

func (*Rect2) DistanceTo

func (r *Rect2) DistanceTo(point Vector2) float64

func (*Rect2) Encloses

func (r *Rect2) Encloses(rect Rect2) bool

returns true if rect is enclosed by this rect

func (Rect2) Expand

func (r Rect2) Expand(point Vector2) Rect2

func (*Rect2) ExpandTo

func (r *Rect2) ExpandTo(point Vector2)

func (*Rect2) GetArea

func (r *Rect2) GetArea() float64

func (*Rect2) GetCenter

func (r *Rect2) GetCenter() Vector2

func (*Rect2) GetEnd

func (r *Rect2) GetEnd() Vector2

func (Rect2) Grow

func (r Rect2) Grow(delta float64) Rect2

func (*Rect2) GrowBy

func (r *Rect2) GrowBy(delta float64)

func (*Rect2) HasArea

func (r *Rect2) HasArea() bool

Returns true if the size of the rect is greater then 0.

func (*Rect2) HasPoint

func (r *Rect2) HasPoint(point Vector2) bool

func (*Rect2) Intersection

func (r *Rect2) Intersection(rect Rect2) Rect2

Returns the intersection between two Rect2s or an empty Rect2 if there is no intersection.

func (*Rect2) Intersects

func (r *Rect2) Intersects(rect Rect2, include_borders ...bool) bool

func (*Rect2) IsEqualApprox

func (r *Rect2) IsEqualApprox(rect Rect2) bool

func (*Rect2) IsFinite

func (r *Rect2) IsFinite() bool

func (*Rect2) Merge

func (r *Rect2) Merge(rect Rect2) Rect2

Returns the union between two Rect2s.

func (*Rect2) Round

func (r *Rect2) Round() Rect2

type Vector2

type Vector2 = vector2.Vector2

Jump to

Keyboard shortcuts

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