From c16481bdf191eeee44d90beef595bf6fbebb9dae Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Wed, 6 May 2020 16:12:34 -0600 Subject: [PATCH] Remapping tension in the model into the 0.2-0.8 range, see https://github.com/phetsims/wave-on-a-string/issues/116 --- js/wave-on-a-string/model/WOASModel.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/wave-on-a-string/model/WOASModel.js b/js/wave-on-a-string/model/WOASModel.js index fec8459..4650977 100644 --- a/js/wave-on-a-string/model/WOASModel.js +++ b/js/wave-on-a-string/model/WOASModel.js @@ -106,8 +106,8 @@ class WOASModel extends PhetioObject { } ); // @public {Property.} - this.tensionProperty = new NumberProperty( 2, { - range: new Range( 0, 2 ), + this.tensionProperty = new NumberProperty( 0.8, { + range: new Range( 0.2, 0.8 ), tandem: tandem.createTandem( 'tensionProperty' ), phetioDocumentation: 'the relative amount of tension on the string' } ); @@ -344,7 +344,7 @@ class WOASModel extends PhetioObject { const perStepDelta = numSteps ? ( ( this.nextLeftYProperty.value - startingLeftY ) / numSteps ) : 0; //dt for tension effect - const minDt = ( 1 / ( FRAMES_PER_SECOND * ( 0.2 + this.tensionProperty.value * 0.4 ) * speedMultiplier ) ); + const minDt = ( 1 / ( FRAMES_PER_SECOND * ( ( this.tensionProperty.value - 0.2 ) * ( 0.8 / 0.6 ) + 0.2 ) * speedMultiplier ) ); // limit max dt while ( dt >= fixDt ) { this.timeProperty.value = this.timeProperty.value + fixDt;