GetJointIndex() public method

Gets the index of the joint in the joint's array
public GetJointIndex ( KinectInterop joint ) : int
joint KinectInterop Joint.
return int
Example #1
0
        /// <summary>
        /// Gets the list of gesture joint indexes.
        /// </summary>
        /// <returns>The needed joint indexes.</returns>
        /// <param name="manager">The KinectManager instance</param>
        public static int[] GetNeededJointIndexes(KinectManager manager)
        {
            leftHandIndex = manager.GetJointIndex(KinectInterop.JointType.HandLeft);
            rightHandIndex = manager.GetJointIndex(KinectInterop.JointType.HandRight);

            leftElbowIndex = manager.GetJointIndex(KinectInterop.JointType.ElbowLeft);
            rightElbowIndex = manager.GetJointIndex(KinectInterop.JointType.ElbowRight);

            leftShoulderIndex = manager.GetJointIndex(KinectInterop.JointType.ShoulderLeft);
            rightShoulderIndex = manager.GetJointIndex(KinectInterop.JointType.ShoulderRight);

            hipCenterIndex = manager.GetJointIndex(KinectInterop.JointType.SpineBase);
            shoulderCenterIndex = manager.GetJointIndex(KinectInterop.JointType.SpineShoulder);

            leftHipIndex = manager.GetJointIndex(KinectInterop.JointType.HipLeft);
            rightHipIndex = manager.GetJointIndex(KinectInterop.JointType.HipRight);

            leftAnkleIndex = manager.GetJointIndex(KinectInterop.JointType.AnkleLeft);
            rightAnkleIndex = manager.GetJointIndex(KinectInterop.JointType.AnkleRight);

            neck = manager.GetJointIndex(KinectInterop.JointType.Neck);
            hipsIndex = manager.GetJointIndex(KinectInterop.JointType.SpineBase);

            int[] neededJointIndexes = {
            leftHandIndex, rightHandIndex, leftElbowIndex, rightElbowIndex, leftShoulderIndex, rightShoulderIndex,
            hipCenterIndex, shoulderCenterIndex, leftHipIndex, rightHipIndex, leftAnkleIndex, rightAnkleIndex
            };

            return neededJointIndexes;
        }