phetsims / balloons-and-static-electricity

"Balloons and Static Electricity" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/balloons-and-static-electricity
GNU General Public License v3.0
6 stars 10 forks source link

Sound of moving electrons continues when holding down keyboard nav control of balloon #547

Closed KatieWoe closed 3 years ago

KatieWoe commented 3 years ago

Test device Dell Operating System Win 11 Browser Chrome Problem description For https://github.com/phetsims/qa/issues/721. When moving the balloon with keyboard nav, the moving electron noise will play continuously, even if electrons aren't moving. This happens when holding the down, up, or right arrow keys against the wall. Steps to reproduce

  1. Make sure Show All Charges is selected
  2. Use keyboard nav to rub balloon on sweater
  3. Move balloon against wall
  4. Use keyboard nav and hold down arrow continuously

Visuals

https://user-images.githubusercontent.com/41024075/138183057-5f7b1320-7a60-4065-8ee7-c2e39a9cbe3d.MOV

https://user-images.githubusercontent.com/41024075/138183058-af59c7c7-2ea2-4e62-b9e9-f5841531521d.MOV

Troubleshooting information:

!!!!! DO NOT EDIT !!!!! Name: ‪Balloons and Static Electricity‬ URL: https://phet-dev.colorado.edu/html/balloons-and-static-electricity/1.5.0-rc.2/phet/balloons-and-static-electricity_all_phet.html Version: 1.5.0-rc.2 2021-10-11 21:55:48 UTC Features missing: applicationcache, applicationcache, touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 Language: en-US Window: 1280x649 Pixel Ratio: 1.5/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 30 uniform: 4096 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 32767x32767 OES_texture_float: true Dependencies JSON: {}
jbphet commented 3 years ago

This does indeed seem incorrect. The comments in the code (which I wrote) indicate that sound should only be played when the charges move, and I recall that being the intent, but it seems like sounds are being played on keyboard drag regardless of whether the charges have moved, and that shouldn't happen. I'll investigate and fix.

jbphet commented 3 years ago

This was due to some confusion about how the models of point charges work. I've logged a separate bug about it because I think the design of these model elements is likely to cause other developers problems too if not addressed, see #557. I've addressed the immediate issue in ChargeDeflectionSoundGenerator by using the correct attribute when comparing charge positions.

Nancy-Salpepi commented 3 years ago

This is fixed.