-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
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
PhysicsDirectSpaceState.intersect_ray returns a different result with Bullet and GodotPhysics #49055
Comments
I can confirm the inconsistency between Bullet and Godot Physics. Exclusion lists should work though. In your project, you're setting |
Thank you for the explanation. I have updated the case accordingly. |
The behavior of raycasts with Bullet in this case is due to the following code: godot/thirdparty/bullet/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp Lines 135 to 137 in c08e753
Even if that weren't there, there would still be this check: godot/thirdparty/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp Lines 638 to 639 in c08e753
There are no settings in Bullet to change this behavior, so besides documenting this there is not much we can do (unless someone changes Bullet upstream). In GodotPhysics in |
This may be related, but I found that having a collisionShape that has its Z extents set below 0.5 will cause GodotPhysics to fail to hit it (in this case the intersect_ray is traveling along the X axis straight through the object). It works fine in Bullet physics, but not in GodotPhysics. |
Godot version:
3.3.2.stable
OS/device including version:
Linux Mint 20.1(Ubuntu 20.04 LTS)
Issue description:
When raycasting from the center of a KinematicBody to another KinematicBody with "get_world().direct_space_state.intersect_ray", I get different results depending on PhysicsEngine.
With "Bullet" I get the second body and with "GodotPhysics" I get the first body.
Steps to reproduce:
1.Make 2 KinematicBody objects.
2.Raycast between the 2 bodies.
3.Change "Project settings->Physics->3D->Physics Engine"
Minimal reproduction project:
RaycastBug_v2.zip
Edit: Removed the exclusion lists issue, since it was because of incorrect setup.
The text was updated successfully, but these errors were encountered: