fixed vec2 addition

This commit is contained in:
Timon Ringwald 2022-08-23 21:48:46 +02:00
parent 79549c6931
commit 2da50690c9

View File

@ -31,7 +31,7 @@ func (v Vec2[N]) W() N {
} }
func (v Vec2[N]) Add(o Vec[N, Vec2[N]]) Vec[N, Vec2[N]] { func (v Vec2[N]) Add(o Vec[N, Vec2[N]]) Vec[N, Vec2[N]] {
return Vec2[N]{v.X() + o.X(), v.Y()} return Vec2[N]{v.X() + o.X(), v.Y() + o.Y()}
} }
func (v Vec2[N]) Sub(o Vec[N, Vec2[N]]) Vec[N, Vec2[N]] { func (v Vec2[N]) Sub(o Vec[N, Vec2[N]]) Vec[N, Vec2[N]] {