class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectRefCountedResource Curve
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 0 and 1 on the X and Y axes, but these ranges can be changed.

Please note that many resources and nodes assume they are given unit curves. A unit curve is a curve whose domain (the X axis) is between 0 and 1. Some examples of unit curve usage are CPUParticles2D.angle_curve and Line2D.width_curve.

Signal domain_changed<>():Signal

Emitted when max_domain or min_domain is changed.

Signal range_changed<>():Signal

Emitted when max_value or min_value is changed.

Enum TangentMode<>():Enum

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.

int bake_resolution<>():int

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

float max_domain<>():float

The maximum domain (x-coordinate) that points can have.

float max_value<>():float

The maximum value (y-coordinate) that points can have. Tangents can cause higher values between points.

float min_domain<>():float

The minimum domain (x-coordinate) that points can have.

float min_value<>():float

The minimum value (y-coordinate) that points can have. Tangents can cause lower values between points.

int point_count<>():int

The number of points describing the curve.

int add_point<>( Vector2 position=, position:Vector2=, float left_tangent=0, left_tangent:float=0, float right_tangent=0, right_tangent:float=0, TangentMode left_mode=0, left_mode:TangentMode=0, TangentMode right_mode=0, right_mode:TangentMode=0, ):int

Adds a point to the curve. For each side, if the *_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.

void bake<>():void

Recomputes the baked cache of points for the curve.

void clean_dupes<>():void

Removes duplicate points, i.e. points that are less than 0.00001 units (engine epsilon value) away from their neighbor on the curve.

void clear_points<>():void

Removes all points from the curve.

float get_domain_range<>():float

Returns the difference between min_domain and max_domain.

TangentMode get_point_left_mode<>( int index=, index:int=, ):TangentMode

Returns the left TangentMode for the point at index.

float get_point_left_tangent<>( int index=, index:int=, ):float

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

Vector2 get_point_position<>( int index=, index:int=, ):Vector2

Returns the curve coordinates for the point at index.

TangentMode get_point_right_mode<>( int index=, index:int=, ):TangentMode

Returns the right TangentMode for the point at index.

float get_point_right_tangent<>( int index=, index:int=, ):float

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

float get_value_range<>():float

Returns the difference between min_value and max_value.

void remove_point<>( int index=, index:int=, ):void

Removes the point at index from the curve.

float sample<>( float offset=, offset:float=, ):float

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

float sample_baked<>( float offset=, offset:float=, ):float

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.

void set_point_left_mode<>( int index=, index:int=, TangentMode mode=, mode:TangentMode=, ):void

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

void set_point_left_tangent<>( int index=, index:int=, float tangent=, tangent:float=, ):void

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

int set_point_offset<>( int index=, index:int=, float offset=, offset:float=, ):int

Sets the offset from 0.5.

void set_point_right_mode<>( int index=, index:int=, TangentMode mode=, mode:TangentMode=, ):void

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

void set_point_right_tangent<>( int index=, index:int=, float tangent=, tangent:float=, ):void

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

void set_point_value<>( int index=, index:int=, float y=, y:float=, ):void

Assigns the vertical position y to the point at index.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...