Closed Frooxius closed 3 years ago
Reproduction steps - Capsule - Mesh (quad)
I revamped the capsule-triangle test's handling to deal with the numerical corner case better in 4ff285e832f5286d32bce6d68936111a04829fed; should help.
Another case - Compound (Capsule) - Cylinder
This ended up being caused by the same problem you reported before- apparently the loosened threshold needed to be a little bit looser still: eaf880bef1069dbc99f35e6bc21398a0c8cd3cce
And thank you again for your quick responses and fixes with all of these issues, you're really awesome!
Thank you for the reports, and keep 'em comin'! This is very helpful for hammering out those last finicky bits.
Aaah thank you so much! I've tested it with our community and it seems to have fixed all the collision weirdness that we found! I think this issue is good to close from my end!
And nice, I'm glad it's helping! I was a bit worried that I'm bringing too many. We've got a lot of user content with all kinds of weird stuff, so it ends up hitting a lot of those corner cases! :D It's good to make things nice and robust though, I'll bring more if we find more stuff!
Hello! I've managed to stumble upon yet another edge case while testing ^^;
I have found that applying a very slight rotation to a capsule (used as character controller) can result in contacts being randomly missed and reacquired in some cases. It might affect other shapes as well, but I haven't tested those.
For all the tests I'm using Capsule with following dimensions:
new Capsule(0.2f, 1.85f)
Reproduction steps - Capsule - Mesh (quad)
First add a simple quad mesh to CharacterDemo.cs:
Then modify the initial pose of the CharacterController body in CharacterInput.cs to have this slight orientation:
With this, if you jump on the quad, in some areas (typically near the edges/corners of the triangle) the character will start loosing and reacquiring the contacts. This results in little bouncing, although it's a bit too small to see in this reproduction case, but the logging of character.Supported will flicker between true and false.
Another case - Compound (Capsule) - Cylinder
I found there's another way to reproduce this against a primitive shape when the capsule is a child of a compound (I'm using those to apply an offset from the center).
In addition to the setup above (I'm including it separately, since the first one can reproduce it without needing to add the Compound), I've added this into constructor of CharacterInput:
Then add a big cylinder into the CharacterDemo world:
Walking on this cylinder will result in the same behavior.
Possible clue - bounding boxes?
I did some investigation seeing if I can fix this myself and I found a workaround. It seems that the issue might be caused by bounding box checks possibly missing by a hair?
If I go to Capsule.cs and update the ComputeBounds:
And the wide variant:
The issue disappears. If I go to Compound and replace both the
Tree.Intersects
andBoundingBox.Intersects
tests with just true (naughty, I know! D: ) it gets fixed in certain cases, but not in others.I'm not fully sure how to fix this properly myself right now. If expanding the bounding boxes by a bit is ok to do like this or there's a more underlying issue. It works as a workaround for me right now though at least, but if you have a good fix for this I'll definitely take that! ^^; And thank you again for your quick responses and fixes with all of these issues, you're really awesome!