public void DebugGoals() { //BodyManager bodyManager = new BodyManager(); //foreach (var body in bodyManager.BodyMap.Values) //{ // body.transform.GetChild() //} List <Windows.Kinect.JointType> goalJointTypesList = GetValidGoalJointsList(); List <Windows.Kinect.Joint> goalJointsList = new List <Windows.Kinect.Joint>(); for (int i = 0; i < goalJointTypesList.Count; i++) { Windows.Kinect.JointType jt = goalJointTypesList[i]; Windows.Kinect.Joint j = bodyManager.GetJoint(jt); goalJointsList.Add(j); GameObject jointObj = bodyManager.GetJointObject(jt); bool goalMetForJoint = goalManager.GoalMet(j); if (goalMetForJoint) { Debug.Log("Joint[" + jt.ToString() + "] Goal Met!"); } } if (goalManager.AllGoalsMet(goalJointsList)) { Debug.Log("SUCCESS: All joint goals met!"); } }
public void RefreshJointsFast(Dictionary <JointType, Joint> joints) { if (_pNative == IntPtr.Zero) { throw new ObjectDisposedException("Body"); } int length = Windows_Kinect_Body_get_Joints_Length(_pNative); var keys = new Windows.Kinect.JointType[length]; var values = new Windows.Kinect.Joint[length]; length = Windows_Kinect_Body_get_Joints(_pNative, keys, values, length); joints.Clear(); for (int i = 0; i < length; i++) { joints.Add(keys[i], values[i]); } }