diff options
author | Yaohua Xiong <xiongyaohua@gmail.com> | 2022-08-05 17:03:00 +0800 |
---|---|---|
committer | Yaohua Xiong <xiongyaohua@gmail.com> | 2022-11-01 13:18:52 +0800 |
commit | 399c2a8dea31f0980d604c9ab2bbbe988f5e063e (patch) | |
tree | b80df6eb4c7a7c1cd451c89d2a7cda3114e3f5aa /doc | |
parent | c29fe310f1b782cbf588ccf7040cf1606eba6769 (diff) |
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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/Curve2D.xml | 16 |
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" /> |