コード例 #1
0
        public void SetupKinectHandler()
        {
            //throw an exception if there isn't a kinect hooked up
            if (!KinectSensor.KinectSensors.Any())
            {
                throw new ApplicationException("no kinect sensor detected");
            }

            int count = 1;

            foreach (KinectSensor s in KinectSensor.KinectSensors)
            {
                if (s.Status == KinectStatus.Connected)
                {
                    KinectActor p1 = new KinectActor(_game);
                    KinectActor p2 = new KinectActor(_game);
                    _sensors.Add(new SensorManager(p1, p2));
                    Actors.Add(p1);
                    Actors.Add(p2);
                    count++;
                }
                if (count > _maxSuppoortedSensors)
                {
                    return;
                }
            }
        }
コード例 #2
0
 public KinectActor(KinectActor other)
 {
     _parent         = other._parent;
     ZoomLevel       = other.ZoomLevel;
     ActorSkeleton   = other.ActorSkeleton;
     ScreenLocationX = other.ScreenLocationX;
     ScreenLocationY = other.ScreenLocationY;
     Active          = other.Active;
     //ActorFace = other.ActorFace;
 }
コード例 #3
0
 public SensorManager(KinectActor p1, KinectActor p2)
 {
     Player1 = p1;
     Player2 = p2;
 }