예제 #1
0
        public void Set(KinectCatcher.utilities.Side hand, utilities.Position position)
        {
            switch (hand)
            {
            case KinectCatcher.utilities.Side.Right:
                RightElbowPosition = position;
                break;

            case KinectCatcher.utilities.Side.Left:
                LeftElbowPosition = position;
                break;
            }
        }
예제 #2
0
        public KinectCatcher.utilities.Position Get(KinectCatcher.utilities.Side hand)
        {
            KinectCatcher.utilities.Position position = new utilities.Position();
            switch (hand)
            {
            case KinectCatcher.utilities.Side.Right:
                position = RightHandPosition;
                return(position);

            case KinectCatcher.utilities.Side.Left:
                position = LeftHandPosition;
                return(position);

            default:
                return(new utilities.Position());
            }
        }
예제 #3
0
        /// <summary>
        /// get the fram body status and set my classes data from body parameter
        /// </summary>
        /// <param name="body">Body to get values from and fill the classes data </param>
        void SetBodyFrameValues(Body body)
        {
            #region centers
            //// HEAD
            utilities.Position headPosition = new utilities.Position();
            headPosition.x = body.Joints[JointType.Head].Position.X;
            headPosition.y = body.Joints[JointType.Head].Position.Y;
            headPosition.z = body.Joints[JointType.Head].Position.Z;
            head.Set(headPosition);
            /// Neck
            utilities.Position neckPosition = new utilities.Position();
            neckPosition.x = body.Joints[JointType.Neck].Position.X;
            neckPosition.y = body.Joints[JointType.Neck].Position.Y;
            neckPosition.z = body.Joints[JointType.Neck].Position.Z;
            neck.Set(neckPosition);


            #endregion
            #region Right and left

            #region elbow
            utilities.Position elbowPosition = new utilities.Position();
            elbowPosition.x = body.Joints[JointType.ElbowRight].Position.X;
            elbowPosition.y = body.Joints[JointType.ElbowRight].Position.Y;
            elbowPosition.z = body.Joints[JointType.ElbowRight].Position.Z;
            elbow.Set(utilities.Side.Right, elbowPosition);
            ////left Elbow
            elbowPosition.x = body.Joints[JointType.ElbowLeft].Position.X;
            elbowPosition.y = body.Joints[JointType.ElbowLeft].Position.Y;
            elbowPosition.z = body.Joints[JointType.ElbowLeft].Position.Z;
            elbow.Set(utilities.Side.Left, elbowPosition);
            #endregion             // elbow


            #region Wrist
            utilities.Position wristPosition = new utilities.Position();
            wristPosition.x = body.Joints[JointType.WristRight].Position.X;
            wristPosition.y = body.Joints[JointType.WristRight].Position.Y;
            wristPosition.z = body.Joints[JointType.WristRight].Position.Z;
            wrist.Set(utilities.Side.Right, wristPosition);
            ////left Wrist
            wristPosition.x = body.Joints[JointType.WristLeft].Position.X;
            wristPosition.y = body.Joints[JointType.WristLeft].Position.Y;
            wristPosition.z = body.Joints[JointType.WristLeft].Position.Z;
            wrist.Set(utilities.Side.Left, wristPosition);
            #endregion             // Wrist

            #region Shoulder
            /// Right Shoulder
            utilities.Position shoulderPosition = new utilities.Position();
            shoulderPosition.x = body.Joints[JointType.ShoulderRight].Position.X;
            shoulderPosition.y = body.Joints[JointType.ShoulderRight].Position.Y;
            shoulderPosition.z = body.Joints[JointType.ShoulderRight].Position.Z;
            shoulder.Set(utilities.Side.Right, shoulderPosition);
            ////left Shoulder
            shoulderPosition.x = body.Joints[JointType.ShoulderLeft].Position.X;
            shoulderPosition.y = body.Joints[JointType.ShoulderLeft].Position.Y;
            shoulderPosition.z = body.Joints[JointType.ShoulderLeft].Position.Z;
            shoulder.Set(utilities.Side.Left, shoulderPosition);
            //Center Shoulder
            shoulderPosition.x = body.Joints[JointType.SpineShoulder].Position.X;
            shoulderPosition.y = body.Joints[JointType.SpineShoulder].Position.Y;
            shoulderPosition.z = body.Joints[JointType.SpineShoulder].Position.Z;
            shoulder.Set(utilities.Side.Center, shoulderPosition);



            #endregion // Wrist


            #region HandsPositions
            clsHand.datachanged = true;
            /// Right Hand
            ///
            KinectCatcher.utilities.Position handPosition = new utilities.Position();
            handPosition.x = body.Joints[JointType.HandRight].Position.X;
            handPosition.y = body.Joints[JointType.HandRight].Position.Y;
            handPosition.z = body.Joints[JointType.HandRight].Position.Z;
            hand.SetHandPosition(KinectCatcher.utilities.Side.Right, handPosition);
            hand.SetHandState(utilities.Side.Right, body.HandRightState);

            // left Hand
            handPosition.x = body.Joints[JointType.HandLeft].Position.X;
            handPosition.y = body.Joints[JointType.HandLeft].Position.Y;
            handPosition.z = body.Joints[JointType.HandLeft].Position.Z;
            hand.SetHandPosition(KinectCatcher.utilities.Side.Left, handPosition);
            hand.SetHandState(utilities.Side.Left, body.HandLeftState);


            //End of setting Hands
            // Debug
            this.txtRitght = body.Joints[JointType.HandRight].Position.X.ToString();
            this.txtLeft   = body.Joints[JointType.HandLeft].Position.X.ToString();

            #endregion //Hands positions
            #endregion // Right and left
        }
예제 #4
0
 public void Set(utilities.Position position)
 {
     HeadPosition = position;
 }
예제 #5
0
 public void Set(utilities.Position position)
 {
     neckPosition = position;
 }