Replies: 3 comments
-
Oops - slightly wrong link for my patch, better look at: |
Beta Was this translation helpful? Give feedback.
-
Thanks for the report! By the way, your game is looking great! It would be fun to play this in VR on the Oculus Rift/HTC Vive. Have you checked out the OpenVR SDK from Valve? I started playing with this in Bullet recently. The InternalEdgeUtility was created to help fixing this, have you tried it? I noticed the old Demo to use it is not converted to the new Bullet Example Browser yet, here it is: This behavior may not always be what the user wants, to it would be good to have some option/flag to enable/disable it. |
Beta Was this translation helpful? Give feedback.
-
Erwin, can you send me the spreadsheet you told me about where you keep On Sat, Jul 2, 2016, 19:25 erwincoumans notifications@github.com wrote:
|
Beta Was this translation helpful? Give feedback.
-
The details are in the forum:
http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=11208
The effect can be seen in this movie:
https://www.youtube.com/watch?v=e2SkBWHZXJQ&feature=youtu.be&t=40
At around 45 seconds the 'puck' (cylinder) will suddenly jump up significantly.
Basically the collision between a cylinder (or ball, same issue) and a static mesh uses an incorrect normal - the connection between the hit points on both shapes. In the case above the plane is flat with a normal of (0,1,0) (Y up), but the connection between the hit points can give e.g. (0.2, 0.98, 0). If the object should have a high velocity in the 'incorrect component' (in this case simply X), then the dot product computed in btSequentialImpulseConstraintSolver::setupContactConstraint:
results in a too high velocity. This rel_vel value is used later to compute the strength of the impulse to resolve the collision. So when this is multiplied with the normal ( (0.2, 0.98, 0) in the example above), it results in a very high impulse up.
My patch was to use the normal from the triangle only, not the connection between the contact points, see:
supertuxkart/stk-code@0a883f3...431ed63
Though that is for bullet 2.79. I did not try a later release, but from what I have seen in the code while some refactoring has taken place, the maths done appears identical, so it should have the same issue. Note that our patch only fixes collisions between sphere/cylinder and triangle mesh (some other shapes might use the same collision function as cylinder).
Beta Was this translation helpful? Give feedback.
All reactions