la

package
v0.0.0-...-1f426e9 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Pi          = 3.1415926535897932384626433832795028841971693993751058209749445923
	Pi2         = 6.2831853071795864769252867665590057683943387987502116419498891846
	PiDiv180    = 0.0174532925199432957692369076848861271344287188854172545609719144
	PiDiv180Inv = 57.295779513082320876798154814105170332405472466564321549160243861
)

Variables

View Source
var Mat3One = Mat3{
	1.0, 0.0, 0.0,
	0.0, 1.0, 0.0,
	0.0, 0.0, 1.0,
}
View Source
var Vec2Zero = Vec2{0.0, 0.0}

Functions

func Clamp

func Clamp(x, min, max float64) float64

func DegToRad

func DegToRad(deg float64) float64

func Equal

func Equal(a, b float64) bool

func RadToDeg

func RadToDeg(rad float64) float64

Types

type Mat3

type Mat3 [9]float64

func NewRotate

func NewRotate(theta float64) Mat3

Theta given angle in radians

func NewScale

func NewScale(sx, sy float64) Mat3

func NewScaleAll

func NewScaleAll(s float64) Mat3

func NewScaleVec

func NewScaleVec(v Vec2) Mat3

func NewTranslate

func NewTranslate(x, y float64) Mat3

func NewTranslateVec

func NewTranslateVec(v Vec2) Mat3

func (Mat3) Apply

func (m Mat3) Apply(g *ebiten.GeoM)

func (Mat3) Det

func (m Mat3) Det() float64

func (Mat3) Inverse

func (m Mat3) Inverse() Mat3

func (Mat3) IsInvertible

func (m Mat3) IsInvertible() bool

func (Mat3) Mul

func (m Mat3) Mul(o Mat3) Mat3

func (Mat3) MulVec

func (m Mat3) MulVec(v Vec2) Vec2

func (Mat3) MulVertexDst

func (m Mat3) MulVertexDst(v []ebiten.Vertex)

func (Mat3) Rotate

func (m Mat3) Rotate(theta float64) Mat3

Theta given angle in radians

func (Mat3) Scale

func (m Mat3) Scale(sx, sy float64) Mat3

func (Mat3) ScaleAll

func (m Mat3) ScaleAll(s float64) Mat3

func (Mat3) ScaleVec

func (m Mat3) ScaleVec(v Vec2) Mat3

func (Mat3) Translate

func (m Mat3) Translate(x, y float64) Mat3

func (Mat3) TranslateVec

func (m Mat3) TranslateVec(v Vec2) Mat3

type Rect

type Rect struct {
	X int32
	Y int32
	W int32
	H int32
}

func NewRect

func NewRect(x, y, w, h int32) Rect

func (Rect) Center

func (r Rect) Center() (int32, int32)

func (Rect) CenterVec2

func (r Rect) CenterVec2() Vec2

func (Rect) MaxX

func (r Rect) MaxX() int32

func (Rect) MaxY

func (r Rect) MaxY() int32

func (Rect) MinX

func (r Rect) MinX() int32

func (Rect) MinY

func (r Rect) MinY() int32

type Vec2

type Vec2 [2]float64

func NewVec2

func NewVec2(x, y float64) Vec2

func (Vec2) Add

func (v Vec2) Add(x, y float64) Vec2

func (Vec2) AddVec

func (v Vec2) AddVec(other Vec2) Vec2

func (Vec2) DistanceTo

func (v Vec2) DistanceTo(other Vec2) float64

func (Vec2) Div

func (v Vec2) Div(f float64) Vec2

func (Vec2) Equals

func (v Vec2) Equals(other Vec2) bool

func (Vec2) Interpolate

func (v Vec2) Interpolate(other Vec2, t float64) Vec2

func (Vec2) Length

func (v Vec2) Length() float64

func (Vec2) MoveTo

func (v Vec2) MoveTo(other Vec2, length float64) Vec2

func (Vec2) Mul

func (v Vec2) Mul(f float64) Vec2

func (Vec2) Neg

func (v Vec2) Neg() Vec2

func (Vec2) Norm

func (v Vec2) Norm(length float64) Vec2

func (Vec2) String

func (p Vec2) String() string

func (Vec2) Sub

func (v Vec2) Sub(x, y float64) Vec2

func (Vec2) SubVec

func (v Vec2) SubVec(other Vec2) Vec2

Jump to

Keyboard shortcuts

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