Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Add supplement for loop_wrap & cubic interpolation to docs

Silc Lizard (Tokage) Renew0587745f73fd
diff --git a/core/math/quaternion.cpp b/core/math/quaternion.cpp
index 5fbf73ce5f7..c5518a42ba0 100644
--- a/core/math/quaternion.cpp
+++ b/core/math/quaternion.cpp
@@ -113,7 +113,7 @@ Quaternion Quaternion::exp() const {
// and loses the continuity with the neighboring keys beyond it. Makes the expmap from a wider range (the log() result shifted by multiples of 720 deg,
// which keeps the sign of the quaternion) and picks the point closest to p_ln_neighbor.
// The shift is a multiple of two phases of the singularity reparameterization of the expmap (section 3.2.1): https://www.cs.cmu.edu/~spiff/moedit99/expmap.pdf
-// Both p_q and p_ln_neighbor are relative to the same base key (almost from_q or to_q in interpolation).
+// Both the quaternion itself and p_ln_neighbor should be relative to the same base quaternion.
Quaternion Quaternion::get_nearest_log(const Quaternion &p_ln_neighbor) const {
Quaternion p_q = *this;
constexpr real_t PHASE = 2 * (real_t)Math::TAU;
diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml
index a38bd563642..d77abf299cc 100644
--- a/doc/classes/Animation.xml
+++ b/doc/classes/Animation.xml
@@ -602,6 +602,7 @@
<param index="1" name="interpolation" type="bool" />
<description>
If [code]true[/code], the track at [param track_idx] wraps the interpolation loop.
+ [b]Note:[/b] If [param interpolation] is [code]true[/code], the animation interpolates between the last and first key of the track. If the last key is placed exactly at the end of the animation, it is ignored as being placed outside the looped animation range.
</description>
</method>
<method name="track_set_interpolation_type">
@@ -734,6 +735,7 @@
</constant>
<constant name="INTERPOLATION_CUBIC" value="2" enum="InterpolationType">
Cubic interpolation. This looks smoother than linear interpolation, but is more expensive to interpolate. Stick to [constant INTERPOLATION_LINEAR] for complex 3D animations imported from external software, even if it requires using a higher animation framerate in return.
+ [b]Note:[/b] If the last and first keys have different values and are close to the ends of the track, a huge overshoot in interpolation may occur if [method track_set_interpolation_loop_wrap] is set to [code]true[/code].
</constant>
<constant name="INTERPOLATION_LINEAR_ANGLE" value="3" enum="InterpolationType">
Linear interpolation with shortest path rotation.