Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

Curve

Inherits: Resource < RefCounted < Object

A mathematical curve.

Description

This resource describes a mathematical curve by defining a set of points and tangents at each point. By default, it ranges between 0 and 1 on the Y axis and positions points relative to the 0.5 Y position.

See also Gradient which is designed for color interpolation. See also Curve2D and Curve3D.

Properties

int

bake_resolution

100

float

max_value

1.0

float

min_value

0.0

int

point_count

0

Methods

int

add_point ( Vector2 position, float left_tangent=0, float right_tangent=0, TangentMode left_mode=0, TangentMode right_mode=0 )

void

bake ( )

void

clean_dupes ( )

void

clear_points ( )

TangentMode

get_point_left_mode ( int index ) const

float

get_point_left_tangent ( int index ) const

Vector2

get_point_position ( int index ) const

TangentMode

get_point_right_mode ( int index ) const

float

get_point_right_tangent ( int index ) const

void

remove_point ( int index )

float

sample ( float offset ) const

float

sample_baked ( float offset ) const

void

set_point_left_mode ( int index, TangentMode mode )

void

set_point_left_tangent ( int index, float tangent )

int

set_point_offset ( int index, float offset )

void

set_point_right_mode ( int index, TangentMode mode )

void