public KinectGrabWheelController(WheelDelegate wheelDelegate, ScreenManager screenManager, KinectSensor kinect) { this.device = screenManager.GraphicsDevice; this.wheelDelegate = wheelDelegate; position = new Vector2(); positionScreen = new Vector2(); this.kinectSensor = kinect; //if (!kinect.IsRunning) //{ var parameters = new TransformSmoothParameters { Smoothing = 0.1f, Correction = 0.0f, Prediction = 0.0f, JitterRadius = 1.0f, MaxDeviationRadius = 0.5f }; kinect.SkeletonStream.Enable(parameters); kinect.DepthStream.Enable(); kinect.ColorStream.Enable(); kinect.AllFramesReady += new EventHandler<AllFramesReadyEventArgs>(ks_AllFramesReady); interactionStream = new Microsoft.Kinect.Toolkit.Interaction.InteractionStream(kinect, new myIntClient()); interactionStream.InteractionFrameReady += new EventHandler<InteractionFrameReadyEventArgs>(intStream_InteractionFrameReady); kinect.Start(); //} }
public MouseWheelController(WheelDelegate wheelDelegate, GraphicsDevice device) { this.device = device; this.wheelDelegate = wheelDelegate; mouseState = new MouseState(); position = new Vector2(); camera = new Camera2D(device); }
public KinectInsideWheelController(WheelDelegate wheelDelegate, GraphicsDevice device, KinectSensor kinect, int activeSkeletonIndex, int radius, Vector2 centerPosition) { this.device = device; this.radius = radius; this.centerPosition = centerPosition; this.wheelDelegate = wheelDelegate; position = new Vector2(); camera = new Camera2D(device); if (!kinect.IsRunning) { kinect.SkeletonStream.Enable(); kinect.Start(); } kinect.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(kinectSkeletonFrameReady); if(activeSkeletonIndex>=0){ skeleton = skeletonData[activeSkeletonIndex]; } }