snowkit/differ

Issues with colliders being side-by-side

Closed this issue · 1 comments

Here's an example of the Luxe platformer having its gravity reverted (gravity.set_xyz(0, -800, 0); in Simulation.hx).

The rectangles of the two colliders have exactly the same y-coordinates but appears to block the players movement along the x-axis.
This might be caused by the gravity being applied causing the calculations of the player to be performed in this position -- where he actually would be blocked by the other collider.

Any fix or workaround?

I somehow missed this issue! Sorry about that.
It could be the order that it's applied in before resolving collision, I'll have to play with it. Moving it after collisions would mean gravity could pull you into the ground for one frame, causing jitter or maybe visible latency.

This type of inner edge collisions is actually a frequent pain point of collision in general, and has a variety of solutions based on the implementation details at hand. For example, on terrain meshes ("polygon soup") you would have these inner edges of triangles be a nightmare without context specific ways around it.

I'll play with it, you can set the timescale to really low (maybe even with a key press... I forget off hand) and watch the simulation step through as it would in realtime and see what's happening a bit clearer. I never ran into any issues with the horizontal edges like that without gravity flipped so I'm curious!