public KinectController(KinectSensor kinectSensor, Stopwatch stopwatch, Flock flock, Texture2D kinectRGBVideo, GraphicsDeviceManager graphics) { this.stopwatch = stopwatch; this.kinectSensor = kinectSensor; this.flock = flock; this.kinectRGBVideo = kinectRGBVideo; this.graphics = graphics; this.timer.Start(); users = new Person[MAX_NUM_USERS]; buttonsCollection = new ArrayList(5); //waveGestureDetector = new WaveGestureDetector(kinectSensor); // Subscribe to the wave gesture detector as an observer. //waveGestureDetector.GestureDetected += new System.EventHandler<WaveGestureEventArgs>(this.WaveGestureDetected); pressGestureDetector = new PressGestureDetector(); // Subscribe to the press gesture detector as an observer. pressGestureDetector.GestureDetected += new System.EventHandler<PressGestureEventArgs>(this.PressGestureDetected); // Subscribe to the scissor gesture detector as an observer scissorGestureDetector = new ScissorGestureDetector(); scissorGestureDetector.GestureDetected += new System.EventHandler<ScissorGestureEventArgs>(this.ScissorGestureDetected); // Initialize the found and connected device. if (kinectSensor.Status == KinectStatus.Connected) { InitializeKinect(); } }
// Minimum time that must have passed since the last agent was spawned // before we allow another to be spawned by the same user/hand. public DaVinciExhibit() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; graphics.PreferredBackBufferWidth = gameWidth; graphics.PreferredBackBufferHeight = gameHeight; this.graphics.IsFullScreen = true; graphics.ApplyChanges(); stopwatch = new Stopwatch(); flock = new Flock(75, dataWidth, dataHeight, 75); tutorialModeOn = true; DiscoverKinectSensor(); kinectController = new KinectController(kinectSensor, stopwatch, flock, kinectRGBVideo, graphics); }