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

Add debug colors and fills to CollisionPolygon3D. #101810

Merged

Conversation

BattyBovine
Copy link
Contributor

@BattyBovine BattyBovine commented Jan 19, 2025

This pull request brings CollisionPolygon3D up to feature parity with its counterpart CollisionShape3D. Closes #101414.

In addition, adding this feature fixes the issue that CollisionPolygon3D would never be rendered in exported builds, even if Visible Collision Shapes is enabled at runtime. Closes #101413.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works as expected. Code looks good to me.

Testing project: test_pr_101810.zip

It makes sense to merge this before 4.4 is released, so we have feature parity with other collision shapes and fix the original issue where they don't appear in the debug view.

Note that the visual representation between the editor and running project will differ slightly, as the running project will draw the triangulated version for the lines, while the editor will draw the shape that was drawn by the user (and may contain crossing sections). The filled area that is drawn is identical either way.

Editor (not selected)

image

Running project

image

This brings CollisionPolygon3D up to feature parity with its counterpart
CollisionShape3D. Closes godotengine#101414.

In addition, adding this feature fixes the issue that CollisionPolygon3D
would never be rendered in exported builds, even if Visible Collision Shapes
is enabled at runtime. Closes godotengine#101413.
@BattyBovine BattyBovine force-pushed the collision-polygon-3d-debug-colours branch from 0992846 to a3ef9de Compare January 20, 2025 23:27
@BattyBovine
Copy link
Contributor Author

Note that the visual representation between the editor and running project will differ slightly, as the running project will draw the triangulated version for the lines, while the editor will draw the shape that was drawn by the user (and may contain crossing sections). The filled area that is drawn is identical either way.

This is something I noticed, and I kind of prefer the way I drew it in the editor, since it looks much more like one singular solid. I didn't want to make drastic changes on a whim though, because this is intended to fix a regression and add feature parity between all collision types. If there is a consensus as to which method of drawing the polygons is preferred, I can try to match them both.

@Repiteo Repiteo merged commit 9a2ab85 into godotengine:master Jan 21, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jan 21, 2025

Thanks!

@akien-mga akien-mga changed the title Add debug colours and fills to CollisionPolygon3D. Add debug colors and fills to CollisionPolygon3D. Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants