A mathematical curve.
This resource describes a mathematical curve by defining a set of points and tangents at each point. By default, it ranges between [code]0[/code] and [code]1[/code] on the X and Y axes, but these ranges can be changed.
Please note that many resources and nodes assume they are given [i]unit curves[/i]. A unit curve is a curve whose domain (the X axis) is between [code]0[/code] and [code]1[/code]. Some examples of unit curve usage are [member CPUParticles2D.angle_curve] and [member Line2D.width_curve].
Adds a point to the curve. For each side, if the [code]*_mode[/code] is [constant TANGENT_LINEAR], the [code]*_tangent[/code] angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the [code]*_tangent[/code] angle if [code]*_mode[/code] is set to [constant TANGENT_FREE].
Recomputes the baked cache of points for the curve.
Removes duplicate points, i.e. points that are less than 0.00001 units (engine epsilon value) away from their neighbor on the curve.
Removes all points from the curve.
Returns the difference between [member min_domain] and [member max_domain].
Returns the left [enum TangentMode] for the point at [param index].
Returns the left tangent angle (in degrees) for the point at [param index].
Returns the curve coordinates for the point at [param index].
Returns the right [enum TangentMode] for the point at [param index].
Returns the right tangent angle (in degrees) for the point at [param index].
Returns the difference between [member min_value] and [member max_value].
Removes the point at [param index] from the curve.
Returns the Y value for the point that would exist at the X position [param offset] along the curve.
Returns the Y value for the point that would exist at the X position [param offset] along the curve using the baked cache. Bakes the curve's points if not already baked.
Sets the left [enum TangentMode] for the point at [param index] to [param mode].
Sets the left tangent angle for the point at [param index] to [param tangent].
Sets the offset from [code]0.5[/code].
Sets the right [enum TangentMode] for the point at [param index] to [param mode].
Sets the right tangent angle for the point at [param index] to [param tangent].
Assigns the vertical position [param y] to the point at [param index].
The number of points to include in the baked (i.e. cached) curve data.
The maximum domain (x-coordinate) that points can have.
The maximum value (y-coordinate) that points can have. Tangents can cause higher values between points.
The minimum domain (x-coordinate) that points can have.
The minimum value (y-coordinate) that points can have. Tangents can cause lower values between points.
The number of points describing the curve.
Emitted when [member max_domain] or [member min_domain] is changed.
Emitted when [member max_value] or [member min_value] is changed.
The tangent on this side of the point is user-defined.
The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point.
The total number of available tangent modes.