Skip to content

Commit

Permalink
Remapping tension in the model into the 0.2-0.8 range, see #116
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed May 6, 2020
1 parent c453d3a commit c16481b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/wave-on-a-string/model/WOASModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ class WOASModel extends PhetioObject {
} );

// @public {Property.<number>}
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'
} );
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c16481b

Please sign in to comment.