Exemplo n.º 1
0
        public void dataArrived(object data)
        {
            Skeleton skeleton = SkeletonUtils.defaultSkeleton(data);

            if (skeleton == null)
            {
                return;
            }

            stream.add(skeleton);
            if (stream.size() == movement.size())
            {
                float diff = SkeletonUtils.difference(stream, movement);
                container.setMovementValue(movementType, diff * 250.0 / threshold);
                if (lastUse.AddSeconds(5) < DateTime.Now)
                {
                    if (diff < threshold)
                    {
                        Debug.WriteLine("Gesture Detected");
                        action.perform();
                        lastUse = DateTime.Now;
                    }
                }
            }
        }
Exemplo n.º 2
0
 public MovementAnalyzer(SkeletonRecording movement, string tag, Action action, MainWindow.Movement movementType, MainWindow container)
 {
     stream            = new SkeletonRecording(tag, movement.size());
     this.movement     = movement;
     this.movementType = movementType;
     this.action       = action;
     this.container    = container;
     lastUse           = DateTime.Now;
 }