![]() |
3Gear Systems SDK
v0.9.34
|
#include <HandTrackingMessage.h>
Public Types | |
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 } |
Public Member Functions | |
virtual MessageType | getType () const =0 |
virtual std::string | serialize () const =0 |
Serializes the message to send over the network. More... | |
Static Public Member Functions | |
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 HandTrackingMessage * | deserialize (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 | |
HandTrackingMessage () | |
Base class for all hand-tracking messages / events.
An enum describing the message type. Used for distinguishing between similar messages, e.g., between PRESSED and RELEASED, which are both PinchMessages.
Enumerator | |
---|---|
WELCOME |
Provides server and protocol versions. Type of WelcomeMessage. |
USER |
Provides information about the user, such as profile name and skinning information. Type of UserMessage. |
CALIBRATION |
User is in a spread / calibrating pose, provides info about scale and percent complete. Type of CalibrationMessage. |
POSE |
Provides full skeleton pose information. Type of PoseMessage. |
PRESSED |
User pinched index and thumb together. Type of PinchMessage. |
DRAGGED |
User moved hand while holding a pinch. Type of PinchMessage. |
RELEASED |
User released the pinch. Type of PinchMessage. |
MOVED |
User moved without pinching. Type of PinchMessage. |
SIMULTANEOUSLY_PRESSED |
User pinched thumb and index finger of both hands at (approximately) the same time. Type of BimanualPinchMessage. |
INDIVIDUALLY_PRESSED |
User pinched thumb and index finger of one hand (compare to SIMULTANEOUSLY_PRESSED). Type of BimanualPinchMessage. |
SIMULTANEOUSLY_RELEASED |
User released thumb and index finger of both hands at the same time. Type of BimanualPinchMessage. |
INDIVIDUALLY_RELEASED |
User released thumb and index finger of one hand (compare to SIMULTANEOUSLY_RELEASED). Type of BimanualPinchMessage. |
DRAGGED_BIMANUAL |
User moved hands while both were pinching. Type of BimanualPinchMessage. |
POINT |
User pointed at something with the index finger. Type of PointMessage. |
INVALID_DATA |
This should never happen; in practice it will be ignored. |
|
inlineprotected |
Constructor is protected; HandTrackingMessage should only be constructed from network data using the deserialize() function.
|
static |
Given a line of text sent over the network connection, converts it to a valid hand message.
Callers are responsible for freeing the memory.
|
pure virtual |
Returns the message type (e.g. PRESSED or DRAGGED). The message type is useful for distinguishing between similar messages, e.g., between PRESSED and RELEASED, which are both PinchMessages.
Implemented in HandTrackingClient::CalibrationMessage, HandTrackingClient::UserMessage, HandTrackingClient::WelcomeMessage, HandTrackingClient::PointMessage, and HandTrackingClient::BasicMessage.
|
pure virtual |
Serializes the message to send over the network.
Developers should not need to worry about this function unless they write their own networking code.
Implemented in HandTrackingClient::CalibrationMessage, HandTrackingClient::UserMessage, HandTrackingClient::WelcomeMessage, HandTrackingClient::PoseMessage, HandTrackingClient::PointMessage, HandTrackingClient::BimanualPinchMessage, HandTrackingClient::PinchMessage, and HandTrackingClient::BasicMessage.