1
0
Fork 0

Initial commit

This commit is contained in:
Henrik Hautakoski 2025-06-07 20:26:00 +02:00
commit f26c478727
18 changed files with 621 additions and 0 deletions

26
math/direction.go Normal file
View file

@ -0,0 +1,26 @@
package math
import (
stdmath "math"
)
type Direction float64
func (d *Direction) Set(v float64) {
*d = Direction(v)
}
func (d Direction) Get() float64 {
return float64(d)
}
func (d Direction) ForwardVector() Vec2f {
return Vec2f{
X: stdmath.Cos(float64(d)),
Y: stdmath.Sin(float64(d)),
}
}
func (d *Direction) Rotate(delta float64) {
*d += Direction(delta)
}