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

Fix mesh errors in SeparationRayShape3D debug fills #100968

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BattyBovine
Copy link

@BattyBovine BattyBovine commented Dec 31, 2024

Fixes an issue where SeparationRayShape3D would generate errors when debug meshes are enabled, due to the ray's debug mesh being generated as an empty array. This fix adds a single triangle to the debug mesh, which follows the shape of the debug line.

Closes #100665

Edit: This fixes the same issue as #101014, but using a less than ideal workaround. I will leave this pull request open for now, but the other fix is likely to be preferable.

@BattyBovine BattyBovine requested a review from a team as a code owner December 31, 2024 03:59
@smix8
Copy link
Contributor

smix8 commented Dec 31, 2024

Should prevent the CollisionShape3DGizmoPlugin from adding empty surfaceless meshes. That would avoid the need to add dummy meshes and solve that issues for any kind of other shape.

The code where the gizmo adds the fill mesh can be found in the CollisionShape3DGizmoPlugin::redraw() function. E.g. extend the mesh check from just check if it is valid to checking its surface count and reject if surface count is zero.

@BattyBovine
Copy link
Author

I decided to take your advice and made another pull request (#101014) that adds the necessary checks for an empty mesh. If that fix is preferred, we can merge that instead. There should be no issue merging both if desired, but an empty surface check is much more resistant to similar issues in the future, and prevents the need for this very specific fix.

@BattyBovine BattyBovine force-pushed the cs3d_separation_ray_fix branch from 4bcbf31 to d1ad726 Compare January 2, 2025 21:20
Fixes an issue where SeparationRayShape3D would generate errors when debug
meshes are enabled, due to the mesh being generated empty. This fix adds a
single triangle to the debug mesh, which follows the debug line.

Closes godotengine#100665
@BattyBovine BattyBovine force-pushed the cs3d_separation_ray_fix branch from d1ad726 to 931f7be Compare January 2, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[4.4 dev7] Seperation Ray causes Mesh surface errors
3 participants