Small change.

This commit is contained in:
Andre von Houck 2021-09-26 21:46:49 -07:00
parent 0910ea5c0a
commit fa66fc6538

View file

@ -1473,8 +1473,9 @@ proc toAxisAngle*[T](q: GVec4[T]): (GVec3[T], T) =
proc orthogonal*[T](v: GVec3[T]): GVec3[T] = proc orthogonal*[T](v: GVec3[T]): GVec3[T] =
## Returns orthogonal vector to given vector. ## Returns orthogonal vector to given vector.
let v = abs(v) let
var other: type(v) = v = abs(v)
other: type(v) =
if v.x < v.y: if v.x < v.y:
if v.x < v.z: if v.x < v.z:
gvec3(T(1), 0, 0) # X_AXIS gvec3(T(1), 0, 0) # X_AXIS
@ -1510,8 +1511,7 @@ proc fromTwoVectors*[T](a, b: GVec3[T]): GVec4[T] =
proc nlerp*(a: Quat, b: Quat, v: float32): Quat = proc nlerp*(a: Quat, b: Quat, v: float32): Quat =
if dot(a, b) < 0: if dot(a, b) < 0:
var c = a (-a * (1.0 - v) + b * v).normalize()
(-c * (1.0 - v) + b * v).normalize()
else: else:
(a * (1.0 - v) + b * v).normalize() (a * (1.0 - v) + b * v).normalize()