Blockland Forums > Modification Help
Deg To Rad not working correctly?
mp7964:
Why not just use
--- Code: ---yaw(180);
--- End code ---
instead of making it complicated like that...?
Amade:
--- Quote from: mp7964 on November 06, 2011, 02:47:56 PM ---Why not just use
--- Code: ---yaw(180);
--- End code ---
instead of making it complicated like that...?
--- End quote ---
Clearly because yaw uses radians
Nexus:
yaw() doesnt use radians
It is a function that converts the magnitude of your mouse movement into a direction for your player to turn. I have found that it is an exponential scale, and doing yaw(100); three times is not equal to doing yaw(300);
$mvyaw just uses a radian input between pi and negative pi
I do not know alot of default game functions, so I use %rad = %deg * (3.14159265/180);
Truce:
--- Quote from: Demian on November 06, 2011, 01:16:00 PM ---Indeed it does. It is slightly inaccurate though, after a couple of times it's off by a degree or so.
How do I turn 360 degrees?
--- Code: ---yaw($mvYaw=$pi*2);
--- End code ---
Is not working, it only turns 180 degrees.
--- End quote ---
No no, you don't use yaw() at all, you just set $mvYaw to the value you wish to turn and it handles it.
Example:
--- Code: ---$mvYaw = $pi / 4;
--- End code ---
Ipquarx:
--- Quote from: Nexus on November 06, 2011, 04:36:10 PM ---%rad = %deg * (3.14159265/180);
--- End quote ---
Torque hates anything that is more precise than 5 decimal places.
It will come out as 3.14159 / 180.
And also, you don't turn 360 degrees. That's an entire circle, you'd end up in the exact same spot as you started in.