diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-07-06 20:21:13 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-07-06 20:21:42 -0300 |
commit | 7dcaabaf1989f0e4d6957ca123df522c805ac57a (patch) | |
tree | 7099b9650d72b8820950a5662f6db1ad9956654a /scene/resources/curve.cpp | |
parent | e19388df97743939efd0cfda3dae6de2db393897 (diff) |
Support for CPU based particles, which aids compatibility with OpenGL ES 2.0
Diffstat (limited to 'scene/resources/curve.cpp')
-rw-r--r-- | scene/resources/curve.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index 7f902fc982..f2fd919f20 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -479,6 +479,16 @@ real_t Curve::interpolate_baked(real_t offset) { } } +void Curve::ensure_default_setup(float p_min, float p_max) { + if (_points.size() == 0 && _min_value == 0 && _max_value == 1) { + + add_point(Vector2(0, 1)); + add_point(Vector2(1, 1)); + set_min_value(p_min); + set_max_value(p_max); + } +} + void Curve::_bind_methods() { ClassDB::bind_method(D_METHOD("add_point", "position", "left_tangent", "right_tangent", "left_mode", "right_mode"), &Curve::add_point, DEFVAL(0), DEFVAL(0), DEFVAL(TANGENT_FREE), DEFVAL(TANGENT_FREE)); |