|
@@ -28,6 +28,7 @@ namespace bbiwarg.DataSource
|
|
|
private IDataHandle<Iisu.Data.IImageData> depthImage;
|
|
|
private IDataHandle<Iisu.Data.IImageData> colorImage;
|
|
|
private IDataHandle<Iisu.Data.IImageData> confidenceImage;
|
|
|
+ private IDataHandle<Iisu.Data.Vertex[]> vertexArray;
|
|
|
|
|
|
/*
|
|
|
* Creates an Iisu data source.
|
|
@@ -68,7 +69,8 @@ namespace bbiwarg.DataSource
|
|
|
depthImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.DEPTH.Image");
|
|
|
colorImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.COLOR.Image");
|
|
|
confidenceImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.CONFIDENCE.Image");
|
|
|
-
|
|
|
+ vertexArray = device.RegisterDataHandle<Iisu.Data.Vertex[]>("SCENE.VertexArray");
|
|
|
+
|
|
|
handOpen[0] = device.RegisterDataHandle<bool>("CI.HAND1.IsOpen");
|
|
|
handOpen[1] = device.RegisterDataHandle<bool>("CI.HAND2.IsOpen");
|
|
|
|
|
@@ -131,8 +133,6 @@ namespace bbiwarg.DataSource
|
|
|
|
|
|
public DepthImage getDepthImage()
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
Iisu.Data.IImageInfos imageInfos = depthImage.Value.ImageInfos;
|
|
|
int width = (int) imageInfos.Width;
|
|
|
int height = (int) imageInfos.Height;
|
|
@@ -176,6 +176,23 @@ namespace bbiwarg.DataSource
|
|
|
return new ConfidenceImage(width, height, confidenceData);
|
|
|
}
|
|
|
|
|
|
+ public VertexArray getVertexArray()
|
|
|
+ {
|
|
|
+ int numVertices = vertexArray.Value.Length;
|
|
|
+
|
|
|
+ Vector[] positions = new Vector[numVertices];
|
|
|
+ Color4[] colors = new Color4[numVertices];
|
|
|
+
|
|
|
+ for (int i = 0; i < numVertices; ++i)
|
|
|
+ {
|
|
|
+ positions[i] = new DenseVector(vertexArray.Value[i].Position.ToArray());
|
|
|
+ Iisu.Data.Color4C color = vertexArray.Value[i].Color;
|
|
|
+ colors[i] = new Color4(color.A, color.R, color.G, color.B);
|
|
|
+ }
|
|
|
+
|
|
|
+ return new VertexArray(positions, colors);
|
|
|
+ }
|
|
|
+
|
|
|
private void checkHandIndex(uint handIndex)
|
|
|
{
|
|
|
if (handIndex < 1 || handIndex > 2)
|