Moves shape casting code from Rapier into this repo with some modifications.
Unfortunately, low framerates still have tunnelling issues, and this can even happen with a good computer if the OS happens to freeze for a split second at the wrong time. I'm not sure why penetrations are happening so often even with the buffer value subtracted from the TOI, and sadly the normals returned by contact_manifolds are highly variable. Sometimes this results in normals that push the player up slopes they should not be able to climb, but trying to prevent that makes it even easier for the player to fall through the world.
The issues are primarily with heightmaps, which are queried as a bunch of individual triangles. I might have to fork Rapier/Parry and add the ability to specify that normals should always be on the upper side of the triangles for heightmaps, rather than whichever side the collider is already mostly on.
There could also be some bug with my fixed timestep implementation when the rendering framerate is lower than the physics tick rate, and move_player has to step multiple times with shorter casts, but I have not been able to find it. Between that issue and the unexpected penetrations (which were happening with the built-in controller as well), I feel like it might be more of a limitation of shape casting rather than my usage of it.
Moves shape casting code from Rapier into this repo with some modifications.
Unfortunately, low framerates still have tunnelling issues, and this can even happen with a good computer if the OS happens to freeze for a split second at the wrong time. I'm not sure why penetrations are happening so often even with the buffer value subtracted from the TOI, and sadly the normals returned by
contact_manifolds
are highly variable. Sometimes this results in normals that push the player up slopes they should not be able to climb, but trying to prevent that makes it even easier for the player to fall through the world.The issues are primarily with heightmaps, which are queried as a bunch of individual triangles. I might have to fork Rapier/Parry and add the ability to specify that normals should always be on the upper side of the triangles for heightmaps, rather than whichever side the collider is already mostly on.
There could also be some bug with my fixed timestep implementation when the rendering framerate is lower than the physics tick rate, and
move_player
has to step multiple times with shorter casts, but I have not been able to find it. Between that issue and the unexpected penetrations (which were happening with the built-in controller as well), I feel like it might be more of a limitation of shape casting rather than my usage of it.