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

Various picking bugfixes #15293

Merged
merged 5 commits into from
Sep 20, 2024
Merged

Conversation

NthTensor
Copy link
Contributor

@NthTensor NthTensor commented Sep 19, 2024

Objective

Big thanks to B. Reinhart for testing picking in their codebase and identifying these issues early.

Solution

  • Fix press & drag state being cleared after the first entity is read from the hover map on pointer release, rather than after all entities are read. This caused only the first hovered entity to receive Up and Click events.
  • Fixes Down being determined using the previous_hover_map rather than hover_map, a regression compared to bevy_mod_picking. I think this is what was messing up drag events.
  • Fixes and issue where PointerEnd would fire multiple times and PointerStart would fire when dragging onto a new entity.
  • Re-orders events to make them easier to handle. Out now fired before DragLeave and Click/Up now fire before DragDrop.
  • Generally refactors the picking event code to be more clean and sane.

Testing

These changes are currently sporadically tested.

@NthTensor NthTensor added C-Bug An unexpected or incorrect behavior A-Input Player input via keyboard, mouse, gamepad, and more D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Testing Testing must be done before this is safe to merge A-Picking Pointing at and selecting objects of all sorts labels Sep 19, 2024
@alice-i-cecile alice-i-cecile added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Needs-Testing Testing must be done before this is safe to merge labels Sep 19, 2024
@alice-i-cecile
Copy link
Member

alice-i-cecile commented Sep 19, 2024

This has been tested by @brandon-reinhart, and is at least an improvement on the current behavior. See these messages.

@alice-i-cecile alice-i-cecile added this to the 0.15 milestone Sep 19, 2024
@NthTensor
Copy link
Contributor Author

I'll be using this PR to just collect up a big batch of fixes so we can merge them all at once.

@NthTensor NthTensor changed the title Fix picking button presses Various picking bugfixes Sep 19, 2024
@NthTensor NthTensor added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 20, 2024
@alice-i-cecile
Copy link
Member

@NthTensor say the word and I'll merge this in.

@NthTensor NthTensor marked this pull request as ready for review September 20, 2024 00:53
@NthTensor
Copy link
Contributor Author

LGMT

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 20, 2024
Merged via the queue into bevyengine:main with commit d7ea5b6 Sep 20, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more A-Picking Pointing at and selecting objects of all sorts C-Bug An unexpected or incorrect behavior D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only single Pointer<Click> when multiple hits against Pickable::should_block_lower:false
3 participants