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

Implement pause-aware picking #45775

Merged
merged 1 commit into from
Feb 8, 2021

Conversation

RandomShaper
Copy link
Member

@RandomShaper RandomShaper commented Feb 6, 2021

Version of #39421 for 4.0. (I did first the one for 3.2; please see the remarks there; the only difference is that in 4.0 there's no setting; it's just the new default, and only, way of handling that.)

NOTE: Again, as in the PR for 3.2, the changes are smaller that they seem. The big section that is moved out of the switch into the _process_picking() function is almost the same after the PR; only a few checks have been modified.

Fixes #3703.

This changes the way 2D & 3D physics picking behaves in relation to pause:
- When pause is set, every collision object that is hovered or captured (3D only) is released from that condition, getting the relevant mouse-exit callback., unless its pause mode makes it immune from pause.
- During the pause. picking only considers collision objects immune from pause, sending input events and enter/exit callbacks to them as expected.
- When pause is left, nothing happens. This is a big difference with the classic behavior, which at this point would process all the input events that have been queued against the current state of the 2D/3D world (in other words, checking them against the current position of the objects instead of those at the time of the events).
Copy link
Contributor

@pouleyKetchoupp pouleyKetchoupp left a comment

Choose a reason for hiding this comment

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

Looks fine to me, this makes object picking more consistent when it comes to pause.

@akien-mga akien-mga merged commit 6673c91 into godotengine:master Feb 8, 2021
@akien-mga
Copy link
Member

Thanks!

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.

CollisionObject2D _input_event ignores pause mode
3 participants