@@ -16,46 +16,46 @@ func NewVector2Float32(x, y float32) *Vector2 {
1616}
1717
1818// Length returns the length of this vector
19- func (m * Vector2 ) Length () float64 {
20- x := * m .X
21- y := * m .Y
22- return math .Sqrt (float64 (x * x + y * y ))
19+ func (x * Vector2 ) Length () float64 {
20+ vx := * x .X
21+ vy := * x .Y
22+ return math .Sqrt (float64 (vx * vx + vy * vy ))
2323}
2424
2525// Sub subtracts the given vector from this one
26- func (m * Vector2 ) Sub (o * Vector2 ) * Vector2 {
27- return NewVector2Float32 (* m .X - * o .X , * m .Y - * o .Y )
26+ func (x * Vector2 ) Sub (o * Vector2 ) * Vector2 {
27+ return NewVector2Float32 (* x .X - * o .X , * x .Y - * o .Y )
2828}
2929
3030// DistanceTo returns the distance between this vector and the given one
31- func (m * Vector2 ) DistanceTo (o * Vector2 ) float64 {
32- return m .Sub (o ).Length ()
31+ func (x * Vector2 ) DistanceTo (o * Vector2 ) float64 {
32+ return x .Sub (o ).Length ()
3333}
3434
3535// X64 returns the x value as float64
36- func (m * Vector2 ) X64 () float64 {
37- return float64 (* m .X )
36+ func (x * Vector2 ) X64 () float64 {
37+ return float64 (* x .X )
3838}
3939
4040// Y64 returns the y value as float64
41- func (m * Vector2 ) Y64 () float64 {
42- return float64 (* m .Y )
41+ func (x * Vector2 ) Y64 () float64 {
42+ return float64 (* x .Y )
4343}
4444
4545// ToVector2 converts this vector into a new 2d vector, dropping the z part
46- func (m * Vector3 ) ToVector2 () * Vector2 {
47- return NewVector2Float32 (* m .X , * m .Y )
46+ func (x * Vector3 ) ToVector2 () * Vector2 {
47+ return NewVector2Float32 (* x .X , * x .Y )
4848}
4949
5050// StringPretty converts the vector into a pretty printed string
51- func (m * Vector2 ) StringPretty () string {
52- x := float32 (0 )
53- y := float32 (0 )
54- if m .X != nil {
55- x = * m .X
51+ func (x * Vector2 ) StringPretty () string {
52+ vx := float32 (0 )
53+ vy := float32 (0 )
54+ if x .X != nil {
55+ vx = * x .X
5656 }
57- if m .Y != nil {
58- y = * m .Y
57+ if x .Y != nil {
58+ vy = * x .Y
5959 }
60- return fmt .Sprintf ("x: %v, y: %v" , x , y )
60+ return fmt .Sprintf ("x: %v, y: %v" , vx , vy )
6161}
0 commit comments