phetsims/collision-lab

Balls can overlap when adding additional ball

Closed this issue · 12 comments

Discovered in phetsims/qa#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.

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

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.

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

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

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

Can you check master to see if this still occurs?

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

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.

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.

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

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

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