export Vector2 normalize proc
This commit is contained in:
parent
96dfc7de90
commit
21ca9a088b
1 changed files with 1 additions and 1 deletions
|
|
@ -84,7 +84,7 @@ proc length*(self: Vector2): float32 {.inline, noinit.} =
|
||||||
proc lengthSquared*(self: Vector2): float32 {.inline, noinit.} =
|
proc lengthSquared*(self: Vector2): float32 {.inline, noinit.} =
|
||||||
self.x * self.x + self.y * self.y
|
self.x * self.x + self.y * self.y
|
||||||
|
|
||||||
proc normalize(self: var Vector2) {.inline.} =
|
proc normalize*(self: var Vector2) {.inline.} =
|
||||||
var len = self.x * self.x + self.y * self.y
|
var len = self.x * self.x + self.y * self.y
|
||||||
if len != 0:
|
if len != 0:
|
||||||
len = sqrt(len)
|
len = sqrt(len)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue