added check for connected kinect
This commit is contained in:
parent
a32da95cde
commit
115de0957f
@ -73,11 +73,17 @@ namespace ANX.InputDevices.Windows.Kinect
|
|||||||
#endregion // Private Members
|
#endregion // Private Members
|
||||||
|
|
||||||
public Kinect()
|
public Kinect()
|
||||||
|
{
|
||||||
|
if (Runtime.Kinects.Count > 0)
|
||||||
{
|
{
|
||||||
pNui = Runtime.Kinects[0];
|
pNui = Runtime.Kinects[0];
|
||||||
pNui.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor);
|
pNui.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor);
|
||||||
pNui.SkeletonEngine.TransformSmooth = true;
|
pNui.SkeletonEngine.TransformSmooth = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("No Kinect was detected, please connect it to your Computer before running this program and make sure you install the Kinect SDK from Microsoft.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.cache = new Vector3[21];
|
this.cache = new Vector3[21];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user