phetsims / masses-and-springs-basics

"Masses and Springs: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 3 forks source link

Floating mass can be behind a mass on the spring #66

Closed KatieWoe closed 5 years ago

KatieWoe commented 5 years ago

Test device: Dell Operating System: Win 10 Browser: Chrome Problem description: For https://github.com/phetsims/QA/issues/296 The way the layering for the masses in the play area works is the latest mass to be picked up is in the front. This means that in normal use a mass being held in the path of a moving spring will be in front. However, there are two ways to get around this, which creates an odd look. One way involves multitouch and the other involves zero gravity. A slow speed makes this easier to see in both cases. Likely minor. Tagging @arouinfar to decide. Steps to reproduce: Multitouch method:

  1. Using one finger pick up a mass
  2. Using a second finger pick up a second mass and put it on a spring
  3. Move the first mass over the path of the spring

Zero Gravity method:

  1. On the Lab screen set the gravity to zero
  2. Grab a mass and put it under the spring. Make sure it is not connected
  3. Grab an second mass and put it on the spring
  4. Set the spring moving

Screenshots: twooddmasses

Troubleshooting information (do not edit):

Name: ‪Masses and Springs: Basics‬ URL: https://phet-dev.colorado.edu/html/masses-and-springs-basics/1.0.0-rc.3/phet/masses-and-springs-basics_all_phet.html Version: 1.0.0-rc.3 2019-03-13 17:09:25 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36 Language: en-US Window: 1536x731 Pixel Ratio: 2.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: {}
arouinfar commented 5 years ago

Nice observation @KatieWoe. I think you've discovered some nuances for how the z-ordering can behave, but I don't think there's anything we need to do. In general, the masses are layered above the springs, but the relative layering of the masses can change depending on which mass is active.

For the multitouch method, the green mass was picked up more recently, so it gets layered on top of the blue mass. This is to be expected.

For the zero gravity method, I don't think you're actually holding onto the green mass, so it gets sandwiched between the spring and pink mass. If I grab the floating green mass, it jumps above the oscillating pink mass.