|
|
@ -20,11 +20,7 @@ namespace KinectUtils
|
|
|
|
|
|
|
|
|
|
|
|
public static void AddGestures(IGestureFactory factory)
|
|
|
|
public static void AddGestures(IGestureFactory factory)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var gestures = factory.CreateGestures();
|
|
|
|
KnownGestures = (List<BaseGesture>)factory.CreateGestures();
|
|
|
|
foreach (var gesture in gestures)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AddGesture(gesture);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public static void AddGesture(BaseGesture gesture)
|
|
|
|
public static void AddGesture(BaseGesture gesture)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -55,12 +51,19 @@ namespace KinectUtils
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (bodyframe != null)
|
|
|
|
if (bodyframe != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(bodies == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bodies = new Body[bodyframe.BodyCount];
|
|
|
|
|
|
|
|
}
|
|
|
|
bodyframe.GetAndRefreshBodyData(bodies);
|
|
|
|
bodyframe.GetAndRefreshBodyData(bodies);
|
|
|
|
|
|
|
|
if (bodies != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
foreach (var body in bodies)
|
|
|
|
foreach (var body in bodies)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (body.IsTracked)
|
|
|
|
if (body.IsTracked)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach(var gesture in KnownGestures)
|
|
|
|
foreach (var gesture in KnownGestures)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
gesture.TestGesture(body);
|
|
|
|
gesture.TestGesture(body);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -70,4 +73,5 @@ namespace KinectUtils
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|