phetsims / molecule-shapes

"Molecule Shapes" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/molecule-shapes
GNU General Public License v3.0
5 stars 6 forks source link

Groups fly to the central atom at a slow pace #180

Closed phet-steele closed 3 years ago

phet-steele commented 3 years ago

I'm not sure if this is a performance problem or if it is going to just be device specific or what, but as soon as I open the sim and try to add an atom or lone pair, they fly towards the central atom incredibly slow. This gif is real time:

MoSh01

Seen on Win 10 Chrome, for phetsims/QA/issues/642.

Troubleshooting Information URL: https://phet-dev.colorado.edu/html/molecule-shapes/1.2.9-rc.1/phet/molecule-shapes_en_phet.html Version: 1.2.9-rc.1 2021-04-23 20:40:46 UTC Features missing: applicationcache, applicationcache, touch User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 Language: en-US Window: 1920x937 Pixel Ratio: 1/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
jonathanolson commented 3 years ago

I'm not able to reproduce. Is there console output? I have no idea why it's running that slowly. Any idea how I'd be able to reproduce this?

phet-steele commented 3 years ago

I really have no clue myself.

jonathanolson commented 3 years ago

I'm still unable to reproduce. @KatieWoe thoughts?

KatieWoe commented 3 years ago

Could this be similar to the issue we saw on Steele's device in States of Matter https://github.com/phetsims/states-of-matter/issues/354. It had to do with the refresh rate of his device. Could that be a cause?

jonathanolson commented 3 years ago

Yes, it looks similar! I reproduced with ?speed=0.1:

image

jonathanolson commented 3 years ago

This should be fixed. @KatieWoe can you verify that the speed seems about normal (with a normal framerate), but also that things function properly with lower speeds (e.g. ?speed=0.1).

KatieWoe commented 3 years ago

I was under the impression that ?speed=x was meant to change animation speed?

jonathanolson commented 3 years ago

I was under the impression that ?speed=x was meant to change animation speed?

It changes the timesteps the entire simulation is given, e.g. with ?speed=10, it will multiply each "elapsed time" by 10. So if your browser runs at 60fps (~0.016 seconds per frame), an elapsed time of 0.016s will be adjusted to 0.16s. This speeds up the sim, but also makes it mimic behavior as if it was running at 6fps.

So a ?speed=0.1 on a 60-fps device would effectively mimic behavior of 600fps.

KatieWoe commented 3 years ago

In that case this would affect most animations. I thought that was the intended behavior of that parameter.

KatieWoe commented 3 years ago

Discussed with @jonathanolson to clarify above. Looks good on master.

jonathanolson commented 3 years ago

Thanks!