You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I posted about this in the forum but it's a critical bug that broke every script I wrote that worked on 0.5 and I can't find a workaround so I'm posting it here to be sure it gets seen as soon as possible.
This syntax used to work:
lock steering to up + V(x,y,z).
or this:
lock steering to up * V(x,y,z).
They are no longer supported, it seems. They now cause "Expression error" to try to use a V(...) expression to steer by.
This is critical because now all the available means to steer require that you know the angles ( you can use R() or Q() or HEADING... BY... ) and to get the angles from the vector XYZ lengths requires access to the functions arcsin, arccos, or arctan, which we don't have.
Either of the following two things would solve the problem:
1 - Put support for steering by a vector back in.
or
2 - Add arcsin, arccos, and arctan.
For example, the compass heading and pitch could be derived as follows if we had the arc functions, assuming X is north, Y is west, and Z is up:
set xyzLength to (x^2+y^z+z^2)^0.5 .
set xyLength to (x^2 * y^2) ^ 0.5 .
set compSin to (0-x) / xyLength.
set compCos to y / xyLength.
set compass to arccos( compCos ).
if compSin < 0 { set compass to 0 - compass. }.
set pitchSin to z / xyzLen .
set pitch to arcsin( pitchSin ).
lock steering to heading compass by pitch.
The text was updated successfully, but these errors were encountered:
I posted about this in the forum but it's a critical bug that broke every script I wrote that worked on 0.5 and I can't find a workaround so I'm posting it here to be sure it gets seen as soon as possible.
This syntax used to work:
lock steering to up + V(x,y,z).
or this:
lock steering to up * V(x,y,z).
They are no longer supported, it seems. They now cause "Expression error" to try to use a V(...) expression to steer by.
This is critical because now all the available means to steer require that you know the angles ( you can use R() or Q() or HEADING... BY... ) and to get the angles from the vector XYZ lengths requires access to the functions arcsin, arccos, or arctan, which we don't have.
Either of the following two things would solve the problem:
1 - Put support for steering by a vector back in.
or
2 - Add arcsin, arccos, and arctan.
For example, the compass heading and pitch could be derived as follows if we had the arc functions, assuming X is north, Y is west, and Z is up:
set xyzLength to (x^2+y^z+z^2)^0.5 .
set xyLength to (x^2 * y^2) ^ 0.5 .
set compSin to (0-x) / xyLength.
set compCos to y / xyLength.
set compass to arccos( compCos ).
if compSin < 0 { set compass to 0 - compass. }.
set pitchSin to z / xyzLen .
set pitch to arcsin( pitchSin ).
lock steering to heading compass by pitch.
The text was updated successfully, but these errors were encountered: