Mustafif / MufiZ

Mufi Lang with Ziggyness
GNU General Public License v2.0
1 stars 0 forks source link

Vec3 Functions **BROKEN** #16

Closed Mustafif closed 5 months ago

Mustafif commented 5 months ago

Since we do not have a proper test suite, especially with newer functions, we have the occasionally broken built-in, and sadly, this plague has affected our Vec3-specific functions.

Dot

Version 0.6.0 (Mars Release)
(mufi) >> var x = fvec(3);
(mufi) >> var y = fvec(3);
(mufi) >> push(x, 1.0, 2.0, 3.0);
(mufi) >> push(y, 1.0, 2.0, 3.0);
(mufi) >> print dot(x, y);
Vectors are not of size 3
0

Cross

(mufi) >> print cross(x, y);
Vectors are not of size 3
Segmentation fault at address 0x0
???:?:?: 0x1092db3 in ??? ()
Unwind error at address `:0x1092db3` (error.InvalidDebugInfo), trace may be incomplete

Norm

Version 0.6.0 (Mars Release)
(mufi) >> var x = linspace(1.0, 3.0, 3);
(mufi) >> var y = linspace(1.0, 3.0, 3);
(mufi) >> print norm(x);
Cannot normalize a zero vector
Segmentation fault at address 0x0
???:?:?: 0x1092db3 in ??? ()
Unwind error at address `:0x1092db3` (error.InvalidDebugInfo), trace may be incomplete

Angle

Version 0.6.0 (Mars Release)
(mufi) >> var x = linspace(1.0, 3.0, 3);
(mufi) >> var y = linspace(1.0, 3.0, 3);
(mufi) >> print angle(x, y);
Vectors are not of size 3
nan

Proj

(mufi) >> print proj(x, y);
Vectors are not of size 3
Vectors are not of size 3
[nan, nan, nan]

Others behave just like proj, the main issue we can see is that the size 3 not being detected properly. That will be the first issue tackled, and hopefully 90% of these errors will be fixed.

Mustafif commented 5 months ago

Fixed in https://github.com/Mustafif/MufiZ/commit/7fbc1b62293d3b9ed1d58869fb96f12cd2024ff1