summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-02 18:50:48 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-02 18:50:48 +0100
commit76092fb6841e5f56c37b983400828971a5559f2c (patch)
treedec25d0b2d2f943178cc0b2a76d81a7c0657ec4b /doc/classes
parent604abb434f6740935be669dc8152856412d9ca73 (diff)
parent399c2a8dea31f0980d604c9ab2bbbe988f5e063e (diff)
Merge pull request #63956 from xiongyaohua/interpolate_on_curve2d
Move rotation interpolation logic from PathFollower2D to Curve2D
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Curve2D.xml16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml
index cc4124d084..ccdf085319 100644
--- a/doc/classes/Curve2D.xml
+++ b/doc/classes/Curve2D.xml
@@ -102,6 +102,22 @@
Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough).
</description>
</method>
+ <method name="sample_baked_with_rotation" qualifiers="const">
+ <return type="Transform2D" />
+ <param index="0" name="offset" type="float" />
+ <param index="1" name="cubic" type="bool" default="false" />
+ <param index="2" name="loop" type="bool" default="true" />
+ <param index="3" name="lookahead" type="float" default="4.0" />
+ <description>
+ Similar to [method sample_baked], but returns [Transform2D] that includes a rotation along the curve. Returns empty transform if length of the curve is [code]0[/code].
+ Use [param loop] to smooth the tangent at the end of the curve. [param lookahead] defines the distance to a nearby point for calculating the tangent vector.
+ [codeblock]
+ var transform = curve.sample_baked_with_rotation(offset)
+ position = transform.get_origin()
+ rotation = transform.get_rotation()
+ [/codeblock]
+ </description>
+ </method>
<method name="samplef" qualifiers="const">
<return type="Vector2" />
<param index="0" name="fofs" type="float" />