1j01 / makisu

Two sushi simulators (3D and retro 2.5D)
https://1j01.github.io/makisu/
0 stars 0 forks source link

Objects phase through each other #11

Open 1j01 opened 3 months ago

1j01 commented 3 months ago

Sheets in particular don't stay on the correct side of each other.

Three.js version

I could try upping the timesteps or something, but maybe cannon.js / cannon-es just isn't up to the task of handling collisions between thin objects.

TIC-80 version

I also have this problem in my custom point-based physics in the TIC-80 version. I could add constraints that say a particle is meant to be on a particular side of a line, and remove these constraints when the point's projection onto the line would be outside the line segment, and add it when it returns to within the slab bounded by perpendicular lines to the line segment's ends. I feel like I was planning this but was put off by lackluster performance of the physics code so far. It seems like the QuickJS runtime is too slow, and I'm not super interested in hyper-optimizing for an artificially/unnecessarily slow architecture. But it's been a while since I looked at my code, so I don't really know where I'm at. Who knows, maybe I already have some kind of constraint like this but it just doesn't work.

P.S. not sure this should be one issue or two

1j01 commented 2 months ago

Improved Three.js version in b5a87687f0082d13ff57a0160462878d72893d04