Mercurial > games > semicongine
changeset 1002:892aa207a5b0
undid: some ugly formatting
author | sam <sam@basx.dev> |
---|---|
date | Sat, 13 Apr 2024 21:31:40 +0700 |
parents | 46344b02df81 |
children | 2f92d7e80597 |
files | semicongine/core/vector.nim |
diffstat | 1 files changed, 5 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/semicongine/core/vector.nim Sat Apr 13 18:22:43 2024 +0700 +++ b/semicongine/core/vector.nim Sat Apr 13 21:31:40 2024 +0700 @@ -110,16 +110,11 @@ func `$`*(v: TVec4[SomeNumber]): string = toString[TVec4[SomeNumber]](v) func length*(vec: TVec2[SomeFloat]): auto = sqrt(vec[0] * vec[0] + vec[1] * vec[1]) -func length*(vec: TVec2[SomeInteger]): auto = sqrt(float(vec[0] * vec[0] + vec[ - 1] * vec[1])) -func length*(vec: TVec3[SomeFloat]): auto = sqrt(vec[0] * vec[0] + vec[1] * vec[ - 1] + vec[2] * vec[2]) -func length*(vec: TVec3[SomeInteger]): auto = sqrt(float(vec[0] * vec[0] + vec[ - 1] * vec[1] + vec[2] * vec[2])) -func length*(vec: TVec4[SomeFloat]): auto = sqrt(vec[0] * vec[0] + vec[1] * vec[ - 1] + vec[2] * vec[2] + vec[3] * vec[3]) -func length*(vec: TVec4[SomeInteger]): auto = sqrt(float(vec[0] * vec[0] + vec[ - 1] * vec[1] + vec[2] * vec[2] + vec[3] * vec[3])) +func length*(vec: TVec2[SomeInteger]): auto = sqrt(float(vec[0] * vec[0] + vec[1] * vec[1])) +func length*(vec: TVec3[SomeFloat]): auto = sqrt(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]) +func length*(vec: TVec3[SomeInteger]): auto = sqrt(float(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2])) +func length*(vec: TVec4[SomeFloat]): auto = sqrt(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2] + vec[3] * vec[3]) +func length*(vec: TVec4[SomeInteger]): auto = sqrt(float(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2] + vec[3] * vec[3])) func normalized*[T: SomeFloat](vec: TVec2[T]): auto = let l = vec.length