Skip to content

Commit

Permalink
Convert LinearFunction to a class with an evaluate method, see phetsi…
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 2, 2021
1 parent 0974e75 commit 2bb2cb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class BalloonRubbingSoundGenerator extends NoiseGenerator {
}

// Set the output level.
this.setOutputLevel( MAP_DRAG_SPEED_TO_OUTPUT_LEVEL( smoothedDragVelocity.magnitude ) * options.maxOutputLevel );
this.setOutputLevel( MAP_DRAG_SPEED_TO_OUTPUT_LEVEL.evaluate( smoothedDragVelocity.magnitude ) * options.maxOutputLevel );

// Set the pitch based on the direction in which the balloon is being dragged.
const dragVelocity = dragVelocityProperty.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class BalloonVelocitySoundGenerator extends SoundClip {
const speed = balloonVelocity.magnitude;
if ( speed > 0 && !touchingWall ) {

const targetPlaybackRate = mapSpeedToPlaybackRate( speed );
const targetOutputLevel = mapSpeedToOutputLevel( speed, 0.1 ) * options.maxOutputLevel;
const targetPlaybackRate = mapSpeedToPlaybackRate.evaluate( speed );
const targetOutputLevel = mapSpeedToOutputLevel.evaluate( speed, 0.1 ) * options.maxOutputLevel;

if ( !this.isPlaying ) {

Expand Down

0 comments on commit 2bb2cb1

Please sign in to comment.