|
@@ -24,6 +24,7 @@ namespace bbiwarg.DataSource
|
|
|
private IDataHandle<Iisu.Data.Vector3>[] forearmPositions3D = new IDataHandle<Iisu.Data.Vector3>[2];
|
|
|
private IDataHandle<Iisu.Data.Vector3>[] palmNormals3D = new IDataHandle<Iisu.Data.Vector3>[2];
|
|
|
private IDataHandle<int[]>[] fingerStatus = new IDataHandle<int[]>[2];
|
|
|
+ private IDataHandle<int>[] handStatus = new IDataHandle<int>[2];
|
|
|
private IDataHandle<Iisu.Data.Vector3[]>[] fingerTipPositions3D = new IDataHandle<Iisu.Data.Vector3[]>[2];
|
|
|
private IDataHandle<Iisu.Data.Vector2[]>[] fingerTipPositions2D = new IDataHandle<Iisu.Data.Vector2[]>[2];
|
|
|
private IDataHandle<int>[] handSides = new IDataHandle<int>[2];
|
|
@@ -96,6 +97,9 @@ namespace bbiwarg.DataSource
|
|
|
fingerStatus[0] = device.RegisterDataHandle<int[]>("CI.HAND1.FingerStatus");
|
|
|
fingerStatus[1] = device.RegisterDataHandle<int[]>("CI.HAND2.FingerStatus");
|
|
|
|
|
|
+ handStatus[0] = device.RegisterDataHandle<int>("CI.HAND1.Status");
|
|
|
+ handStatus[1] = device.RegisterDataHandle<int>("CI.HAND2.Status");
|
|
|
+
|
|
|
fingerTipPositions3D[0] = device.RegisterDataHandle<Iisu.Data.Vector3[]>("CI.HAND1.FingerTipPositions3D");
|
|
|
fingerTipPositions3D[1] = device.RegisterDataHandle<Iisu.Data.Vector3[]>("CI.HAND2.FingerTipPositions3D");
|
|
|
|
|
@@ -256,29 +260,49 @@ namespace bbiwarg.DataSource
|
|
|
return new DenseVector(palmNormals3D[handIndex - 1].Value.ToArray());
|
|
|
}
|
|
|
|
|
|
- public FingerStatus[] getFingerStatus(uint handIndex)
|
|
|
+ public DetectionStatus[] getFingerStatus(uint handIndex)
|
|
|
{
|
|
|
checkHandIndex(handIndex);
|
|
|
int[] status = fingerStatus[handIndex - 1].Value;
|
|
|
- FingerStatus[] result = new FingerStatus[status.Length];
|
|
|
+ DetectionStatus[] result = new DetectionStatus[status.Length];
|
|
|
for (int i = 0; i < status.Length; ++i)
|
|
|
{
|
|
|
switch (status[i])
|
|
|
{
|
|
|
case 0:
|
|
|
- result[i] = FingerStatus.Inactive;
|
|
|
+ result[i] = DetectionStatus.Inactive;
|
|
|
break;
|
|
|
case 1:
|
|
|
- result[i] = FingerStatus.Detected;
|
|
|
+ result[i] = DetectionStatus.Detected;
|
|
|
break;
|
|
|
case 2:
|
|
|
- result[i] = FingerStatus.Tracked;
|
|
|
+ result[i] = DetectionStatus.Tracked;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ public DetectionStatus getHandStatus(uint handIndex)
|
|
|
+ {
|
|
|
+ checkHandIndex(handIndex);
|
|
|
+ int status = handStatus[handIndex - 1].Value;
|
|
|
+ DetectionStatus result = new DetectionStatus();
|
|
|
+ switch (status)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ result = DetectionStatus.Inactive;
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ result = DetectionStatus.Detected;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ result = DetectionStatus.Tracked;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
public Vector[] getFingerTipPositions3D(uint handIndex)
|
|
|
{
|
|
|
checkHandIndex(handIndex);
|