-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[Bullet] RayCasts get_collider_shape
erroneously returns triangle index when colliding with ConcaveCollisionShape(s)
#47989
Comments
@Calinou |
I don't quite understand the confusion here. Different triangles means different shapes, since the object is the entire object which is composed of triangles. It would be similar to grid map shapes, and each would return a different shape ID. I think this is a misunderstanding of collision shape owners. In a typical case, a collision object will have a single shape owner, which has a collection of shapes (triangles in this case). So, retrieving the shape owner for this case would be: If you have more than one shape owner, then yeah perhaps that may be a limitation. But if those shape IDs are unique across shape owners, then you can use the I haven't dealt with 3D extensively to tell if there's a major difference with how 2D handles it, but the logic should be similar I guess... I've always found the "owner" terminology confusing myself, see godotengine/godot-proposals#1574. |
I can confirm in 3.3.2. It's similar to #39767, and doesn't happen when switching to Godot Physics in project settings. |
get_collider_shape
erroneously returns triangle index when colliding with ConcaveCollisionShape(s)get_collider_shape
erroneously returns triangle index when colliding with ConcaveCollisionShape(s)
@pouleyKetchoupp Thanks for fixing this! I'll give it a test sometime. |
Godot version:
3.X
OS/device including version:
x86_64 Linux 5.10.26-1-MANJARO
Issue description:
When using a raycast, I want to be able to fetch the CollisionShape (child of StaticBody) using the api provided. I should be able to fetch the collider (using get_collider()) and then get the desired collision shape by using
get_collider_shape()
, and the associatedshape_owner_*
functions from the collider.However, the raycast is erroneously telling me the triangle I collided with (as an indice) which doesn't give me the ability to correctly fetch the shape owner! The ID returned by
get_collider_shape()
should be giving us the appropriate index so thatshape_owner_*
functions can be used correctly!Steps to reproduce:
Best way to reproduce is create a scene with a static body and a concave collision mesh shape. Then, create a raycast object and use a quick built-in script to try to poll information about the collision. There should be 1 id for the whole mesh, and it shouldn't change when colliding with different triangles. However, it will currently always change when hitting a new triangle.
The text was updated successfully, but these errors were encountered: