3Gear Systems SDK  v0.9.34
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | List of all members
HandTrackingClient::BimanualPinchMessage Class Reference

Messages relating to simultaneous or individual pinching. More...

#include <HandTrackingMessage.h>

Inheritance diagram for HandTrackingClient::BimanualPinchMessage:
HandTrackingClient::BasicMessage HandTrackingClient::HandTrackingMessage

Public Member Functions

 BimanualPinchMessage (const MessageType type, const Hand hand, const Vector3f &positionLeft, const Quaternionf &rotationLeft, const int clickCountLeft, const Vector3f &positionRight, const Quaternionf &rotationRight, const int clickCountRight)
 Constructs a BimanualPinchMessage. Should not generally be called by users of the API.
 
const Hand getHand () const
 
std::string serialize () const
 
- Public Member Functions inherited from HandTrackingClient::BasicMessage
MessageType getType () const
 
const HandStategetHandState (int hand) const
 Returns the overall general hand state, excluding fingers. More...
 
 BasicMessage (const MessageType type, const Vector3f &positionLeft, const Quaternionf &rotationLeft, const int clickCountLeft, const Vector3f &positionRight, const Quaternionf &rotationRight, const int clickCountRight)
 Constructs a BasicMessage. Should not generally be called by users of the API.
 

Additional Inherited Members

- Public Types inherited from HandTrackingClient::HandTrackingMessage
enum  MessageType {
  WELCOME = 0, USER = 100, CALIBRATION = 101, POSE = 200,
  PRESSED = 300, DRAGGED = 301, RELEASED = 302, MOVED = 303,
  SIMULTANEOUSLY_PRESSED = 400, INDIVIDUALLY_PRESSED = 401, SIMULTANEOUSLY_RELEASED = 402, INDIVIDUALLY_RELEASED = 403,
  DRAGGED_BIMANUAL = 404, POINT = 500, INVALID_DATA = 10000
}
 
- Static Public Member Functions inherited from HandTrackingClient::HandTrackingMessage
static const char * messageTypeToString (MessageType m)
 Convert from a MessageType to its string representation; used for serialization.
 
static MessageType stringToMessageType (const std::string &str)
 Convert from a string to a MessageType; used in deserialization.
 
static HandTrackingMessagedeserialize (const std::string &data)
 Given a line of text sent over the network connection, converts it to a valid hand message. More...
 
- Protected Member Functions inherited from HandTrackingClient::HandTrackingMessage
 HandTrackingMessage ()
 

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:

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.

Member Function Documentation

const Hand HandTrackingClient::BimanualPinchMessage::getHand ( ) const
inline
Returns
which hand(s) this message applies to (can be BOTH, for simultaneous pinch/release).
std::string HandTrackingClient::BimanualPinchMessage::serialize ( ) const
virtual

Serializes the message to a string, which could then be output over the network.

Reimplemented from HandTrackingClient::BasicMessage.


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