Closed veillette closed 5 years ago
@veillette @brandonLi8 you may want to take a look at gas-properties
. That sim has collision detection and response which may be helpful here.
The relevant part in gas-property can be found at https://github.com/phetsims/gas-properties/blob/master/js/common/model/CollisionDetector.js
Because of the number of collisions and the smallness of the balls, gas properties makes some simplifications that are not going to be acceptable in collision-lab
**
* Detects and handles particle-particle collisions. Particle-particle collision are based solely whether they
* intersect at their current locations. Is is possible (and acceptable) for two particles to pass through the
* same point on the way to those location and not collide.
* @param {Particle[]} particles
* @param {Object} mutableVectors - set of mutable vectors, see this.mutableVectors in CollisionDetector constructor
*/
This document (referenced in CollisionDetector) on standard rigid-body collision looks very useful http://web.mst.edu/~reflori/be150/Dyn%20Lecture%20Videos/Impact%20Particles%201/Impact%20Particles%201.pdf
We are tracking the development of the algorithm in #23. Closing
The two references https://www.toptal.com/game/video-game-physics-part-ii-collision-detection-for-solid-objects https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection should be worth reading for the development of collision-lab.
Assigning to @brandonLi8