Update compute_particles.nzsl

This commit is contained in:
SirLynix 2023-07-21 18:35:34 +02:00
parent 1d3190ac24
commit caaaf606d3
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ fn main(input: Input)
// But want to return to their original position
let dist = length(data.particles[index].targetPosition - data.particles[index].position);
let shouldUseDir = dist < 1.0;
let shouldUseDir = dist > 1.0;
data.particles[index].velocity += 100.0 * sceneData.deltaTime * select(shouldUseDir, normalize(data.particles[index].targetPosition - data.particles[index].position), vec2[f32](0.0, 0.0));
// Lose speed with time