Curve

Inherits: Resource < Reference < Object A mathematic curve.

Description

0 and 1 on the Y axis and positions points relative to the 0.5 Y position.

Properties

Methods

Signals

  • range_changed ( ) max_value or min_value is changed.

    Enumerations

    TangentMode:
  • TANGENT_FREE = 0 —- The tangent on this side of the point is user-defined.
  • TANGENT_LINEAR = 1 —- The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point.
  • TANGENT_MODE_COUNT = 2 —- The total number of available tangent modes.

    Property Descriptions

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

  • float max_value The maximum value the curve can reach.

  • float min_value The minimum value the curve can reach.

    Method Descriptions

  • int add_point ( Vector2 position, float left_tangent=0, float right_tangent=0, TangentMode left_mode=0, TangentMode right_mode=0 ) *_mode is 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 TANGENT_FREE.

  • bake ( ) Recomputes the baked cache of points for the curve.

  • clean_dupes ( ) CMP_EPSILON (0.00001) units to their neighbor on the curve.

  • clear_points ( ) Removes all points from the curve.

  • int get_point_count ( ) const Returns the number of points describing the curve.

  • TangentMode get_point_left_mode ( int index ) const TangentMode for the point at index.

  • float get_point_left_tangent ( int index ) const index.

  • Vector2 get_point_position ( int index ) const index.

  • TangentMode get_point_right_mode ( int index ) const TangentMode for the point at index.

  • float get_point_right_tangent ( int index ) const index.

  • float interpolate ( float offset ) const offset along the curve.

  • float interpolate_baked ( float offset ) offset along the curve using the baked cache. Bakes the curve’s points if not already baked.

  • remove_point ( int index ) index from the curve.

  • set_point_left_mode ( int index, TangentMode mode ) TangentMode for the point at index to mode.

  • set_point_left_tangent ( int index, float tangent ) index to tangent.

  • int set_point_offset ( int index, float offset ) 0.5.

  • set_point_right_mode ( int index, TangentMode mode ) TangentMode for the point at index to mode.

  • set_point_right_tangent ( int index, float tangent ) index to tangent.

  • set_point_value ( int index, float y ) y to the point at index.