3Gear Systems SDK  v0.9.34
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
ThreeGear.BimanualPinchMessage Class Reference

Messages relating to simultaneous or individual pinching More...

Inheritance diagram for ThreeGear.BimanualPinchMessage:
ThreeGear.BasicMessage ThreeGear.HandTrackingMessage

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...
 
- Public Member Functions inherited from ThreeGear.BasicMessage
HandState GetHandState (int hand)
 The frame defined by the position and rotation of the back of the hand (excluding the wrist). More...
 

Static Public Member Functions

static new HandTrackingMessage Parse (TokenStream tokenStream, MessageType type)
 
- Static Public Member Functions inherited from ThreeGear.BasicMessage
static BasicMessage Parse (TokenStream tokenStream, MessageType type)
 
- Static Public Member Functions inherited from ThreeGear.HandTrackingMessage
static HandTrackingMessage Deserialize (string data)
 Factory method that parses a HandTrackingMessage from a string More...
 

Protected Member Functions

 BimanualPinchMessage (BasicMessage message, Hand hand)
 
- Protected Member Functions inherited from ThreeGear.BasicMessage
 BasicMessage (MessageType type, Vector3D positionLeft, Quaternion rotationLeft, int clickCountLeft, Vector3D positionRight, Quaternion rotationRight, int clickCountRight)
 Constructs a BasicMessage. Should generally not be called by users of the API. More...
 
 BasicMessage (BasicMessage message)
 Copy constructor for a BasicMessage. More...
 
- Protected Member Functions inherited from ThreeGear.HandTrackingMessage
 HandTrackingMessage (MessageType type)
 
 HandTrackingMessage (HandTrackingMessage msg)
 
string ToString (double x)
 
string ToString (int i)
 
string ToString (Vector3D v)
 
string ToString (Quaternion q)
 

Protected Attributes

Hand hand
 
- Protected Attributes inherited from ThreeGear.BasicMessage
HandState[] hands
 

Properties

Hand Hand [get]
 Which hand(s) the message applies to. More...
 

Additional Inherited Members

- Public Attributes inherited from ThreeGear.HandTrackingMessage
const int N_JOINTS = 17
 The number of joints in the hand model, currently 17 (arm, wrist, and 3 each for the 5 fingers). More...
 
const int N_FINGERS = 5
 The number of fingers is five (thumb, index, middle, ring, pinky). More...
 
const int N_HANDS = 2
 Two hands (left and right). More...
 
const int N_POSES = 7
 The number of specifically recognized poses. More...
 
const int N_FINGER_DOFS_PER_HAND = 16
 The number of finger degrees of freedom per hand. More...
 

Detailed Description

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.

Member Function Documentation

override string ThreeGear.BimanualPinchMessage.Serialize ( )
inlinevirtual

Serialize the message to a string, which could then be sent using the network protocol.

Reimplemented from ThreeGear.BasicMessage.

Property Documentation

Hand ThreeGear.BimanualPinchMessage.Hand
get

Which hand(s) the message applies to.

Note that it can be BOTH, in the case of simultaneous pinches and releases.


The documentation for this class was generated from the following file: