Ejemplo n.º 1
0
    void hands_HandUpdate(object Sender, HandUpdateEventArgs e)
    {
        lastRawPoint = e.Position;
        if (RotateToUser)
        {
            handPos = RotateHandPoint(e.Position);
        }
        else
        {
            handPos = e.Position;
        }

        // see if we're out of our session bounds
        if (SessionBoundingBox && !currentSessionBounds.Contains(Point3DToVector3(handPos)))
        {
            OpenNISessionManager.Instance.EndSession();
            Debug.Log("Session Ended by out of Bounds");
            return;
        }

        foreach (GameObject obj in new List <GameObject>(Listeners))
        {
            if (!obj)
            {
                continue;
            }
            NotifyHandUpdate(obj, handPos);
        }
    }
 void hands_HandUpdate(object Sender, HandUpdateEventArgs e)
 {
     handPos = e.Position;
     foreach (GameObject obj in new List <GameObject>(Listeners))
     {
         NotifyHandUpdate(obj, e.Position);
     }
 }
Ejemplo n.º 3
0
    void hands_HandUpdate(object sender, HandUpdateEventArgs e)
    {
        Debug.Log("Update");
        List <Point3D> lista = tracking[e.UserID];

        lista.Add(e.Position);
        if (lista.Count > trackingSize)
        {
            lista.RemoveAt(0);
        }
    }
Ejemplo n.º 4
0
        void handsGenerator_HandUpdate(object sender, HandUpdateEventArgs e)
        {
            NiteKinectHandGestureEventData eventdata = new NiteKinectHandGestureEventData(new NiteKinectHandGestureData(e.UserID, NiteKinectHandState.Tracking, this.depth.ConvertRealWorldToProjective(e.Position)));

            if (DataReceived != null)
            {
                DataReceived(this, new DataReceivedEventHandler()
                {
                    PluginData = eventdata
                });
            }
        }
Ejemplo n.º 5
0
        void FHands_HandUpdate(object sender, HandUpdateEventArgs e)
        {
            //if this hand is updated for the first time
            //add it to TrackedStartPositions
            //with the original position of this hand which is found in FTrackedHands[e.UserID]
            //before this is updated!
            if (FTrackedHands.ContainsKey(e.UserID) && !FTrackedStartPositions.ContainsKey(e.UserID))
            {
                FTrackedStartPositions.Add(e.UserID, FTrackedHands[e.UserID]);
            }

            if (FTrackedHands.ContainsKey(e.UserID))
            {
                FTrackedHands[e.UserID] = e.Position;                //new Vector3D(e.Position.X / 1000, e.Position.Y / 1000, e.Position.Z / 1000);
            }
        }
Ejemplo n.º 6
0
 // 手の位置の更新
 void hands_HandUpdate(object sender, HandUpdateEventArgs e)
 {
     handStates = HandStatus.Update;
     handPoints.Enqueue(e.Position);
 }