diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-04-25 16:03:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 16:03:28 +0200 |
commit | 30aeffd0c494fc440636f0699698cd67b8cd26ef (patch) | |
tree | 34794e82e0a4ee9bbad645ed7783b13bb67c9992 | |
parent | fbfecc1deaa23c253cb203d4e66e307fb67f6766 (diff) | |
parent | f603c750352ecb384f4c74f067d926061498e699 (diff) |
Merge pull request #60491 from RedHeadphone/master
Correct initial cpu particle velocity
-rw-r--r-- | scene/2d/cpu_particles_2d.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index bad1488d5a..24c66622f1 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -743,7 +743,7 @@ void CPUParticles2D::_particles_process(double p_delta) { real_t angle1_rad = direction.angle() + Math::deg2rad((Math::randf() * 2.0 - 1.0) * spread); Vector2 rot = Vector2(Math::cos(angle1_rad), Math::sin(angle1_rad)); - p.velocity = rot * Math::lerp(parameters_min[PARAM_INITIAL_LINEAR_VELOCITY], parameters_min[PARAM_INITIAL_LINEAR_VELOCITY], (real_t)Math::randf()); + p.velocity = rot * Math::lerp(parameters_min[PARAM_INITIAL_LINEAR_VELOCITY], parameters_max[PARAM_INITIAL_LINEAR_VELOCITY], (real_t)Math::randf()); real_t base_angle = tex_angle * Math::lerp(parameters_min[PARAM_ANGLE], parameters_max[PARAM_ANGLE], p.angle_rand); p.rotation = Math::deg2rad(base_angle); |