Wednesday, October 15, 2025

Collision detection just got fixed

According to Dr Carroll of "Two Minute Papers", Ryoichi Ando has fixed A Cubic Barrier with Elasticity-Inclusive Dynamic Stiffness (pdf).

Collision detection in games and movies had been done with a logarithmic barrier. If the object was too thin however, seems there might be a singularity (Carroll calls it "panic"). The collisions would not get detected and the thick object would break through the thin one.

If you are playing with late 1990s polygons then you just sucked it up. But movies - for one - are supposed to be photorealistic. So if Superman has a cape or, worse, you want realistic flesh and skin over a skull, "artifacts" of the thicker structure would seep through. So editors would waste weeks and millions of dollars fixing these bugs.

Various methods of "clamping" could be used to kludge the collisions before human editors came in. It all reminds me of the Ricci Flow With Surgery by which Grisha Perelman fixed the singularities in Hamilton's partial proof of Poincaré's Theorem - and beyond. Which made it a perfect proof. Some might grumble that was kludgey too; but if the kludge is mechanically applied and works by induction, it's a proof for any given finite or even countable solid. Unfortunately for artwork, the clamping didn't catch all the (literal) edge cases.

Ryoichi Ando would use cubic barriers. They don't have to post-process the artifacts. On the flip side: the new algo seems to be slower.

So it probably won't be used for games except in cutscenes. The speedrunners and plain ol' cheaters will be fine.

Anyway here is the github, refactored a fortnight ago. It's in CUDA 12.8 which looks like C. The paper was published last December, so as you see nobody took it seriously until some actual code was produced (which I totally understand). I don't get Received 20 February 2007; revised 12 March 2009; accepted 5 June 2009 in the paper's end though (since it relies on a lot of recent work); that looks like a stray from a template.

No comments:

Post a Comment