Skip to content

Add multi-node 3D collision based snapping#106794

Open
ryevdokimov wants to merge 1 commit intogodotengine:masterfrom
Open-Industry-Project:multi-node-collision-snapping
Open

Add multi-node 3D collision based snapping#106794
ryevdokimov wants to merge 1 commit intogodotengine:masterfrom
Open-Industry-Project:multi-node-collision-snapping

Conversation

@ryevdokimov
Copy link
Copy Markdown
Contributor

@ryevdokimov ryevdokimov commented May 25, 2025

#96740 added the ability to snap 3D nodes using collisions. This PR adds the ability to do it with multiple nodes selected.

447321991-e4224404-cc04-43de-afac-032a5d20b882.1.mp4

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 (rebased on top of master 320e818), it works as expected. Code looks good to me.

@ryevdokimov ryevdokimov modified the milestones: 4.x, 4.8 Apr 29, 2026
@fire fire requested a review from a team April 29, 2026 16:31
Copy link
Copy Markdown
Member

@fire fire left a comment

Choose a reason for hiding this comment

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

Reviewed code

Did not quality assurance test.

if (selection.size() == 1) {
selected_node = Object::cast_to<Node3D>(selection.front()->get());
} else {
Node3D *active_node = spatial_editor->get_active_node();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the nesting is too deep, we tend to use guard clause style in c++.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done and retested.

@ryevdokimov ryevdokimov force-pushed the multi-node-collision-snapping branch from 9b80537 to 5a711b6 Compare April 29, 2026 20:08
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.

3 participants