diff --git a/doc/base/classes.xml b/doc/base/classes.xml index e8e5ac00075..24c5799350f 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -8719,14 +8719,18 @@ + Describes a Bezier curve in 2D space. + This class describes a Bezier curve in 2D space. It is mainly used to give a shape to a [Path2D], but can be manually sampled for other purposes. +It keeps a cache of precalculated points along the curve, to speed further calculations up. + Returns the number of points describing the curve. @@ -8739,6 +8743,8 @@ + Adds a point to a curve, at position "pos", with control points "in" and "out". +If "atpos" is given, the point is inserted before the point number "atpos", moving that point (and every point after) after the inserted point. If "atpos" is not given, or is an illegal value (atpos <0 or atpos >= [method get_point_count]), the point will be appended at the end of the point list. @@ -8747,6 +8753,7 @@ + Sets the position for the vertex "idx". If the index is out of bounds, the function sends an error to the console. @@ -8755,6 +8762,7 @@ + Returns the position of the vertex "idx". If the index is out of bounds, the function sends an error to the console, and returns (0, 0). @@ -8763,6 +8771,7 @@ + Sets the position of the control point leading to the vertex "idx". If the index is out of bounds, the function sends an error to the console. @@ -8771,6 +8780,7 @@ + Returns the position of the control point leading to the vertex "idx". If the index is out of bounds, the function sends an error to the console, and returns (0, 0). @@ -8779,6 +8789,7 @@ + Sets the position of the control point leading out of the vertex "idx". If the index is out of bounds, the function sends an error to the console. @@ -8787,12 +8798,14 @@ + Returns the position of the control point leading out of the vertex "idx". If the index is out of bounds, the function sends an error to the console, and returns (0, 0). + Deletes the point "idx" from the curve. Sends an error to the console if "idx" is out of bounds. @@ -8803,6 +8816,8 @@ + Returns the position between the vertex "idx" and the vertex "idx"+1, where "t" controls if the point is the first vertex (t = 0.0), the last vertex (t = 1.0), or in between. Values of "t" outside the range (0.0 >= t <=1) give strange, but predictable results. +If "idx" is out of bounds it is truncated to the first or last vertex, and "t" is ignored. If the curve has no points, the function sends an error to the console, and returns (0, 0). @@ -8811,24 +8826,28 @@ + Returns the position at the vertex "fofs". It calls [method interpolate] using the integer part of fofs as "idx", and its fractional part as "t". + Sets the distance in pixels between two adjacent cached points. Changing it forces the cache to be recomputed the next time a xxx_baked_xxx function is called. The less distance, the more points the cache will have, and the more memory it will consume, so use with care. + Returns the distance between two adjacent cached points. + Returns the total length of the curve, based on the cached points. Given enough density (see [method set_bake_interval]), it should be approximate enough. @@ -8839,12 +8858,30 @@ + Returns a point within the curve at position "offset", where "offset" is measured as a pixel distance along the curve. +To do that, it finds the two cached points where the "offset" lies between, then interpolates the values. This interpolation is cubic if "cubic" is set to true, or linear if set to false. +Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough). + Returns the cache of points as a [Vector2Array]. + + + + + + + + + + + Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. +This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. +"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! +"tolerance_degrees" controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. @@ -8863,14 +8900,18 @@ + Describes a Bezier curve in 3D space. + This class describes a Bezier curve in 3D space. It is mainly used to give a shape to a [Path], but can be manually sampled for other purposes. +It keeps a cache of precalculated points along the curve, to speed further calculations up. + Returns the number of points describing the curve. @@ -8883,6 +8924,8 @@ + Adds a point to a curve, at position "pos", with control points "in" and "out". +If "atpos" is given, the point is inserted before the point number "atpos", moving that point (and every point after) after the inserted point. If "atpos" is not given, or is an illegal value (atpos <0 or atpos >= [method get_point_count]), the point will be appended at the end of the point list. @@ -8891,6 +8934,7 @@ + Sets the position for the vertex "idx". If the index is out of bounds, the function sends an error to the console. @@ -8899,6 +8943,7 @@ + Returns the position of the vertex "idx". If the index is out of bounds, the function sends an error to the console, and returns (0, 0, 0). @@ -8907,6 +8952,8 @@ + Sets the tilt angle in radians for the point "idx". If the index is out of bounds, the function sends an error to the console. +The tilt controls the rotation along the look-at axis an object travelling the path would have. In the case of a curve controlling a [PathFollow], this tilt is an offset over the natural tilt the PathFollow calculates. @@ -8915,6 +8962,7 @@ + Returns the tilt angle in radians for the point "idx". If the index is out of bounds, the function sends an error to the console, and returns 0. @@ -8923,6 +8971,7 @@ + Sets the position of the control point leading to the vertex "idx". If the index is out of bounds, the function sends an error to the console. @@ -8931,6 +8980,7 @@ + Returns the position of the control point leading to the vertex "idx". If the index is out of bounds, the function sends an error to the console, and returns (0, 0, 0). @@ -8939,6 +8989,7 @@ + Sets the position of the control point leading out of the vertex "idx". If the index is out of bounds, the function sends an error to the console. @@ -8947,12 +8998,14 @@ + Returns the position of the control point leading out of the vertex "idx". If the index is out of bounds, the function sends an error to the console, and returns (0, 0, 0). + Deletes the point "idx" from the curve. Sends an error to the console if "idx" is out of bounds. @@ -8963,6 +9016,8 @@ + Returns the position between the vertex "idx" and the vertex "idx"+1, where "t" controls if the point is the first vertex (t = 0.0), the last vertex (t = 1.0), or in between. Values of "t" outside the range (0.0 >= t <=1) give strange, but predictable results. +If "idx" is out of bounds it is truncated to the first or last vertex, and "t" is ignored. If the curve has no points, the function sends an error to the console, and returns (0, 0, 0). @@ -8971,24 +9026,28 @@ + Returns the position at the vertex "fofs". It calls [method interpolate] using the integer part of fofs as "idx", and its fractional part as "t". + Sets the distance in 3D units between two adjacent cached points. Changing it forces the cache to be recomputed the next time a xxx_baked_xxx function is called. The less distance, the more points the cache will have, and the more memory it will consume, so use with care. + Returns the distance between two adjacent cached points. + Returns the total length of the curve, based on the cached points. Given enough density (see [method set_bake_interval]), it should be approximate enough. @@ -8999,18 +9058,37 @@ + Returns a point within the curve at position "offset", where "offset" is measured as a distance in 3D units along the curve. +To do that, it finds the two cached points where the "offset" lies between, then interpolates the values. This interpolation is cubic if "cubic" is set to true, or linear if set to false. +Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough). + Returns the cache of points as a [Vector3Array]. + Returns the cache of tilts as a [RealArray]. + + + + + + + + + + + Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. +This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. +"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! +"tolerance_degrees" controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. @@ -21294,20 +21372,24 @@ + Container for a [Curve3D]. + This class is a container/Node-ification of a [Curve3D], so it can have [Spatial] properties and [Node] info. + Sets the [Curve3D]. + Returns the [Curve3D] contained. @@ -21316,20 +21398,24 @@ + Container for a [Curve2D]. + This class is a container/Node-ification of a [Curve2D], so it can have [Node2D] properties and [Node] info. + Sets the [Curve2D]. + Returns the [Curve2D] contained. @@ -21338,197 +21424,245 @@ + Point sampler for a [Path]. + This node takes its parent [Path], and returns the coordinates of a point within it, given a distance from the first vertex. +It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be descendants of this node. Then, when setting an offset in this node, the descendant nodes will move accordingly. + Sets the distance from the first vertex, measured in 3D units along the path. This sets this node's position to a point within the path. + Returns the distance along the path in 3D units. + Moves this node in the X axis. As this node's position will be set every time its offset is set, this allows many PathFollow to share the same curve (and thus the same movement pattern), yet not return the same position for a given path offset. +A similar effect may be achieved moving the this node's descendants. + Returns the X displacement this node has from its parent [Path]. + Moves this node in the Y axis, for the same reasons of [method set_h_offset]. + Returns the Y displacement this node has from its parent [Path]. + Sets the distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the offset within the path, as the offset supplied is multiplied internally by the path's length. + Returns the distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last). + Allows or forbids rotation on one or more axes, per the constants below. + Returns the rotation mode. The constants below list which axes are allowed to rotate for each mode. + The points along the [Curve3D] of the [Path] are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. +There are two answers to this problem: Either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. +This method controls whether the position between two cached points is interpolated linearly, or cubicly. + This method returns whether the position between two cached points (see [method set_cubic_interpolation]) is interpolated linearly, or cubicly. + If set, any offset outside the path's length (whether set by [method set_offset] or [method set_unit_offset] will wrap around, instead of stopping at the ends. Set it for cyclic paths. + Returns whether this node wraps its offsets around, or truncates them to the path ends. + Forbids the PathFollow to rotate. + Allows the PathFollow to rotate in the Y axis only. + Allows the PathFollow to rotate in both the X, and Y axes. + Allows the PathFollow to rotate in any axis. + Point sampler for a [Path2D]. + This node takes its parent [Path2D], and returns the coordinates of a point within it, given a distance from the first vertex. +It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be descendants of this node. Then, when setting an offset in this node, the descendant nodes will move accordingly. + Sets the distance from the first vertex, measured in pixels along the path. This sets this node's position to a point within the path. + Returns the distance along the path in pixels. + Moves this node horizontally. As this node's position will be set every time its offset is set, this allows many PathFollow2D to share the same curve (and thus the same movement pattern), yet not return the same position for a given path offset. +A similar effect may be achieved moving this node's descendants. + Returns the horizontal displacement this node has from its parent [Path2D]. + Moves the PathFollow2D vertically, for the same reasons of [method set_h_offset]. + Returns the vertical displacement this node has from its parent [Path2D]. + Sets the distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the offset within the path, as the offset supplied is multiplied internally by the path's length. + Returns the distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last). + If set, this node rotates to follow the path, making its descendants rotate. + Returns whether this node rotates to follow the path. + The points along the [Curve2D] of the [Path2D] are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. +There are two answers to this problem: Either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. +This method controls whether the position between two cached points is interpolated linearly, or cubicly. + This method returns whether the position between two cached points (see [method set_cubic_interpolation]) is interpolated linearly, or cubicly. + If set, any offset outside the path's length (whether set by [method set_offset] or [method set_unit_offset] will wrap around, instead of stopping at the ends. Set it for cyclic paths. + Returns whether this node wraps its offsets around, or truncates them to the path ends. + + + +