-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with Terrain collisions (was googlecode Issue 772) #57
Comments
Hi!, i am having same problems with the btheightfieldterrainshape. the collision on the triangles are sometimes on the front and sometimes on the backside. |
ok it seems that
but i need DiamondSubdivision where all triangle faces are in front direction. |
It is likely a bug. Right now I don't have time to look into this. Do you have time to work on a suggested patch? |
i could try . whats the suggestion? :) |
ok just spent a bit time testing and seems, if i switch vertices[1] and vertices[2] all faces are in front: if (m_flipQuadEdges || (m_useDiamondSubdivision && !((j + x) & 1)) || (m_useZigzagSubdivision && !(j & 1))) |
Does that solve the problem for you? |
my problem is actualy solved with that. |
the original issue isn't solved with the face correction. |
It would be good to have a reproduction case of a failing collision, that doesn't need user input (mouse/keyboard etc). If you still have time, perhaps you can modify the ObsoleteDemos\TerrainDemo? Thanks! |
that could take a while (i am just trying it in my free time). but if i want to use the bullet heightfield, i have no other choice. more feedback with other user experiences could be helpfull :) |
closed the pull request: #162 |
Yes, the workaround in the GJK implementation to deal with degenerate cases using small/zero collision margin was causing the issues. Thanks for tracking it down. Commit here: 7f3cbc0 |
What steps will reproduce the problem?
What is the expected output? What do you see instead?
Boxes go through the terrain
What version of the product are you using? On what operating system?
using the latest (r2716) on Windows 8.1
Please provide any additional information below.
Ok, After spending hours trying to figure out why the terrain doesn't work in my engine i decided to try and reproduce it in the TerrainDemo.
It turns out all i had to do was run the Terrain Demo and throw some boxes around and i got the exact same behavior.
Not only the boxes are unstable (and jump around on the terrain until the go to sleep) the BIG problem is that at some part of the terrain they just go right through it.
https://code.google.com/p/bullet/issues/detail?id=772&colspec=Modified%20ID%20Type%20Stars%20Status%20Owner%20Summary
See discussion there too.
After further investigation i found out that the problem happens on some triangles in the terrain and from the debug draw i could see that as the box was hitting the triangle the contact point where generated , but instead of pointing away from the terrain they pointed inside the terrain and just pushed the box through it.
IMPORTANT : I also found out that SPHERES do not have the same problem. Sphere behave beautifully and they are much much more stable than the boxes, which means the problem is probably in the box-concave collision algorithm.
here is a little video i took of the Terrain Demo to show all this :
http://youtu.be/zCJwxk089iM
Thanks :)
The text was updated successfully, but these errors were encountered: