|Topic was automatically imported from the old Question2Answer platform.
My goal is to rotate on Spatial towards a desired final rotation with a fixed angular speed (in radians/sec).
The behavior I want is essentially what is implemented in Unity’s Quaternion.RotateTowards (Unity - Scripting API: Quaternion.RotateTowards).
Rotates a rotation
fromquaternion is rotated towards
toby an angular step of
maxDegreesDelta(but note that the rotation will not overshoot).
I think implementing this would be relatively easy with the axis angle representation of a
Quat, so in the alternative I would be happy to learn how to obtain an
angle representation of the rotation of a
Basis or a
Quat. I see this in the C++ source code for Basis (
Basis::get_axis_angle https://github.com/godotengine/godot/blob/master/core/math/basis.cpp#L880), but I don’t see a similar method for GDScript or C#.