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

Multitouch behaviour #2338

Closed
stdiopt opened this issue Feb 4, 2016 · 8 comments
Closed

Multitouch behaviour #2338

stdiopt opened this issue Feb 4, 2016 · 8 comments

Comments

@stdiopt
Copy link

stdiopt commented Feb 4, 2016

Hi I was trying to create a pinch to scale feature, and come to realize that Event is being fired for every finger independently causing some excessive calls tho performance issues on mobile phones.

is there any plans in this matter? I've seen in code the InteractionManager "//TODO POOL"

@fs-manabu-iwata
Copy link

Hi. This library works fine for me.
https://github.com/dekimasoon/pixi-simple-gesture

@stdiopt
Copy link
Author

stdiopt commented Feb 6, 2016

Hi, Thanks for the suggestion

It seems that, that lib uses pixijs on('touchmove') which is the same called once per finger in a pinch its called twice, I ended up implementing gesture myself using default touchmove event from html5 and some pixijs internals to map touch to local, this way is called less frequent (pool) even if two fingers moved

@stdiopt
Copy link
Author

stdiopt commented Feb 6, 2016

@GoodBoyDigital
Copy link
Member

Hi @stdiopt

The touch events have an id that lets you differentiate between touches,

event.data.identifier will be unique for each finger.

@stdiopt
Copy link
Author

stdiopt commented Mar 1, 2016

I don't think you get my point, the problem is not the identifier for each touch, the problem is the multiplexing of the event causing a possibility of performance issues, its explained on the links I sent. the amount of times the 'touchmove' event is called on pixijs is way higher than the default browser 'touchmove',

example:
Lets say i want to rotate/scale by pointing two fingers and render after transforms
on a html5 'touchmove' I get maximum 60, events with two fingers and per Event I can get the information of the two touches, so its calculating angles, distances, whatever at least 60 times,

in PIXI its being calculated that maximum of 60 times Per finger so its 120 events, basically doing twice the calculations of the same thing

@GoodBoyDigital
Copy link
Member

I think I understand, I guess my question would be are you actually experiencing any performance issues with the events as they are?

@stdiopt
Copy link
Author

stdiopt commented Mar 1, 2016

Yes, I was getting performance problem on mobile (and was quite a diference), was trying to figure a way doing the touches with pixi, but ended up implementing the default html5 event

@lock
Copy link

lock bot commented Feb 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants