diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-06-27 07:53:52 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-27 07:53:52 -0300 |
commit | 51442988b19d28be551c6ace75c57b50856ed2ad (patch) | |
tree | 587884f0efba28fb33431ad993277f70ff066a2c /scene/3d | |
parent | 070384c9c9bcf5df5a85a4d786a29dc07ce40084 (diff) | |
parent | 69b8f61f253f950f2b72528ca86a44cff0a77b0d (diff) |
Merge pull request #9404 from Zylann/curve_improvement
Curve improvement
Diffstat (limited to 'scene/3d')
-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) { |