Skip to content

Commit

Permalink
Implement pause-aware picking
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
RandomShaper committed Feb 6, 2021
1 parent 89a43d9 commit a63996a
Show file tree
Hide file tree
Showing 3 changed files with 264 additions and 236 deletions.
1 change: 1 addition & 0 deletions scene/main/scene_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ bool SceneTree::physics_process(float p_time) {
emit_signal("physics_frame");

_notify_group_pause("physics_process_internal", Node::NOTIFICATION_INTERNAL_PHYSICS_PROCESS);
call_group_flags(GROUP_CALL_REALTIME, "_viewports", "_process_picking");
_notify_group_pause("physics_process", Node::NOTIFICATION_PHYSICS_PROCESS);
_flush_ugc();
MessageQueue::get_singleton()->flush(); //small little hack
Expand Down
Loading

0 comments on commit a63996a

Please sign in to comment.