diff options
author | Marc Gilleron <marc.gilleron@gmail.com> | 2017-06-26 23:39:35 +0200 |
---|---|---|
committer | Marc Gilleron <marc.gilleron@gmail.com> | 2017-06-26 23:41:37 +0200 |
commit | 69b8f61f253f950f2b72528ca86a44cff0a77b0d (patch) | |
tree | b7e608a1300cad40bcc21466e440bb1bab2edb67 /scene/3d/particles.cpp | |
parent | b0516e041230223f8de2ce66c4b6a4ab39021770 (diff) | |
download | redot-engine-69b8f61f253f950f2b72528ca86a44cff0a77b0d.tar.gz |
Curve features
- Ability to set tangents as linear
- Indicative min and max values
- CurveTexture doesn't need min and max anymore
Diffstat (limited to 'scene/3d/particles.cpp')
-rw-r--r-- | scene/3d/particles.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index c291aa33ed..edf97bc248 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -1052,16 +1052,11 @@ float ParticlesMaterial::get_param_randomness(Parameter p_param) const { static void _adjust_curve_range(const Ref<Texture> &p_texture, float p_min, float p_max) { - Ref<CurveTexture> curve = p_texture; - if (!curve.is_valid()) + Ref<CurveTexture> curve_tex = p_texture; + if (!curve_tex.is_valid()) return; - if (curve->get_max() == 1.0) { - curve->set_max(p_max); - } - if (curve->get_min() == 0.0) { - curve->set_min(p_min); - } + curve_tex->ensure_default_setup(p_min, p_max); } void ParticlesMaterial::set_param_texture(Parameter p_param, const Ref<Texture> &p_texture) { |