phetsims / hookes-law

"Hooke's Law" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 4 forks source link

Missing Arm #25

Closed phet-steele closed 8 years ago

phet-steele commented 8 years ago

While nosing around in this sim, I saw on the intro screen that switching from two arms to one, then back to two again quickly while the fade out animation is still occurring, the second arm doesn't come back:

missing limb

Troubleshooting information (do not edit): Name: ‪Hooke's Law‬ URL: http://www.colorado.edu/physics/phet/dev/html/hookes-law/1.0.0-dev.29/hookes-law_en.html Version: 1.0.0-dev.29 2015-09-02 17:09:44 UTC Features missing: touch User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0 Language: en-US Window: 1366x633 Pixel Ratio: 1/1 WebGL: WebGL 1.0 GLSL: WebGL GLSL ES 1.0 Vendor: Mozilla (Mozilla) Vertex: attribs: 16 varying: 28 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 32767x32767 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"858e65ac","branch":"master"},"axon":{"sha":"1db622f9","branch":"master"},"babel":{"sha":"696f7588","branch":"master"},"brand":{"sha":"f2c42d7b","branch":"master"},"chipper":{"sha":"e0747524","branch":"master"},"dot":{"sha":"e34c6b2c","branch":"master"},"hookes-law":{"sha":"12486758","branch":"master"},"joist":{"sha":"27d92033","branch":"master"},"kite":{"sha":"24978146","branch":"master"},"phet-core":{"sha":"8e31808c","branch":"master"},"phetcommon":{"sha":"3cebb2ae","branch":"master"},"scenery":{"sha":"7379d318","branch":"master"},"scenery-phet":{"sha":"b05ed319","branch":"master"},"sherpa":{"sha":"1759eade","branch":"master"},"sun":{"sha":"9dbeaf88","branch":"master"}}

pixelzoom commented 8 years ago

Reproduced on all platforms. Starting an animation while one is already running is apparently what's causing problems. Looks like we need to disable the scene selection buttons when the animation starts, then enabled them when the animation completes. (Betcha this is a problem in other sims that do this type of "scene switching" animation using Tween.)

pixelzoom commented 8 years ago

Good catch @phet-steele! And good timing, since I was working on similar Tween animation in function-builder, so it was fresh in mind. Fixed in this dev version. The scene-selection buttons do not respond while scene-selection animation is occurring.

http://www.colorado.edu/physics/phet/dev/html/hookes-law/1.0.0-dev.30/hookes-law_en.html

@phet-steele Could you please verify?

pixelzoom commented 8 years ago

@phet-steele Here's a list of simulations (published and unpublished) that use Tween in a similar way for animation, in case you want to try to break them :)

Area Builder Arithmetic Bending Light Charges and Fields Forces and Motion: Basics Fraction Matcher Least Squares Regression Protein Synthesis Seasons

pixelzoom commented 8 years ago

Hold off on verifying this for a bit @phet-steele. I'm not entirely happy with having to disable the scene-selection buttons. So I'm going to investigate canceling the animation that's in progress.

pixelzoom commented 8 years ago

Here's a better solution. Scene-selection buttons remain enabled at all times. If an animation is in progress when one of the buttons is pressed, that animation is cancelled, and the new animation is schedule.

http://www.colorado.edu/physics/phet/dev/html/hookes-law/1.0.0-dev.31/hookes-law_en.html

@phet-steele please have a look at this dev version. Thanks.

phet-steele commented 8 years ago

@pixelzoom looking good :+1:, I'll check out those other sims on Monday.

pixelzoom commented 8 years ago

@phet-steele I've moved the issue of how/when to address in other sims to https://github.com/phetsims/tasks/issues/358.