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

intersect_ray() becomes flaky if a flat CollisionShape exists anywhere #41031

Closed
Tracked by #39876
paulmiller opened this issue Aug 5, 2020 · 0 comments · Fixed by #41426
Closed
Tracked by #39876

intersect_ray() becomes flaky if a flat CollisionShape exists anywhere #41031

paulmiller opened this issue Aug 5, 2020 · 0 comments · Fixed by #41426

Comments

@paulmiller
Copy link

Godot version:
v3.2.2.stable.custom_build
(installed from https://aur.archlinux.org/packages/godot/, which builds from https://github.com/godotengine/godot/archive/3.2.2-stable.tar.gz)

OS/device including version:
Arch Linux, i7-6700, GTX 1070, nvidia driver 450.57

Issue description:
Stated simply: scaling down an Area to zero volume will cause PhysicsDirectSpaceState.intersect_ray() to randomly fail to detect other Areas in the scene.

Stated more precisely: if a scene contains a CollisionShape with either a trimesh or convex collision mesh, and the CollisionShape's Area or any higher-level parent is scaled down to zero on any axis, then PhysicsDirectSpaceState.intersect_ray() will inconsistently (and seemingly randomly) fail to detect other Areas/CollisionShapes in the scene.

It won't detect the flattened Area at all. I don't know if that's intentional.

Steps to reproduce:
Try the attached project. The root node has a script that'll print "True" when the cursor moves over an Area, and "False" when it exits. Move the cursor over the Sphere on the left. See that it spams the console with alternating "True" and "False". Every couple of _physics_process() calls, it fails to detect the sphere's Area, and records "False". Now increase the x-scale of the "SquishedCube" and try again. intersect_ray() now works correctly.

Minimal reproduction project:
ray-test.zip

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

Successfully merging a pull request may close this issue.

3 participants