Mercurial > games > semicongine
diff tests/test_vector.nim @ 60:c57285d292b6
did: deep refactoring of handling vertrex attribute and buffer updates, don't ask ;(
author | Sam <sam@basx.dev> |
---|---|
date | Sun, 22 Jan 2023 22:46:53 +0700 |
parents | 547f3a374271 |
children | 77755701bf49 |
line wrap: on
line diff
--- a/tests/test_vector.nim Fri Jan 20 16:53:37 2023 +0700 +++ b/tests/test_vector.nim Sun Jan 22 22:46:53 2023 +0700 @@ -26,9 +26,12 @@ proc randVec2I(): auto = newVec2(rand(1 .. 10), rand(1 .. 10)) proc randVec2F(): auto = newVec2(rand(10'f) + 0.01, rand(10'f) + 0.01) proc randVec3I(): auto = newVec3(rand(1 .. 10), rand(1 .. 10), rand(1 .. 10)) -proc randVec3F(): auto = newVec3(rand(10'f) + 0.01, rand(10'f) + 0.01, rand(10'f) + 0.01) -proc randVec4I(): auto = newVec4(rand(1 .. 10), rand(1 .. 10), rand(1 .. 10), rand(1 .. 10)) -proc randVec4F(): auto = newVec4(rand(10'f) + 0.01, rand(10'f) + 0.01, rand(10'f) + 0.01, rand(10'f) + 0.01) +proc randVec3F(): auto = newVec3(rand(10'f) + 0.01, rand(10'f) + 0.01, rand( + 10'f) + 0.01) +proc randVec4I(): auto = newVec4(rand(1 .. 10), rand(1 .. 10), rand(1 .. 10), + rand(1 .. 10)) +proc randVec4F(): auto = newVec4(rand(10'f) + 0.01, rand(10'f) + 0.01, rand( + 10'f) + 0.01, rand(10'f) + 0.01) proc testVector() = @@ -134,6 +137,13 @@ echo "float2int ", to[int](randVec3F()) echo "int2float ", to[float](randVec3I()) + echo "V3I.x: ", randVec3I().x + echo "V3I.y: ", randVec3I().y + echo "V3F.z: ", randVec3F().z + echo "V3I.r: ", randVec3I().r + echo "V3I.g: ", randVec3I().g + echo "V3F.b: ", randVec3F().b + echo "V2I.xx: ", randVec2I().xx echo "V2I.yx: ", randVec2I().xy echo "V2F.xx: ", randVec2F().xx