bugfix: ensure finite speed when force is infinite
This commit is contained in:
parent
bf0c9f72a0
commit
b10bed8954
1 changed files with 2 additions and 2 deletions
|
@ -24,9 +24,9 @@ function move_particles(particles, force_constant) {
|
|||
} else {
|
||||
ai = displacement.copy().normalize();
|
||||
aj = ai.copy().mult(-1);
|
||||
ai.mult(ai_mag);
|
||||
aj.mult(aj_mag);
|
||||
}
|
||||
ai.mult(ai_mag);
|
||||
aj.mult(aj_mag);
|
||||
project_onto_plane(ai, particles[i].position);
|
||||
project_onto_plane(aj, particles[j].position);
|
||||
particles[i].acceleration.add(ai);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue