Closed megan-phet closed 5 years ago
Thanks @megan-phet. This is strange, but I think the bug is more that kinks are allowable in the first place. The second example shows a case where the skater continues to move while dragging a control point, but kinks aren't removed until released. I do not know how to create the first example. @megan-phet how did you create that?
@jessegreenberg I just made a kink in the track and put the skater on it, then selected the fall from track button.
I see, thanks for the video!
This is happening because when there is a sharp point in the track like this the skater falls off the track, but then gets reattached briefly on the under side of the track.
When there are sharp points like this, the model has a difficult time determining the direction of the track normal vector used to determine whether or not the skater is on the top side of the track. For instance, the model indicates that the skater is on the "top" side of the track when it isn't in this case because of the sharp vertex.
Calculation of the normal is done by numeric.js.
I think we could either 1) Prevent sharp turns in the track like this. Seems like this should generally be not allowed, how is this case possible? This wouldn't fix the problem in the gif in the original issue, because sharp turns aren't corrected until dragging stops. 2) Investigate handling this as a special case somehow. 3) Something else? Do nothing?
My preference is to figure out option 1, though this will still be possible if the skater moves while the track is being dragged.
@samreid @ariel-phet do you have any thoughts about this issue?
Our policy to get this simulation published was that we did not have to have correct physics for radically nonrealistic scenarios, so I'm not surprised to see this case, and there are probably others like it. We did experiment with trying to keep the track smooth at all times (even during dragging) but couldn't get it to work nicely (yet?). Would be good to hear from @ariel-phet too.
@jessegreenberg a few things:
The super sharp kink is not very pedagogically useful. I agree it would be nice if it were disallowed, but it definitely was tricky to get the current algorithm for track smoothing working as @samreid pointed out. You are definitely welcome to work more on this problem, but I think I would give it a limit. Something like 5-6 hours of investigation, and if you don't have a promising solution/direction, leave it alone.
I definitely do not think you need to worry about some odd behavior while dragging the track. If a kink or such happens while the skater is on the track and the track is being dragged, I don't think we will easily be able to avoid all those potential edge cases. If you work on (1) only worry about static cases. If some weirdness happens in some edge cases while the skater is moving and the track is being dragged, that is acceptable.
Thanks for the input @samreid and @ariel-phet. The track kinks are now being reported and tracked in #440, so I am going to close this issue proceed there with the above comment in mind.
Test Device:
Operating System:
Browser:
Problem Description:
Steps to Reproduce:
Select the button that makes the skater fall from track.
Make sharp vertex.
Put the skater on track.
Another Way:
Select the button that makes the skater fall from track.
Put skater on track.
Adjust track to have a sharp vertex.
Screenshots:
Troubleshooting Information
Name: Energy Skate Park: Basics URL: https://phet-dev.colorado.edu/html/energy-skate-park-basics/1.4.0-dev.1/phet/energy-skate-park-basics_en_phet.html Version: 1.4.0-dev.1 2018-06-20 00:09:06 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15 Language: en-US Window: 504x735 Pixel Ratio: 2/1 WebGL: WebGL 1.0 (2.1 INTEL-10.34.27) GLSL: WebGL GLSL ES 1.0 (1.20) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 15 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 16) Max viewport: 8192x8192 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"928741cf","branch":"master"},"axon":{"sha":"f0522e7c","branch":"master"},"brand":{"sha":"89d28f63","branch":"master"},"chipper":{"sha":"e8946524","branch":"master"},"dot":{"sha":"6482f8c9","branch":"master"},"energy-skate-park-basics":{"sha":"288fcefd","branch":"master"},"joist":{"sha":"22e437d5","branch":"master"},"kite":{"sha":"a1086efc","branch":"master"},"phet-core":{"sha":"17326041","branch":"master"},"phet-io":{"sha":"3ea0727a","branch":"master"},"phet-io-wrapper-classroom-activity":{"sha":"53708616","branch":"master"},"phet-io-wrapper-hookes-law-energy":{"sha":"8a546a32","branch":"master"},"phet-io-wrapper-lab-book":{"sha":"1527afd6","branch":"master"},"phet-io-wrappers":{"sha":"8d814eab","branch":"master"},"phetcommon":{"sha":"6ec8cd89","branch":"master"},"query-string-machine":{"sha":"4182612f","branch":"master"},"scenery":{"sha":"88cb642e","branch":"master"},"scenery-phet":{"sha":"7bcde0b2","branch":"master"},"sherpa":{"sha":"88c3b828","branch":"master"},"sun":{"sha":"7579e8fa","branch":"master"},"tandem":{"sha":"8461b6f3","branch":"master"}}