protected virtual void OnSemafoorDetected(IUserChangedEvent userEvent, Semaphore semafoor) { EventHandler<KinectSemaphoreGestureEventArgs> handler = SemafoorDetected; if (handler != null) { handler(this, new KinectSemaphoreGestureEventArgs(userEvent, semafoor)); } }
protected virtual void OnDoubleClap(IUserChangedEvent userEvent) { EventHandler<KinectGestureEventArgs> handler = DoubleClap; if (handler != null) { handler(this, new KinectGestureEventArgs(userEvent)); } }
public override void Process(IUserChangedEvent evt) { _selfTouchCount++; if (_selfTouchCount > HistoryCount) { OnSelfTouchDetected(evt.Id, Joints); _selfTouchCount = 0; } }
protected virtual void OnSemafoorDetected(IUserChangedEvent userEvent, Semaphore semafoor) { EventHandler <KinectSemaphoreGestureEventArgs> handler = SemafoorDetected; if (handler != null) { handler(this, new KinectSemaphoreGestureEventArgs(userEvent, semafoor)); } }
protected virtual void OnDoubleClap(IUserChangedEvent userEvent) { EventHandler <KinectGestureEventArgs> handler = DoubleClap; if (handler != null) { handler(this, new KinectGestureEventArgs(userEvent)); } }
private void OnUserRemoved(IUserChangedEvent userEvent) { var handler = UserRemoved; if (handler == null) { return; } handler(this, new KinectUserEventArgs(userEvent)); }
public override void Process(IUserChangedEvent evt) { AddPoints(evt.HandLeft, evt.ShoulderLeft, evt.HandRight, evt.ShoulderRight); Semaphore detectedSemaphore = CheckForSemafoor(); if (detectedSemaphore != null) { OnSemafoorDetected(evt, detectedSemaphore); } }
public static List <Point3D> GetPoints(this IUserChangedEvent evt, params JointID[] joints) { var points = new List <Point3D>(); foreach (JointID joint in joints) { points.Add(GetPoint(evt, joint)); } return(points); }
/// <summary> /// Processes the specified evt. /// </summary> /// <param name="evt">The evt.</param> public override void Process(IUserChangedEvent evt) { OnProcessingEvent(evt); var handsAreTogether = false; //TODO: Check if hands are together if (handsAreTogether) { OnGestureDetected(); } OnProcessedEvent(evt); }
/// <summary> /// Processes the specified evt. /// </summary> /// <param name="evt">The evt.</param> public override void Process(IUserChangedEvent evt) { if (evt != null) { double predictedarmlength = evt.ShoulderRight.Y - evt.HipRight.Y - ((evt.HipRight.Y - evt.KneeRight.Y) / 2); double maxposition = evt.ShoulderRight.Y + predictedarmlength; double minposition = evt.ShoulderRight.Y - predictedarmlength; double position = evt.HandRight.Y - evt.ShoulderRight.Y; double ratio = (maxposition - minposition) / 2; double normalPosition = position / ratio; //double predictedarmlength = evt.RightHip.Y - evt.RightShoulder.Y - ((evt.RightKnee.Y - evt.RightHip.Y) / 2); //double maxposition = evt.RightShoulder.Y - predictedarmlength; //double minposition = evt.RightShoulder.Y + predictedarmlength; //double position = evt.RightHand.Y + evt.RightShoulder.Y; //double ratio = (maxposition + minposition) / 2; //double normalPosition = position / ratio; OnAccelerationCalculated(evt.Id, -normalPosition); } }
public override void Process(IUserChangedEvent evt) { ////TODO: Gesture <logica hier aanroepen en andere methodes private maken> ////OnSingleClap(evt); ////OnDoubleClap(evt); }
public KinectGestureEventArgs(IUserChangedEvent user) : base(user) { }
private void OnUserRemoved(IUserChangedEvent userEvent) { var handler = UserRemoved; if (handler == null) return; handler(this, new KinectUserEventArgs(userEvent)); }
public override void Process(IUserChangedEvent evt) { throw new NotImplementedException(); }
public KinectSemaphoreGestureEventArgs(IUserChangedEvent userEvent, Semaphore semafoor) : base(userEvent) { Semafoor = semafoor; }
public static Point3D GetPoint(this IUserChangedEvent evt, JointID joint) { switch (joint) { case JointID.Head: return(evt.Head); case JointID.AnkleLeft: return(evt.AnkleLeft); case JointID.ElbowLeft: return(evt.ElbowLeft); case JointID.FootLeft: return(evt.FootLeft); case JointID.HandLeft: return(evt.HandLeft); case JointID.KneeLeft: return(evt.KneeLeft); case JointID.ShoulderLeft: return(evt.ShoulderLeft); case JointID.HipLeft: return(evt.HipLeft); case JointID.ShoulderCenter: return(evt.ShoulderCenter); case JointID.AnkleRight: return(evt.AnkleRight); case JointID.ElbowRight: return(evt.ElbowRight); case JointID.FootRight: return(evt.FootRight); case JointID.HandRight: return(evt.HandRight); case JointID.KneeRight: return(evt.KneeRight); case JointID.HipRight: return(evt.HipRight); case JointID.ShoulderRight: return(evt.ShoulderRight); case JointID.Spine: return(evt.Spine); case JointID.HipCenter: return(evt.HipCenter); } return(default(Point3D)); }
public KinectUserEventArgs(IUserChangedEvent user) { User = user; }