From 399c2a8dea31f0980d604c9ab2bbbe988f5e063e Mon Sep 17 00:00:00 2001 From: Yaohua Xiong Date: Fri, 5 Aug 2022 17:03:00 +0800 Subject: Move rotation sampling from Path2D to Curve2D The rotation sampling code is moved from Path2D to a new method `sample_baked_with_rotation` on Curve2D. --- doc/classes/Curve2D.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc') 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). + + + + + + + + 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] + + -- cgit v1.2.3