Curve

A mathematic curve.

A curve that can be saved and re-used for other objects. By default, it ranges between 0 and 1 on the Y axis and positions points relative to the 0.5 Y position.

@GodotBaseClass
struct Curve {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants
TangentMode
enum TangentMode

Functions

_getData
Array _getData()
_setData
void _setData(Array data)
addPoint
long addPoint(Vector2 position, double left_tangent, double right_tangent, long left_mode, long right_mode)

Adds a point to the curve. For each side, if the *_mode is constant TANGENT_LINEAR, the *_tangent angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the *_tangent angle if *_mode is set to constant TANGENT_FREE.

bake
void bake()

Recomputes the baked cache of points for the curve.

cleanDupes
void cleanDupes()

Removes points that are closer than CMP_EPSILON (0.00001) units to their neighbor on the curve.

clearPoints
void clearPoints()

Removes all points from the curve.

getBakeResolution
long getBakeResolution()
getMaxValue
double getMaxValue()
getMinValue
double getMinValue()
getPointCount
long getPointCount()

Returns the number of points describing the curve.

getPointLeftMode
Curve.TangentMode getPointLeftMode(long index)

Returns the left tangentmode for the point at index.

getPointLeftTangent
double getPointLeftTangent(long index)

Returns the left tangent angle (in degrees) for the point at index.

getPointPosition
Vector2 getPointPosition(long index)

Returns the curve coordinates for the point at index.

getPointRightMode
Curve.TangentMode getPointRightMode(long index)

Returns the right tangentmode for the point at index.

getPointRightTangent
double getPointRightTangent(long index)

Returns the right tangent angle (in degrees) for the point at index.

interpolate
double interpolate(double offset)

Returns the Y value for the point that would exist at the X position offset along the curve.

interpolateBaked
double interpolateBaked(double offset)

Returns the Y value for the point that would exist at the X position offset along the curve using the baked cache. Bakes the curve's points if not already baked.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(Curve other)
opEquals
bool opEquals(typeof(null) n)
removePoint
void removePoint(long index)

Removes the point at index from the curve.

setBakeResolution
void setBakeResolution(long resolution)
setMaxValue
void setMaxValue(double max)
setMinValue
void setMinValue(double min)
setPointLeftMode
void setPointLeftMode(long index, long mode)

Sets the left tangentmode for the point at index to mode.

setPointLeftTangent
void setPointLeftTangent(long index, double tangent)

Sets the left tangent angle for the point at index to tangent.

setPointOffset
long setPointOffset(long index, double offset)

Sets the offset from 0.5.

setPointRightMode
void setPointRightMode(long index, long mode)

Sets the right tangentmode for the point at index to mode.

setPointRightTangent
void setPointRightTangent(long index, double tangent)

Sets the right tangent angle for the point at index to tangent.

setPointValue
void setPointValue(long index, double y)

Assigns the vertical position y to the point at index.

toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

_data
Array _data [@property getter]
Array _data [@property setter]
bakeResolution
long bakeResolution [@property getter]
long bakeResolution [@property setter]

The number of points to include in the baked (i.e. cached) curve data.

maxValue
double maxValue [@property getter]
double maxValue [@property setter]

The maximum value the curve can reach.

minValue
double minValue [@property getter]
double minValue [@property setter]

The minimum value the curve can reach.

Static functions

_new
Curve _new()

Construct a new instance of Curve. Note: use memnew!Curve instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta