-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFingerUtils.cpp
More file actions
41 lines (35 loc) · 1.31 KB
/
Copy pathFingerUtils.cpp
File metadata and controls
41 lines (35 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <string>
#include <iostream>
#include <windows.h>
#include "pxcsensemanager.h"
#include "pxchandconfiguration.h"
static const std::string FingerTypeStrings[] = { "Thumb", "Index", "Middle", "Ring", "Pinky" };
void displayFingerData(PXCHandData::FingerType finger, PXCHandData::IHand* handData)
{
PXCHandData::FingerData fingerData;
handData->QueryFingerData(finger, fingerData);
std::cout << FingerTypeStrings[finger] << " has foldness " << fingerData.foldedness << " and radius " << fingerData.radius << std::endl;
}
void processFingerInfo(PXCHandData::JointType jointType, PXCHandData::IHand* handData)
{
switch (jointType)
{
case PXCHandData::JointType::JOINT_INDEX_BASE:
displayFingerData(PXCHandData::FingerType::FINGER_INDEX, handData);
break;
case PXCHandData::JointType::JOINT_MIDDLE_BASE:
displayFingerData(PXCHandData::FingerType::FINGER_MIDDLE, handData);
break;
case PXCHandData::JointType::JOINT_PINKY_BASE:
displayFingerData(PXCHandData::FingerType::FINGER_PINKY, handData);
break;
case PXCHandData::JointType::JOINT_RING_BASE:
displayFingerData(PXCHandData::FingerType::FINGER_RING, handData);
break;
case PXCHandData::JointType::JOINT_THUMB_BASE:
displayFingerData(PXCHandData::FingerType::FINGER_THUMB, handData);
break;
default:
break;
}
}