diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-11-28 14:08:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-28 14:08:50 +0100 |
commit | 06db076fc6c49fb585e753bd327ce1a80b0bf7d5 (patch) | |
tree | 019e3bf7661e3faa67dcf501511ff9d07349bb1d /scene/3d/cpu_particles.cpp | |
parent | 39028cc161048ffccd0fae8677c523da648311a5 (diff) | |
parent | cb01268562a47e6a1c32559f58fbadd46e52d304 (diff) |
Merge pull request #24025 from aaronfranke/analyzer-errors
Fix many errors found by PVS-Studio
Diffstat (limited to 'scene/3d/cpu_particles.cpp')
-rw-r--r-- | scene/3d/cpu_particles.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp index 8b4d201083..1269cef7c2 100644 --- a/scene/3d/cpu_particles.cpp +++ b/scene/3d/cpu_particles.cpp @@ -691,7 +691,7 @@ void CPUParticles::_particles_process(float p_delta) { if (flags[FLAG_DISABLE_Z]) { p.velocity.z = 0.0; - p.velocity.z = 0.0; + p.transform.origin.z = 0.0; } } else if (!p.active) { @@ -757,15 +757,15 @@ void CPUParticles::_particles_process(float p_delta) { } Vector3 force = gravity; - Vector3 pos = p.transform.origin; + Vector3 position = p.transform.origin; if (flags[FLAG_DISABLE_Z]) { - pos.z = 0.0; + position.z = 0.0; } //apply linear acceleration force += p.velocity.length() > 0.0 ? p.velocity.normalized() * (parameters[PARAM_LINEAR_ACCEL] + tex_linear_accel) * Math::lerp(1.0f, rand_from_seed(alt_seed), randomness[PARAM_LINEAR_ACCEL]) : Vector3(); //apply radial acceleration Vector3 org = emission_xform.origin; - Vector3 diff = pos - org; + Vector3 diff = position - org; force += diff.length() > 0.0 ? diff.normalized() * (parameters[PARAM_RADIAL_ACCEL] + tex_radial_accel) * Math::lerp(1.0f, rand_from_seed(alt_seed), randomness[PARAM_RADIAL_ACCEL]) : Vector3(); //apply tangential acceleration; if (flags[FLAG_DISABLE_Z]) { |