|
@@ -15,15 +15,13 @@ namespace bbiwarg.Graphics
|
|
|
{
|
|
|
class Output : GameWindow
|
|
|
{
|
|
|
- private IInputProvider inputProvider;
|
|
|
private IVideoHandle videoHandle;
|
|
|
private ForeFingerDetection foreFingerDetection;
|
|
|
|
|
|
private uint imageBufferId, pointBufferId;
|
|
|
|
|
|
- public Output(IInputProvider inputProvider, IVideoHandle videoHandle)
|
|
|
+ public Output(IVideoHandle videoHandle)
|
|
|
{
|
|
|
- this.inputProvider = inputProvider;
|
|
|
this.videoHandle = videoHandle;
|
|
|
this.foreFingerDetection = new ForeFingerDetection(videoHandle);
|
|
|
}
|
|
@@ -39,12 +37,6 @@ namespace bbiwarg.Graphics
|
|
|
|
|
|
protected override void OnRenderFrame(FrameEventArgs e)
|
|
|
{
|
|
|
- if (!inputProvider.isActive())
|
|
|
- {
|
|
|
- inputProvider.stop();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
base.OnRenderFrame(e);
|
|
|
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
|
|
Matrix4 modelview = Matrix4.LookAt(Vector3.Zero, -Vector3.UnitZ, Vector3.UnitY);
|
|
@@ -72,7 +64,7 @@ namespace bbiwarg.Graphics
|
|
|
// draw points
|
|
|
float[] pointData;
|
|
|
|
|
|
- DetectionStatus[] fingerStatus = inputProvider.getFingerStatus(1);
|
|
|
+ DetectionStatus[] fingerStatus = videoHandle.getFingerStatus(1);
|
|
|
int numFingersDetected = 0;
|
|
|
for (int i = 0; i < fingerStatus.Length; ++i)
|
|
|
{
|
|
@@ -84,7 +76,7 @@ namespace bbiwarg.Graphics
|
|
|
Color y = Color.Yellow;
|
|
|
Vector palmPosition = videoHandle.getPalmPosition3D(1);
|
|
|
Vector foreFingerPosition = videoHandle.pixel2VertexPosition(foreFingerDetection.getForeFingerPosition3D(1));
|
|
|
- Vector foreArmPosition = inputProvider.getForearmPosition3D(1);
|
|
|
+ Vector foreArmPosition = videoHandle.getForearmPosition3D(1);
|
|
|
|
|
|
pointData[0] = palmPosition[0];
|
|
|
pointData[1] = palmPosition[1];
|
|
@@ -106,7 +98,7 @@ namespace bbiwarg.Graphics
|
|
|
|
|
|
|
|
|
int index = 14;
|
|
|
- Vector[] fingerPositions = inputProvider.getFingerTipPositions3D(1);
|
|
|
+ Vector[] fingerPositions = videoHandle.getFingerTipPositions3D(1);
|
|
|
for (int i = 0; i < fingerStatus.Length; ++i)
|
|
|
{
|
|
|
if (fingerStatus[i] == DetectionStatus.Detected || fingerStatus[i] == DetectionStatus.Tracked)
|