![]() |
3Gear Systems SDK
v0.9.34
|
Messages relating to simultaneous or individual pinching More...
Public Member Functions | |
BimanualPinchMessage (MessageType type, Hand hand, Vector3D positionLeft, Quaternion rotationLeft, int clickCountLeft, Vector3D positionRight, Quaternion rotationRight, int clickCountRight) | |
override string | Serialize () |
Serialize the message to a string, which could then be sent using the network protocol. More... | |
Static Public Member Functions | |
static new HandTrackingMessage | Parse (TokenStream tokenStream, MessageType type) |
Protected Member Functions | |
BimanualPinchMessage (BasicMessage message, Hand hand) | |
Protected Attributes | |
Hand | hand |
Properties | |
Hand | Hand [get] |
Which hand(s) the message applies to. More... | |
Additional Inherited Members |
Messages relating to simultaneous or individual pinching
Bimanual pinch messages are a ``higher-level'' message than the regular pinch message, and can be used to distinguish whether one hand pinched or whether both pinched simultaneously. If the user presses both hands at the same time, for example, you will only get a single Bimanual SIMULTANEOUSLY_PRESSED message (instead of two PRESSED messages, as you would with the PinchMessage). The cost of this higher-level knowledge is a bit of additional lag: to determine whether two pinches happen at the same time we have to wait 100ms or so (since the pinches are never going to be exactly simultaneous). You can decide whether the added functionality is worth the lag and choose which of the two interfaces you prefer.
Note that we do not recommend responding to both the BimanualPinchMessage and the PinchMessage; applications should generally pick one or the other. Responding to both can lead to very confusing interactions (since most pinches will be detected at least twice).
To help understanding the difference between the PinchMessage and the BimanualPinchMessage, consider the following two scenarios:
First, suppose the user presses her left hand and then, a second later, her right hand. You will receive the following sequence of events:
PinchMessage(PRESSED, left hand) |
... |
BimanualPinchMessage(INDIVIDUALLY_PRESSED, left hand) |
... |
PinchMessage(PRESSED, right hand) |
... |
BimanualPinchMessage(INDIVIDUALLY_PRESSED, right hand) |
Note how the BimanualPinchMessage always lags slightly behind the PinchMessage (you will receive it a couple frames later). Now, suppose the user presses her left and right hands simultaneously.
PinchMessage(PRESSED, left hand) |
PinchMessage(PRESSED, right hand) |
BimanualPinchMessage(SIMULTANEOUSLY_PRESSED, both hands) |
In the case of the double pinch, it can be reported immediately.
|
inlinevirtual |
Serialize the message to a string, which could then be sent using the network protocol.
Reimplemented from ThreeGear.BasicMessage.
|
get |
Which hand(s) the message applies to.
Note that it can be BOTH, in the case of simultaneous pinches and releases.