4 ms·
I assume by center of mass of the intersection volume you actually mean you want the contact point(s). > And in general how do you get the volume as a single n
by maccard 2y ago
I assume by center of mass of the intersection volume you actually mean you want the contact point(s).
> And in general how do you get the volume as a single number?
It's not a single number. Imagine a triangle overlapping a square, it's actually a plane, and a depth. To figure that out you use EPA - here's [0] a video explaining it. You project the simplex outwards until it hits the minkowski difference. It's remarkably similar to GJK in implementation. IT's also a pain in the butt to do in a numerically stable way.
[0] https://handmade.network/forums/t/1521-gjk_+_expanding_polytope_algorithm_-_implementation_and_visualization https://handmade.network/forums/t/1521-gjk_+_expanding_polyt...
- bruce343434 2y agoI was thinking of resolving collisions the way you would simulate boyancy: by applying a force and torque from a certain point (the center of boyancy, the center of the subvolume that is submerged), calculated by pressures (i.e., which areas of the object "dip into" the other object). This should also fix the bouncy jitter that happens when objects lie flat on their face, without needing a "ground" state. Imagine a bug coming from the ground state design: an object is grounded onto another object, but that other object slowly tilts. The grounded object never slides off, but remains suspended in air.