My biggest hurdle at this time is that if the character is falling fast enough, it tends to penetrate into the level geometry. This penetration is slightly unsightly, which is bad enough, but the real problem is it can also slam the collision pair detector too far into level geometry, causing support raycasts to fail and the character to be stuck in "midair" while on the ground. I've read this thread describing rather similar issues, and have been trying multiple approaches to solving this particular problem, to no avail. In no particular order:
- Enlarging the collision pair detector (but not support height).
- Enabled CCD on both the body and the collision pair detector.
- Applied high stability settings as per the demos ConfigurationHelper.
- Separated space updating to its own thread.
- Limiting falling speed.
- Picking different values of support height.
There's also an issue with the collision pair detector if the character jumps onto a ledge just narrowly enough that the ledge falls flat in the pair detector, then the body enters in collision preventing the character from going through the ledge, however the collision pair detector is too far deep and its raycasts fail to find a support. (I've uploaded a short clip illustrating that issue here: Fido the prototyping dog. What isn't shown is that once Fido is on the ledge, I'm constantly trying to jump, to no avail. As mentioned, code-wise, the raycast fails and no support is returned.)
There are a few things I've considered but haven't tried yet:
- Adapting CharacterController's implementation instead of SimpleCharacter's, meaning using the GJKToolbox.ConvexCast instead. But based on the thread linked earlier, the penetration problem would supposedly be worse with the CharacterController so I'm not too keen on going through that trouble to no avail if that's the case.
- Setting a big enough support height but offsetting the player model. However, this'd effectively set the controller body at a different place from the model, something I'm not too keen on.
As an aside, how feasible would it be to make the PhysicsDrawer capable of updating its DisplayEntities when applying changes to their source Entities' sizing properties? I've been relying on a debug console to change things on-the-fly in order to test different results, for instance changing the support height. But even if I update the collision pair detector height after that, it doesn't actually change its display shape. A quick examination shows that the drawer only fetches shape geometry on initialisation. Being able to update display without recreating the collision pair box would be nice.