Change some test stuff.
This commit is contained in:
parent
6dc778389f
commit
b84d23be05
|
@ -7,7 +7,7 @@ randomize(1234)
|
|||
|
||||
|
||||
block:
|
||||
echo "--- angle stuff"
|
||||
echo "# angle stuff"
|
||||
echo angleBetween(0.1, 0.2), " should be: ", 0.1
|
||||
|
||||
echo angleBetween(0.1, 0.2 + PI*2), " should be: ", 0.1
|
||||
|
@ -23,7 +23,7 @@ block:
|
|||
echo angleBetween(0.2 - PI*2, 0.1), " should be: ", -0.1
|
||||
|
||||
block:
|
||||
echo "--- basic vector vec2"
|
||||
echo "# basic vector vec2"
|
||||
var a = vec2(1, 2)
|
||||
var b = vec2(7, 6)
|
||||
var n = 13.7
|
||||
|
@ -41,7 +41,7 @@ block:
|
|||
echo a
|
||||
|
||||
block:
|
||||
echo "--- basic vector vec3"
|
||||
echo "# basic vector vec3"
|
||||
var a = vec3(1, 2, 3)
|
||||
var b = vec3(7, 6, 5)
|
||||
var n = 13.7
|
||||
|
@ -59,7 +59,7 @@ block:
|
|||
echo a
|
||||
|
||||
block:
|
||||
echo "--- basic vector vec4"
|
||||
echo "# basic vector vec4"
|
||||
var a = vec4(1, 2, 3, 4)
|
||||
var b = vec4(7, 6, 5, 4)
|
||||
var n = 13.7
|
||||
|
@ -77,7 +77,7 @@ block:
|
|||
echo a
|
||||
|
||||
block:
|
||||
echo "---"
|
||||
echo "# basic vector mat4"
|
||||
var m1 = mat4(
|
||||
1, 0, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
|
@ -91,7 +91,7 @@ block:
|
|||
assert m1.close(m2)
|
||||
|
||||
block:
|
||||
echo "---"
|
||||
echo "# basic vector mat4 -1"
|
||||
var m1 = mat4(
|
||||
1, 0, 0, 0,
|
||||
0, 0, -1, 0,
|
||||
|
@ -105,7 +105,7 @@ block:
|
|||
assert m1.close(m2)
|
||||
|
||||
block:
|
||||
echo "--- Y 90"
|
||||
echo "# Y 90"
|
||||
var m1 = rotate(PI/2, vec3(0, 1, 0))
|
||||
echo m1
|
||||
var q1 = m1.quat()
|
||||
|
@ -115,7 +115,7 @@ block:
|
|||
assert m1.close(m2)
|
||||
|
||||
block:
|
||||
echo "--- -Y 90"
|
||||
echo "# -Y 90"
|
||||
var m1 = rotate(PI/2, vec3(0, -1, 0))
|
||||
echo m1
|
||||
var q1 = m1.quat()
|
||||
|
@ -125,7 +125,7 @@ block:
|
|||
assert m1.close(m2)
|
||||
|
||||
block:
|
||||
echo "--- X 90"
|
||||
echo "# X 90"
|
||||
var m1 = rotate(PI/2, vec3(1, 0, 0))
|
||||
echo m1
|
||||
var q1 = m1.quat()
|
||||
|
@ -135,7 +135,7 @@ block:
|
|||
echo m1.close(m2)
|
||||
|
||||
block:
|
||||
echo "--- Y 90"
|
||||
echo "# Y 90"
|
||||
var m1 = rotate(PI/2, vec3(1, 0, 0))
|
||||
echo m1
|
||||
var q1 = m1.quat()
|
||||
|
@ -145,7 +145,7 @@ block:
|
|||
echo m1.close(m2)
|
||||
|
||||
block:
|
||||
echo "--- 1,1,1 1.11rad"
|
||||
echo "# 1,1,1 1.11rad"
|
||||
var m1 = rotate(PI*1.11, vec3(1, 1, 1).normalize())
|
||||
echo m1
|
||||
var q1 = m1.quat()
|
||||
|
@ -155,7 +155,7 @@ block:
|
|||
assert m1.close(m2)
|
||||
|
||||
block:
|
||||
echo "--- 1,1,1 1.11rad"
|
||||
echo "# 1,1,1 1.11rad"
|
||||
var m1 = rotate(PI*1.11, vec3(-1, 1, 1).normalize())
|
||||
echo m1
|
||||
var q1 = m1.quat()
|
||||
|
@ -166,7 +166,7 @@ block:
|
|||
|
||||
|
||||
block:
|
||||
echo "--- 1,1,1 1.11rad"
|
||||
echo "# 1,1,1 1.11rad"
|
||||
var m1 = rotate(PI*1.11, vec3(-1, 0.34, 1.123).normalize())
|
||||
echo m1
|
||||
var q1 = m1.quat()
|
||||
|
@ -176,7 +176,7 @@ block:
|
|||
assert m1.close(m2)
|
||||
|
||||
block:
|
||||
echo "--- super random"
|
||||
echo "# super random"
|
||||
for i in 0..100:
|
||||
var m1 = rotate(PI*rand(2.0), vec3(rand(2.0)-0.5, rand(2.0)-0.5, rand(2.0)-0.5).normalize())
|
||||
echo m1
|
||||
|
@ -187,7 +187,7 @@ block:
|
|||
assert m1.close(m2)
|
||||
|
||||
block:
|
||||
echo "--- matrix to quat test"
|
||||
echo "# matrix to quat test"
|
||||
# TODO: Fix this test
|
||||
# var m1 = mat4(
|
||||
# -0.33089, -0.51266, -0.79227, 0.00000,
|
||||
|
@ -202,7 +202,7 @@ block:
|
|||
# assert m1.close(m2)
|
||||
|
||||
block:
|
||||
echo "--- matrix to quat test"
|
||||
echo "# matrix to quat test"
|
||||
# TODO: Fix this test
|
||||
# var m1 = mat4(
|
||||
# -0.33089, -0.51266, -0.79227, 0.00000,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--- angle stuff
|
||||
# angle stuff
|
||||
0.1000000014901161 should be: 0.1
|
||||
0.09999990463256836 should be: 0.1
|
||||
0.1000003814697266 should be: 0.1
|
||||
|
@ -9,7 +9,7 @@
|
|||
-0.09999990463256836 should be: -0.1
|
||||
-0.09999990463256836 should be: -0.1
|
||||
-0.1000003814697266 should be: -0.1
|
||||
--- basic vector vec2
|
||||
# basic vector vec2
|
||||
(8.0000, 8.0000)
|
||||
(-6.0000, -4.0000)
|
||||
(13.7000, 27.4000)
|
||||
|
@ -18,7 +18,7 @@
|
|||
(1.0000, 2.0000)
|
||||
(13.7000, 27.4000)
|
||||
(1.0000, 2.0000)
|
||||
--- basic vector vec3
|
||||
# basic vector vec3
|
||||
(8.00000000, 8.00000000, 8.00000000)
|
||||
(-6.00000000, -4.00000000, -2.00000000)
|
||||
(13.69999981, 27.39999962, 41.09999847)
|
||||
|
@ -27,7 +27,7 @@
|
|||
(1.00000000, 2.00000000, 3.00000000)
|
||||
(13.69999981, 27.39999962, 41.09999847)
|
||||
(1.00000000, 2.00000000, 3.00000000)
|
||||
--- basic vector vec4
|
||||
# basic vector vec4
|
||||
(8.00000000, 8.00000000, 8.00000000, 8.00000000)
|
||||
(-6.00000000, -4.00000000, -2.00000000, 0.00000000)
|
||||
(13.69999981, 27.39999962, 41.09999847, 54.79999924)
|
||||
|
@ -36,7 +36,7 @@
|
|||
(1.00000000, 2.00000000, 3.00000000, 4.00000000)
|
||||
(13.69999981, 27.39999962, 41.09999847, 54.79999924)
|
||||
(1.00000000, 2.00000000, 3.00000000, 4.00000000)
|
||||
---
|
||||
# basic vector mat4
|
||||
[1.00000, 0.00000, 0.00000, 0.00000,
|
||||
0.00000, 1.00000, 0.00000, 0.00000,
|
||||
0.00000, 0.00000, 1.00000, 0.00000,
|
||||
|
@ -47,7 +47,7 @@ q(0.00000000, 0.00000000, 0.00000000, 1.00000000)
|
|||
0.00000, 1.00000, 0.00000, 0.00000,
|
||||
0.00000, 0.00000, 1.00000, 0.00000,
|
||||
0.00000, 0.00000, 0.00000, 1.00000]
|
||||
---
|
||||
# basic vector mat4 -1
|
||||
[1.00000, 0.00000, 0.00000, 0.00000,
|
||||
0.00000, 0.00000, -1.00000, 0.00000,
|
||||
0.00000, 1.00000, 0.00000, 0.00000,
|
||||
|
@ -58,7 +58,7 @@ q(0.70710677, 0.00000000, 0.00000000, 0.70710677)
|
|||
0.00000, 0.00000, -1.00000, 0.00000,
|
||||
0.00000, 1.00000, 0.00000, 0.00000,
|
||||
0.00000, 0.00000, 0.00000, 1.00000]
|
||||
--- Y 90
|
||||
# Y 90
|
||||
[0.00000, 0.00000, 1.00000, 0.00000,
|
||||
0.00000, 1.00000, 0.00000, 0.00000,
|
||||
-1.00000, 0.00000, 0.00000, 0.00000,
|
||||
|
@ -69,7 +69,7 @@ q(0.00000000, 0.70710671, 0.00000000, 0.70710677)
|
|||
0.00000, 1.00000, 0.00000, 0.00000,
|
||||
-1.00000, 0.00000, 0.00000, 0.00000,
|
||||
0.00000, 0.00000, 0.00000, 1.00000]
|
||||
--- -Y 90
|
||||
# -Y 90
|
||||
[0.00000, -0.00000, -1.00000, 0.00000,
|
||||
0.00000, 1.00000, -0.00000, 0.00000,
|
||||
1.00000, 0.00000, 0.00000, 0.00000,
|
||||
|
@ -80,7 +80,7 @@ q(0.00000000, -0.70710671, 0.00000000, 0.70710677)
|
|||
0.00000, 1.00000, -0.00000, 0.00000,
|
||||
1.00000, 0.00000, 0.00000, 0.00000,
|
||||
0.00000, 0.00000, 0.00000, 1.00000]
|
||||
--- X 90
|
||||
# X 90
|
||||
[1.00000, 0.00000, 0.00000, 0.00000,
|
||||
0.00000, 0.00000, -1.00000, 0.00000,
|
||||
0.00000, 1.00000, 0.00000, 0.00000,
|
||||
|
@ -92,7 +92,7 @@ q(0.70710671, 0.00000000, 0.00000000, 0.70710677)
|
|||
0.00000, 1.00000, 0.00000, 0.00000,
|
||||
0.00000, 0.00000, 0.00000, 1.00000]
|
||||
true
|
||||
--- Y 90
|
||||
# Y 90
|
||||
[1.00000, 0.00000, 0.00000, 0.00000,
|
||||
0.00000, 0.00000, -1.00000, 0.00000,
|
||||
0.00000, 1.00000, 0.00000, 0.00000,
|
||||
|
@ -104,7 +104,7 @@ q(0.70710671, 0.00000000, 0.00000000, 0.70710677)
|
|||
0.00000, 1.00000, 0.00000, 0.00000,
|
||||
0.00000, 0.00000, 0.00000, 1.00000]
|
||||
true
|
||||
--- 1,1,1 1.11rad
|
||||
# 1,1,1 1.11rad
|
||||
[-0.29392, 0.84253, 0.45139, 0.00000,
|
||||
0.45139, -0.29392, 0.84253, 0.00000,
|
||||
0.84253, 0.45139, -0.29392, 0.00000,
|
||||
|
@ -115,7 +115,7 @@ q(0.56875318, 0.56875318, 0.56875318, -0.17192911)
|
|||
0.45139, -0.29392, 0.84253, 0.00000,
|
||||
0.84253, 0.45139, -0.29392, 0.00000,
|
||||
0.00000, 0.00000, 0.00000, 1.00000]
|
||||
--- 1,1,1 1.11rad
|
||||
# 1,1,1 1.11rad
|
||||
[-0.29392, -0.45139, -0.84253, 0.00000,
|
||||
-0.84253, -0.29392, 0.45139, 0.00000,
|
||||
-0.45139, 0.84253, -0.29392, 0.00000,
|
||||
|
@ -126,7 +126,7 @@ q(-0.56875318, 0.56875318, 0.56875318, -0.17192911)
|
|||
-0.84253, -0.29392, 0.45139, 0.00000,
|
||||
-0.45139, 0.84253, -0.29392, 0.00000,
|
||||
0.00000, 0.00000, 0.00000, 1.00000]
|
||||
--- 1,1,1 1.11rad
|
||||
# 1,1,1 1.11rad
|
||||
[-0.12426, -0.03090, -0.99177, 0.00000,
|
||||
-0.52440, -0.84648, 0.09208, 0.00000,
|
||||
-0.84236, 0.53152, 0.08898, 0.00000,
|
||||
|
@ -137,7 +137,7 @@ q(-0.63899082, 0.21725684, 0.71758670, -0.17192909)
|
|||
-0.52440, -0.84648, 0.09208, 0.00000,
|
||||
-0.84236, 0.53152, 0.08898, 0.00000,
|
||||
0.00000, 0.00000, 0.00000, 1.00000]
|
||||
--- super random
|
||||
# super random
|
||||
[1.00000, -0.00000, -0.00001, 0.00000,
|
||||
0.00000, 1.00000, -0.00003, 0.00000,
|
||||
0.00001, 0.00003, 1.00000, 0.00000,
|
||||
|
@ -1148,5 +1148,5 @@ q(0.88595670, 0.46237046, 0.02352080, -0.02722242)
|
|||
0.81800, -0.57095, 0.06999, 0.00000,
|
||||
0.06685, -0.02649, -0.99741, 0.00000,
|
||||
0.00000, 0.00000, 0.00000, 1.00000]
|
||||
--- matrix to quat test
|
||||
--- matrix to quat test
|
||||
# matrix to quat test
|
||||
# matrix to quat test
|
||||
|
|
Loading…
Reference in a new issue