phetsims / collision-lab

"Collision Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 4 forks source link

Balls can overlap when adding additional ball #179

Closed arouinfar closed 3 years ago

arouinfar commented 4 years ago

Discovered in https://github.com/phetsims/QA/issues/562

@brooklynlash commented in #122:

I noticed something similar on Windows 10 Chrome, but unsure if tunneling or just that the objects can overlap. Only works if you add balls in when the pink ball is at an area past where the new balls go in, and it looks like once they separate they don't go through each other again. capacitortunnel2

@jonathanolson it looks like it's possible for balls to overlap when adding additional balls to the system when things are in motion. There should probably be some logic that prevents this.

KatieWoe commented 4 years ago

I thought I typed this addition up yesterday, but I can't find it. Oops.

When the balls appear overlapping they will jump into an appropriate position if you click on them (easiest to do while paused). In contrast, if the balls overlap via a different method (dragging one ball over the other or making one ball bigger while it is up against another) then they jump into an appropriate place as soon as you let go of the control that caused the overlap.

ezgif com-gif-maker

jonathanolson commented 4 years ago

Added logic to handle "added balls" overlap. If a different behavior for the ball interaction is desired (e.g. when a ball is dragged to another one, should they overlap until released, or otherwise), let me know.

arouinfar commented 4 years ago

@jonathanolson this looks good in master. I think we're ready for QA to verify in the next test.

KatieWoe commented 3 years ago

In 1.1.0 dev.13 the first appearance seems fixed. However, if you use the blue restart button, instead of going to the altered start position, the balls go back to the slightly buggy position they would have been in originally, and pressing play leads to a different behavior due to these new, overlapping start positions. overlapwithrestart

brooklynlash commented 3 years ago

I was able to replicate the above issue, where the blue reset button overlaps the balls.

I also found this when testing out this issue: when a ball is near the reflecting border and you increase the mass, there is not enough space so it pops around past the other ball. @arouinfar is this intended? collisionmass

jonathanolson commented 3 years ago

Can you check master to see if this still occurs?

KatieWoe commented 3 years ago

Mainly looks fixed in master. The issue when a ball is made larger that @brooklynlash found in https://github.com/phetsims/collision-lab/issues/179#issuecomment-756887444 still occurs

jonathanolson commented 3 years ago

Mainly looks fixed in master. The issue when a ball is made larger that @brooklynlash found in #179 (comment) still occurs

I believe that's a result of the current implementation, it tries to fit in the changed ball, and can swap it into a different place.

arouinfar commented 3 years ago

Mainly looks fixed in master. The issue when a ball is made larger that @brooklynlash found in #179 (comment) still occurs

I believe that's a result of the current implementation, it tries to fit in the changed ball, and can swap it into a different place.

@jonathanolson is correct, this was intentionally done so that balls cannot overlap or escape the reflecting boundary.

arouinfar commented 3 years ago

@jonathanolson I don't think there's anything else that needs to be done for this issue, so back to you.

jonathanolson commented 3 years ago

Sounds good! I'll mark for QA verification during the next test for what I fixed.

DevonQui commented 3 years ago

This issue appears to be fixed when I tested it using the current version. Closing