formatting
This commit is contained in:
parent
159c17bf7d
commit
9951eb0d0a
1 changed files with 6 additions and 7 deletions
|
@ -8,9 +8,7 @@ proc between*(value, min, max: float32): bool =
|
||||||
|
|
||||||
proc sign*(v: float32): float32 =
|
proc sign*(v: float32): float32 =
|
||||||
## Returns the sign of a number, -1 or 1.
|
## Returns the sign of a number, -1 or 1.
|
||||||
if v >= 0:
|
if v >= 0: 1.0 else: -1.0
|
||||||
return 1.0
|
|
||||||
return -1.0
|
|
||||||
|
|
||||||
proc quantize*(v: float32, n: float32): float32 =
|
proc quantize*(v: float32, n: float32): float32 =
|
||||||
## Makes v be multipe of n. Rounding to integer quantize by 1.0.
|
## Makes v be multipe of n. Rounding to integer quantize by 1.0.
|
||||||
|
@ -1214,7 +1212,8 @@ proc length*(q: Quat): float32 =
|
||||||
q.w * q.w +
|
q.w * q.w +
|
||||||
q.x * q.x +
|
q.x * q.x +
|
||||||
q.y * q.y +
|
q.y * q.y +
|
||||||
q.z * q.z)
|
q.z * q.z
|
||||||
|
)
|
||||||
|
|
||||||
proc normalize*(q: Quat): Quat =
|
proc normalize*(q: Quat): Quat =
|
||||||
var m = q.length
|
var m = q.length
|
||||||
|
|
Loading…
Reference in a new issue