diff options
| author | Juan Linietsky | 2017-06-27 21:46:43 -0300 |
|---|---|---|
| committer | GitHub | 2017-06-27 21:46:43 -0300 |
| commit | aaf6ae3f15b048017650905da85cb36780d1fce3 (patch) | |
| tree | 11a6233a484268ec7b7b2cd061a174bb6a857d87 /scene/resources/curve.h | |
| parent | 6fd4311c27625a5c725fcf525bbbf04fbbf9c56f (diff) | |
| parent | 6c1ab2098f5f399cc1ef09c7759604c5c671b4e7 (diff) | |
| download | godot-aaf6ae3.tar.gz godot-aaf6ae3.tar.zst godot-aaf6ae3.zip | |
Merge pull request #9425 from Zylann/curve_iteration3
Fix curve saving, refined undo/redo
Diffstat (limited to 'scene/resources/curve.h')
| -rw-r--r-- | scene/resources/curve.h | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/scene/resources/curve.h b/scene/resources/curve.h index d45f9e202..83a4357bf 100644 --- a/scene/resources/curve.h +++ b/scene/resources/curve.h @@ -91,10 +91,6 @@ public: static const char *SIGNAL_RANGE_CHANGED; -#ifdef TOOLS_ENABLED - bool _disable_set_data; -#endif - enum TangentMode { TANGENT_FREE = 0, TANGENT_LINEAR, @@ -115,12 +111,17 @@ public: right_mode = TANGENT_FREE; } - Point(Vector2 p, real_t left = 0, real_t right = 0) { - pos = p; - left_tangent = left; - right_tangent = right; - left_mode = TANGENT_FREE; - right_mode = TANGENT_FREE; + Point(Vector2 p_pos, + real_t p_left = 0, + real_t p_right = 0, + TangentMode p_left_mode = TANGENT_FREE, + TangentMode p_right_mode = TANGENT_FREE) { + + pos = p_pos; + left_tangent = p_left; + right_tangent = p_right; + left_mode = p_left_mode; + right_mode = p_right_mode; } }; @@ -128,7 +129,12 @@ public: int get_point_count() const { return _points.size(); } - int add_point(Vector2 p_pos, real_t left_tangent = 0, real_t right_tangent = 0); + int add_point(Vector2 p_pos, + real_t left_tangent = 0, + real_t right_tangent = 0, + TangentMode left_mode = TANGENT_FREE, + TangentMode right_mode = TANGENT_FREE); + void remove_point(int p_index); void clear_points(); @@ -138,6 +144,8 @@ public: int set_point_offset(int p_index, float offset); Vector2 get_point_pos(int p_index) const; + Point get_point(int p_index) const; + float get_min_value() const { return _min_value; } void set_min_value(float p_min); |
