Skip to content
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] collide_shape returns unintuitive/wrong values #45680

Closed
Tracked by #45022 ...
janmagtoast opened this issue Feb 3, 2021 · 3 comments
Closed
Tracked by #45022 ...

[Bullet] collide_shape returns unintuitive/wrong values #45680

janmagtoast opened this issue Feb 3, 2021 · 3 comments

Comments

@janmagtoast
Copy link

janmagtoast commented Feb 3, 2021

Anmerkung 2021-02-03 113453

Godot version:
3.2.3 stable/3.2.4 (tested on multiple versions)

PhysicsEngine:
tested in both Godot Physics and Bullet Physics
(This project is in Bullet, bc it's using cyliner-shape)

Issue description:
As the title implies, I don't understand what collide_shape returns. Either it's bugged or just really unintuitive.

Steps to reproduce:
Use collide_shape and print the returned values.

Minimal reproduction project:
MinimalisticProject.zip

@pouleyKetchoupp
Copy link
Contributor

I can confirm returned values are wrong with Bullet. Returned points should be in world space, but Bullet is probably returning them with a different transformation, maybe in the shape's local space.

In Godot Physics they are correct:

(cylinder is implemented now, and you can get similar results with other shapes)

Documentation could be improved though. Returned points are a list of pairs of contact points. For each pair the first one is in the shape passed in PhysicsShapeQueryParameters, second one is in the collided shape from the physics space.

@theraot
Copy link
Contributor

theraot commented Mar 9, 2022

I just ran into this. It appears that the first point is in the local space of the body whose shape is passed in PhysicsShapeQueryParameters, and the second point is in the local space of the other body.

Edit: On 3.5 beta 1.

@akien-mga akien-mga added this to the 3.5 milestone Mar 24, 2022
@akien-mga akien-mga changed the title collide_shape returns unintuitive/wrong values [Bullet] collide_shape returns unintuitive/wrong values May 19, 2022
@akien-mga
Copy link
Member

Fixed by #59470.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants