Skip to content

Add debug colors and fills to CollisionPolygon3D.#101810

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
BattyBovine:collision-polygon-3d-debug-colours
Jan 21, 2025
Merged

Add debug colors and fills to CollisionPolygon3D.#101810
Repiteo merged 1 commit into
godotengine:masterfrom
BattyBovine:collision-polygon-3d-debug-colours

Conversation

@BattyBovine
Copy link
Copy Markdown
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.

@BattyBovine BattyBovine requested review from a team as code owners January 19, 2025 21:41
@BattyBovine BattyBovine requested a review from a team January 19, 2025 21:41
@BattyBovine BattyBovine requested a review from a team as a code owner January 19, 2025 21:41
@smix8 smix8 added this to the 4.4 milestone Jan 19, 2025
Copy link
Copy Markdown
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

Comment thread editor/plugins/gizmos/collision_polygon_3d_gizmo_plugin.cpp Outdated
Comment thread editor/plugins/gizmos/collision_polygon_3d_gizmo_plugin.cpp Outdated
Comment thread editor/plugins/gizmos/collision_polygon_3d_gizmo_plugin.cpp Outdated
Comment thread editor/plugins/gizmos/collision_polygon_3d_gizmo_plugin.cpp Outdated
Comment thread editor/plugins/gizmos/collision_polygon_3d_gizmo_plugin.cpp Outdated
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
Copy Markdown
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
@Repiteo
Copy link
Copy Markdown
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