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 SubViewport physics picking #87385

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,14 @@ void Viewport::_process_picking() {

while (physics_picking_events.size()) {
local_input_handled = false;
if (!handle_input_locally) {
Viewport *vp = this;
while (!Object::cast_to<Window>(vp) && vp->get_parent()) {
AThousandShips marked this conversation as resolved.
Show resolved Hide resolved
vp = vp->get_parent()->get_viewport();
}
vp->local_input_handled = false;
}

Comment on lines +741 to +748
Copy link
Member

Choose a reason for hiding this comment

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

Just to be sure, you seem to skip every viewport (even ones with local_input_handled == true until the last one, then you set local_input_handled to false.
Is this what you want?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR intends to treat handle_input_locally for physics picking in the same way as it is treated in other places. That includes skipping viewports with local_input_handled == true.
The fact that currently handle_input_locally is treated differently in different parts of the code-base is the reason for the linked issue.

Ref<InputEvent> ev = physics_picking_events.front()->get();
physics_picking_events.pop_front();

Expand Down
Loading