Open ModularNucleus opened 5 months ago
This is likely due to rounding errors, the values are very tiny and reasonably within margins for comparison, remember that the angle mode will perform several conversions, first from degrees to radians, and then computing the transform
Where should this be documented even, if at all?
I remember there was talk of documenting all the floating point gotchas somewhere in the manual and then linking to it. I think that place ended up being https://docs.godotengine.org/en/stable/tutorials/physics/large_world_coordinates.html, but it's not linked to all that often, since it's not really a general explanation of floating point. Across the docs, I think there's a link or two to an off-site explanation of floating point, as well.
If this issue is purely caused by generic floating-point precision issues, I think it could be reasonably closed without any documentation changes.
Tested versions
Reproducible in:
System information
Godot v4.2.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 31.0.15.3758) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)
Issue description
I am unsure if this is actually a bug, because of:
The issue is: When rotating a Node3D 90 or 180 degrees by using the Euler angle properties in the inspector, the resulting basis is not identical to the one produced by performing the same rotation using the quaternion or basis rotation edit modes.
E.g., rotating th x-axis 90 degrees produces the following transform when the scene is viewed in Notepad++: transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
Rotating the node by pasting the quaternion (0.707, 0, 0, 0.707) into the quaternion field produces the following basis: transform = Transform3D(1, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0)
Rotating the node using the basis rotation mode also produces the following basis: transform = Transform3D(1, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0)
Switching rotation modes: Switching the rotation edit mode to quaternion or basis modes after having rotated using Euler retains the Euler-derived basis: transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
Switching to Euler rotation mode after having first rotated via quaternion or basis retains the quaternion/basis-derived basis:
Like I said, I do not really know if this is expected behaviour, e.g., due to precision issues, but it does seem a little odd to me.
Steps to reproduce
Minimal reproduction project (MRP)
rotation_test.zip