Closed brandonLi8 closed 4 years ago
In the commit above, I was able to predict ball to ball collisions before hand (priori) using a similar strategy to https://github.com/phetsims/collision-lab/blob/master/doc/images/ball-to-ball-time-of-impact-derivation.pdf except the time is forwards.
This was inspired by https://stackoverflow.com/questions/16902523/continuous-collision-detection-how-to-find-the-collision-according-to-these-2
Results are promising, but the collision response looks off. Investigating.
Spoke with @jonathanolson about this.
I've tested the priori collision engine from the commits above and it works mostly well. Lots of clean up work still needs to be done and on some occasions balls can get stuck inside of the border when it is turned on after Balls have escaped. I also need to look into rewiring ball path collision detection (https://github.com/phetsims/collision-lab/issues/75) and look into how the CollisionEngine subtypes are affected.
I'm also planning to remove the documentation files from #88 and rewrite new ones for this model.
Ball to ball collisions have been cleaned up and finished in the commits above. It works really really well. I tested for tunneling with extremely high velocity (in the order of ~20 m/s)/small radii balls and saw no tunneling from #122. I also tested with the query parameter?timeStepDuration=1
(time progressed when a step button is pressed) to simulate extremely slow frame rates and it all looked correct (both forwards and backwards).
However, I'm finding issues with ball-to-wall detection with ?timeStepDuration=1
. For some reasons, the computation of how long before a ball-wall collision occurs fails when the ball hits near a corner with large time steps.
In the commit above, I found the fix to the ball-wall detection issue.
I've updated the CollisionEngine subtypes and I've merged this into master. Closing.
From design meeting, #122, #4, #6 is a problem for the sim. The proposal is to move the collision detection to a priori. Doing this in a branch.