Resolving dropped/lost intra-frame rapid touches #53
Open
hobsynth wants to merge 2 commits intoGamua:masterfrom
Open
Resolving dropped/lost intra-frame rapid touches #53hobsynth wants to merge 2 commits intoGamua:masterfrom
hobsynth wants to merge 2 commits intoGamua:masterfrom
Conversation
Added excess queue to hold touches with same ID. Previously these duplicate touches just overwrote themselves, causing situations of missing touches. This excess queue gets processed after the first queue and before the next frame.
racarone
added a commit
that referenced
this pull request
Feb 1, 2016
…he touch processor, they essentially would "overwrite" themselves causing touches to be lost in the game loop; this is now corrected by checking for duplicates and repeating processing until the queue is empty
|
I took a look at this and you are right again! Touches were completely lost due to this bug. I liked your commit, but I fixed and cleaned this up in f3d44f0. Instead getting an IndexSet for the duplicate IDs, I'm just checking the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I’ve been dealing with an issue of dropped/lost touches. I’m working on an app that allows for extremely rapid multiple touches.
A situation exists now in SPTouchProcessor, where when a touch’s phase changes within the period of a single frame, the last phase overwrites the previous. This may mean that you only get SPTouchPhaseEnded without ever seeing the initial SPTouchPhaseBegan. That represents a dropped touch. Of course, you really have to tap fast in order to re-create this issue. It’s easy to see if the frame rate drops a bit and you’re on a slower device.
I’m really interested to see if anyone can solve this issue in a better and more optimized way.
I’ve tried a few approaches but this one seemed to work the best.
[ Move any matching touches onto a temporary queue. Dispatch the normal queue as usually and then, right after, reprocess the matching touches queue before the next frame. Even though you’ll see these touches fire out at nearly the same time, the point is that all phases still fire and in the correct order. ]
Before we merge this, I’d really like some feedback about performance. I’m guessing there is either a better approach or at least, way to improve the performance.
Thanks in advance.