From 5241464a462d4f7ab00ccf8cb4b59f4547fe6639 Mon Sep 17 00:00:00 2001 From: Yaohua Xiong Date: Sun, 7 Aug 2022 18:29:12 +0800 Subject: Refactor Curv3D and PathFollow3D This commit makes the following major changes 1. Add "sample_baked_with_rotation()" to Curve3D, making it usable independently. A similar change was made to Curve2D previously. 2. Refactor the _bake() method on Curve3D, using Parallel Transport Frame instead of Frenet Frame. 3. Refactor the sample_* methods, including: i. Factor out common binary search code, following the DRY principe ii. sample_up_vector() interpolated up vector as part of rotation frame(posture) for consistancy and accuracy. --- doc/classes/Curve3D.xml | 9 +++++++++ doc/classes/PathFollow3D.xml | 13 +++++++++++++ 2 files changed, 22 insertions(+) (limited to 'doc/classes') diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml index 3e4e05f51a..63134417b1 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -132,6 +132,15 @@ If the curve has no up vectors, the function sends an error to the console, and returns [code](0, 1, 0)[/code]. + + + + + + + Similar with [code]interpolate_baked()[/code]. The the return value is [code]Transform3D[/code], with [code]origin[/code] as point position, [code]basis.x[/code] as sideway vector, [code]basis.y[/code] as up vector, [code]basis.z[/code] as forward vector. When the curve length is 0, there is no reasonable way to caculate the rotation, all vectors aligned with global space axes. + + diff --git a/doc/classes/PathFollow3D.xml b/doc/classes/PathFollow3D.xml index ba7207be8f..fa7580b7b6 100644 --- a/doc/classes/PathFollow3D.xml +++ b/doc/classes/PathFollow3D.xml @@ -9,6 +9,16 @@ + + + + + + + Correct the [code]transform[/code]. [code]rotation_mode[/code] implicitly specifies how posture (forward, up and sideway direction) is caculated. + + + If [code]true[/code], the position between two cached points is interpolated cubically, and linearly otherwise. @@ -30,6 +40,9 @@ Allows or forbids rotation on one or more axes, depending on the [enum RotationMode] constants being used. + + If [code]true[/code], the tilt property of [Curve3D] takes effect. + The node's offset perpendicular to the curve. -- cgit v1.2.3