From f9fa182abc5209671cb4fbadc2dc173157d6f939 Mon Sep 17 00:00:00 2001 From: Yaohua Xiong Date: Wed, 23 Nov 2022 11:11:58 +0800 Subject: Refactor Curve3D::_bake() method The main change is to caculate tangent directly from bezier curve, without going through discretized polyline, avoiding pitfalls of discretization. Other changes are: 1. Add an bezier_derivative() method for Vector3, Vector2, and Math; 2. Add an tesselate_even_length() method to Curve3D, which tesselate bezier curve to even length segments adaptively; 3. Cache the tangent vectors in baked_tangent_vector_cache; --- doc/classes/@GlobalScope.xml | 11 +++++++++++ doc/classes/Curve3D.xml | 9 +++++++++ doc/classes/Vector2.xml | 10 ++++++++++ doc/classes/Vector3.xml | 10 ++++++++++ 4 files changed, 40 insertions(+) (limited to 'doc') diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 34f706b6f9..a85532dba6 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -106,6 +106,17 @@ [/codeblock] + + + + + + + + + Returns the derivative at the given [param t] on a one-dimensional [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by the given [param control_1], [param control_2], and [param end] points. + + diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml index 63134417b1..67e4e45e52 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -192,6 +192,15 @@ [param tolerance_degrees] controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. + + + + + + Returns a list of points along the curve, with almost uniform density. [param max_stages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! + [param tolerance_length] controls the maximal distance between two neighbouring points, before the segment has to be subdivided. + + diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index eb83eb9aa6..fac672c764 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -86,6 +86,16 @@ Returns the aspect ratio of this vector, the ratio of [member x] to [member y]. + + + + + + + + Returns the derivative at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points. + + diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 9005dd3f0c..f075915a9c 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -62,6 +62,16 @@ Returns the unsigned minimum angle to the given vector, in radians. + + + + + + + + Returns the derivative at the given [param t] on the [url=https://en.wikipedia.org/wiki/B%C3%A9zier_curve]Bezier curve[/url] defined by this vector and the given [param control_1], [param control_2], and [param end] points. + + -- cgit v1.2.3