bmath

package
v0.0.0-...-50c553c Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AngleBetween

func AngleBetween(centre, p1, p2 Vector2d) float64

func Fmod

func Fmod(a float64, b float64) float64

func GetX

func GetX(v Vector2d) float64

func GetY

func GetY(v Vector2d) float64

func Xor

func Xor(v1 bool, v2 bool) bool

Types

type Camera

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

func NewCamera

func NewCamera() *Camera

func (*Camera) GenRotated

func (camera *Camera) GenRotated(rotations int, rotOffset float64) []mgl32.Mat4

func (*Camera) GenRotatedX

func (camera *Camera) GenRotatedX(rotations int, rotOffset float64) []mgl32.Mat4

func (Camera) GetProjectionView

func (camera Camera) GetProjectionView() mgl32.Mat4

func (Camera) GetWorldRect

func (camera Camera) GetWorldRect() Rectangle

func (*Camera) Rotate

func (camera *Camera) Rotate(rad float64)

func (*Camera) Scale

func (camera *Camera) Scale(scale Vector2d)

func (*Camera) SetOrigin

func (camera *Camera) SetOrigin(pos Vector2d)

func (*Camera) SetOsuViewport

func (camera *Camera) SetOsuViewport(width, height int)

func (*Camera) SetPosition

func (camera *Camera) SetPosition(pos Vector2d)

func (*Camera) SetRotation

func (camera *Camera) SetRotation(rad float64)

func (*Camera) SetScale

func (camera *Camera) SetScale(scale Vector2d)

func (*Camera) SetViewport

func (camera *Camera) SetViewport(width, height int, yDown bool)

func (*Camera) SetViewportF

func (camera *Camera) SetViewportF(x, y, width, height int)

func (*Camera) Translate

func (camera *Camera) Translate(pos Vector2d)

func (Camera) Unproject

func (camera Camera) Unproject(screenPos Vector2d) Vector2d

func (*Camera) Update

func (camera *Camera) Update()

type Rectangle

type Rectangle struct {
	MinX, MinY, MaxX, MaxY float64
}

type Vector2d

type Vector2d struct {
	X, Y float64
}

func NewVec2d

func NewVec2d(x, y float64) Vector2d

func NewVec2dP

func NewVec2dP(x, y float64) *Vector2d

func NewVec2dRad

func NewVec2dRad(rad, length float64) Vector2d

func (Vector2d) Abs

func (v Vector2d) Abs() Vector2d

func (Vector2d) Add

func (v Vector2d) Add(v1 Vector2d) Vector2d

func (Vector2d) AddS

func (v Vector2d) AddS(x, y float64) Vector2d

func (Vector2d) Angle

func (v Vector2d) Angle() float64

func (Vector2d) AngleR

func (v Vector2d) AngleR() float64

func (Vector2d) AngleRV

func (v Vector2d) AngleRV(v1 Vector2d) float64

func (Vector2d) AsVec3

func (v Vector2d) AsVec3() mgl32.Vec3

func (Vector2d) AsVec4

func (v Vector2d) AsVec4() mgl32.Vec4

func (Vector2d) Copy

func (v Vector2d) Copy() Vector2d

func (Vector2d) Dot

func (v Vector2d) Dot(v1 Vector2d) float64

func (Vector2d) Dst

func (v Vector2d) Dst(v1 Vector2d) float64

func (Vector2d) DstSq

func (v Vector2d) DstSq(v1 Vector2d) float64

func (Vector2d) Len

func (v Vector2d) Len() float64

func (Vector2d) Mid

func (v Vector2d) Mid(v1 Vector2d) Vector2d

func (Vector2d) Mult

func (v Vector2d) Mult(v1 Vector2d) Vector2d

func (Vector2d) Nor

func (v Vector2d) Nor() Vector2d

func (Vector2d) Rotate

func (v Vector2d) Rotate(rad float64) Vector2d

func (Vector2d) Scl

func (v Vector2d) Scl(mag float64) Vector2d

func (*Vector2d) Set

func (v *Vector2d) Set(x, y float64)

func (*Vector2d) SetRad

func (v *Vector2d) SetRad(rad, length float64)

func (Vector2d) Sub

func (v Vector2d) Sub(v1 Vector2d) Vector2d

func (Vector2d) X32

func (v Vector2d) X32() float32

func (Vector2d) Y32

func (v Vector2d) Y32() float32

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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