Example #1
0
        public double getProtrudingDistance(Skeleton skeleton, ExerciseVariant exerciseVariant)
        {
            Joint  handJoint        = GetGloveJoint(skeleton, exerciseVariant);
            Joint  shoulderJoint    = GetShoulderJoint(skeleton, exerciseVariant);
            double protrudingLength = Math.Abs(MathsHelper.DistanceBetweenPoints(shoulderJoint, handJoint, Axis.X, Axis.Z));

            return(protrudingLength);
        }
        static public double getPlayerRotationAngle(Skeleton skeleton, ExerciseVariant exerciseVariant)
        {
            Joint  ShoulderLeft        = skeleton.Joints[JointType.ShoulderLeft];
            Joint  ShoulderRight       = skeleton.Joints[JointType.ShoulderRight];
            double hypotenuseLength    = Math.Abs(MathsHelper.DistanceBetweenPoints(ShoulderLeft, ShoulderRight, Axis.X, Axis.Z));
            double oppositeSideLength  = MathsHelper.DistanceBetweenPoints(ShoulderLeft, ShoulderRight, Axis.Z);
            double playerRotationAngle = Math.Asin(oppositeSideLength / hypotenuseLength);// / Math.PI * 180;

            return(playerRotationAngle);
        }
Example #3
0
        public double getLiftDistance(Skeleton skeleton, ExerciseVariant exercisevarinat)
        {
            Joint firstPoint, secondPoint;

            switch (exercisevarinat)
            {
            case ExerciseVariant.HandLeft:
                firstPoint  = skeleton.Joints[JointType.ShoulderLeft];
                secondPoint = skeleton.Joints[JointType.WristLeft];
                break;

            case ExerciseVariant.HandRight:
            default:
                firstPoint  = skeleton.Joints[JointType.ShoulderRight];
                secondPoint = skeleton.Joints[JointType.WristRight];
                break;
            }

            return(MathsHelper.DistanceBetweenPoints(firstPoint, secondPoint, Axis.Y));
        }
Example #4
0
        public double getHorizonatalAngle(Skeleton skeleton, ExerciseVariant exercisevarinat)
        {
            Joint centerPoint, leftPoint, rightPoint;

            switch (exercisevarinat)
            {
            case ExerciseVariant.HandLeft:
                leftPoint   = skeleton.Joints[JointType.ShoulderRight];
                centerPoint = skeleton.Joints[JointType.ShoulderLeft];
                rightPoint  = skeleton.Joints[JointType.HandLeft];
                break;

            case ExerciseVariant.HandRight:
            default:
                leftPoint   = skeleton.Joints[JointType.ShoulderLeft];
                centerPoint = skeleton.Joints[JointType.ShoulderRight];
                rightPoint  = skeleton.Joints[JointType.HandRight];
                break;
            }

            return(-1 * (MathsHelper.AngleBetweenJoints(leftPoint, centerPoint, rightPoint, Axis.X, Axis.Z) - 180)); // 0 when straight angle, increase when twisting
        }