Ejemplo n.º 1
0
 public Dictionary <Kinect.JointType, Vector2> GetJoints(ulong bodyId)
 {
     if (bodies.TryGetValue(bodyId, out IKinectBody kinectBody))
     {
         KinectBody2D kinectBody2D = (KinectBody2D)kinectBody;
         return(kinectBody2D.joints);
     }
     return(null);
 }
Ejemplo n.º 2
0
//TODO: would be better more generic...
    public Vector2 GetPosition(ulong bodyId, Kinect.JointType jointType)
    {
        if (bodies.TryGetValue(bodyId, out IKinectBody kinectBody))
        {
            KinectBody2D kinectBody2D = (KinectBody2D)kinectBody;
            if (kinectBody2D.joints.TryGetValue(jointType, out Vector2 position))
            {
                return(position);
            }
        }
        return(Vector2.zero); //?
    }