diff options
author | Marc Gilleron <marc.gilleron@gmail.com> | 2017-04-30 16:27:10 +0200 |
---|---|---|
committer | Marc Gilleron <marc.gilleron@gmail.com> | 2017-06-24 01:01:36 +0200 |
commit | 659897cfb8bda0377d798a6f73505d537e521cf9 (patch) | |
tree | db94c76d34d51e9ec97213a08c9654825707fad4 /scene/3d/particles.cpp | |
parent | 00e5ba314393ce2cc4df883bc1742306007ed117 (diff) | |
download | redot-engine-659897cfb8bda0377d798a6f73505d537e521cf9.tar.gz |
Added Curve resource
- New resource for curves in y(x) form
- CurveTexture now has a Curve
- Curve and CurveTexture share the same editor
Diffstat (limited to 'scene/3d/particles.cpp')
-rw-r--r-- | scene/3d/particles.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 8508962521..722b698b75 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -1082,16 +1082,9 @@ void ParticlesMaterial::set_param_texture(Parameter p_param, const Ref<Texture> case PARAM_SCALE: { VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->scale_texture, p_texture); - Ref<CurveTexture> curve = p_texture; - if (curve.is_valid()) { - if (curve->get_min() == 0 && curve->get_max() == 1) { - - curve->set_max(32); - PoolVector<Vector2> points; - points.push_back(Vector2(0, 1)); - points.push_back(Vector2(1, 1)); - curve->set_points(points); - } + Ref<CurveTexture> curve_tex = p_texture; + if (curve_tex.is_valid()) { + curve_tex->ensure_default_setup(); } } break; @@ -1257,14 +1250,7 @@ void ParticlesMaterial::set_trail_size_modifier(const Ref<CurveTexture> &p_trail Ref<CurveTexture> curve = trail_size_modifier; if (curve.is_valid()) { - if (curve->get_min() == 0 && curve->get_max() == 1) { - - curve->set_max(32); - PoolVector<Vector2> points; - points.push_back(Vector2(0, 1)); - points.push_back(Vector2(1, 1)); - curve->set_points(points); - } + curve->ensure_default_setup(); } RID texture; |