diff options
author | RedHeadphone <huzaifa.k@somaiya.edu> | 2022-04-24 14:50:42 +0530 |
---|---|---|
committer | RedHeadphone <huzaifa.k@somaiya.edu> | 2022-04-24 14:50:42 +0530 |
commit | f603c750352ecb384f4c74f067d926061498e699 (patch) | |
tree | 6964ee627ba4c6db0acfb517a1624359a96904e6 | |
parent | 01f184178b6cbb5ba6199898f6296fb03aa37d0e (diff) |
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); |