PoseAI / PoseCameraAPI

Tools to work with the Pose Camera app
Apache License 2.0
146 stars 38 forks source link

touchQueue and touchStates #5

Closed long1752062104 closed 2 years ago

long1752062104 commented 2 years ago

Is "touchqueue" a drag queue? Is "touchstates" a click event

PoseAI commented 2 years ago

No. touchQueue (in Unity, currently not implemented in the UE4 example) is an event queue which collects all UI touch events received over the network from the framework. This gives you a chance to process the touches during the game loop as appropriate - typically you would run through the full queue and handle each touch event during an update.

A UI touch event mostly follows the Apple definition, so an event is created when you begin a touch on the screen, when you move the touch, when you release and a cancel event (i.e. interrupt from a phone call).

Touchstates shows the current state of the first 10 multi touches.

To further understand the difference:

  1. you touch the screen and hold A single touch event will included in the next packet and will be added to the queue,. There will be no further updates to the queue until the user does something else. In your game code you would probably remove the touch from the queue and do something (i.e. write 'click' on the screen). Touchstates will show the position of the touch at index 0, every packet.

  2. you then move your finger quickly. multiple touch events may be sent with the next packet, one for each position along the path of your finger, and all will be added to the queue. The touchstate will show only the latest position.

  3. you release A single touch event expressing release will sent in the next packet and added to the queue. Touchstates will show released for the state of that touch.

Final note: as of today Dec 18th, touchstates and multitouch are features we have just added to our framework and is currently only available in private testing. We will add this to our public beta app (Pose Camera) soon as well, but if you are using the latter please stay with the previous version of our Unity demo until we make this widely available.