Replies: 6 comments
-
Thanks for the report. I can't see the issue in the code. Can you please create a minimal but fully working example in Bullet (modify some example, load the geometry etc)? You can attach zip files to issues. One thing to test: Use the 'kF_UseGjkConvexCastRaytest' flag, which has a more reliable ray test than the default one:
Also note that it is very important that ALL project that touch Bullet need the BT_USE_DOUBLE_PRECISION flag set, if not, there can be random problems. |
Beta Was this translation helpful? Give feedback.
-
I also posted an issue on the Godot github in case it's specific to that: godotengine/godot#40586 I have a project example there: https://github.com/godotengine/godot/files/4957613/Test.Double.Precision.Raycast.zip The define should be set for everything. I added I'll give the gjk flag a test. Is there a good starting sample I could use if the Godot thing is too complex? |
Beta Was this translation helpful? Give feedback.
-
Quick test seems like the kF_UseGjkConvexCastRaytest flag fixes the issue. Why is that not the default? |
Beta Was this translation helpful? Give feedback.
-
For PyBullet we use it as default. I'll have a look making it default. |
Beta Was this translation helpful? Give feedback.
-
Is there any reason not to use the GJK convex cast? Just curious if there were some performance benefits or something for the other one. |
Beta Was this translation helpful? Give feedback.
-
The subsimplex convex cast is a bit faster, but less accurate, it is best to use the gjk one. Actually, for many shapes it is better and faster to use a specialized ray intersection implementation. We didn't do that for Bullet, convex shapes don't even have indices/triangles by default. You can implement a faster and more accurate custom ray-convex and ray-box. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not sure if this is a Godot-specific issue or a problem with Bullet, but I figured I'd post an issue here. I'm using the Godot engine, and ran into some precision issues with kinematic bodies returning bad normals on collision, so I defined BT_USE_DOUBLE_PRECISION and rebuilt. This significantly improved the kinematic collision issues but broke some raycasts.
I made a simple convex collision shape that was just a box and still had the issues with the raycast.
There's a raycast to detect if the player should be able to hang on walls, and I had to make it longer because it wasn't hitting anything. When the length was increased, I noticed it was hitting on the FAR side of the object. Green line is drawn from the collision point and out on the Z (back) axis. Cyan line shows the normal of the raycast collision. Red is the normal from the kinematic body collision. What's interesting is that if I'm on the other side of the object, it hits the same side, so it's not ALWAYS going through.
Disabled double precision to verify that was what was causing the problem, and the raycast hit on the right side again:

Here is the relevant code from Godot, I think:
Beta Was this translation helpful? Give feedback.
All reactions