mirror of
https://github.com/godotengine/godot.git
synced 2025-04-25 01:48:08 +08:00
Merge pull request #84575 from rsburke4/fix-cpu-tangent-force
Fix `CPUParticles2D` tangential force does not match `GPUParticles2D`
This commit is contained in:
commit
5d9dce43bb
@ -881,7 +881,7 @@ void CPUParticles2D::_particles_process(double p_delta) {
|
||||
force += diff.length() > 0.0 ? diff.normalized() * (tex_radial_accel)*Math::lerp(parameters_min[PARAM_RADIAL_ACCEL], parameters_max[PARAM_RADIAL_ACCEL], rand_from_seed(alt_seed)) : Vector2();
|
||||
//apply tangential acceleration;
|
||||
Vector2 yx = Vector2(diff.y, diff.x);
|
||||
force += yx.length() > 0.0 ? yx.normalized() * (tex_tangential_accel * Math::lerp(parameters_min[PARAM_TANGENTIAL_ACCEL], parameters_max[PARAM_TANGENTIAL_ACCEL], rand_from_seed(alt_seed))) : Vector2();
|
||||
force += yx.length() > 0.0 ? (yx * Vector2(-1.0, 1.0)).normalized() * (tex_tangential_accel * Math::lerp(parameters_min[PARAM_TANGENTIAL_ACCEL], parameters_max[PARAM_TANGENTIAL_ACCEL], rand_from_seed(alt_seed))) : Vector2();
|
||||
//apply attractor forces
|
||||
p.velocity += force * local_delta;
|
||||
//orbit velocity
|
||||
|
Loading…
x
Reference in New Issue
Block a user