Skip to content

Commit

Permalink
Fixing movement ratio for #180
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Sep 30, 2021
1 parent 8bba72b commit f4494c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/common/model/PairGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class PairGroup {
const offset = idealDistanceFromCenter - distance;

// just modify position for now so we don't get any oscillations
let ratioOfMovement = Math.pow( 0.1, 0.016 / timeElapsed ); // scale this exponentially by how much time has elapsed, so the more time taken, the faster we move towards the ideal distance
let ratioOfMovement = Math.min( 0.1 * timeElapsed / 0.016, 1 );
if ( isTerminalLonePair ) {
ratioOfMovement = 1;
}
Expand Down

0 comments on commit f4494c2

Please sign in to comment.