public static List<JointType> GetJoints(List<ImportedSkeleton> aSkeletonCollection, int aFrames, QuaternionsStyles savingStyle)
        {
            Dictionary<JointType, double> overallResult = InitiazlizeDictionary();

            for (int i = 1; i < aSkeletonCollection.Count; i++)
            {
                var firstSkel = aSkeletonCollection[i - 1];
                var secondSkel = aSkeletonCollection[i];

                foreach (var joint in Enum.GetNames(typeof(JointType)))
                {
                    var jointType = (JointType)Enum.Parse(typeof(JointType), joint);

                    double jointEvaluation = 0;

                    try
                    {
                        if (savingStyle == QuaternionsStyles.Absolute)
                        {
                            jointEvaluation = SkeletonComparer.CompareQuaternions(
                                firstSkel.AbsoluteQuaternions[jointType], secondSkel.AbsoluteQuaternions[jointType]);
                        }
                        else
                        {
                            jointEvaluation = SkeletonComparer.CompareQuaternions(
                                firstSkel.HiararchicalQuaternions[jointType], secondSkel.HiararchicalQuaternions[jointType]);
                        }
                    }
                    catch (Exception e) { }

                    overallResult[jointType] += jointEvaluation / aFrames;
                }
            }

            return SortAndPrepeareToReturn(overallResult.ToList());
        }
Example #2
0
		public static List<JointType> GetJoints(List<ImportedSkeleton> aSkeletonCollection, int aFrames, QuaternionsStyles savingStyle)
		{
			Dictionary<JointType, double> overallResult = InitiazlizeDictionary();

			for (int i = 1; i < aSkeletonCollection.Count; i++)
			{
				var firstSkel = aSkeletonCollection[i - 1];
				var secondSkel = aSkeletonCollection[i];

				foreach (var joint in Enum.GetNames(typeof(JointType)))
				{
					var jointType = (JointType)Enum.Parse(typeof(JointType), joint);

					double jointEvaluation = 0;

					try
					{
						if (savingStyle == QuaternionsStyles.Absolute)
						{
							jointEvaluation = SkeletonComparer.CompareQuaternions(
								firstSkel.AbsoluteQuaternions[jointType], secondSkel.AbsoluteQuaternions[jointType]);
						}
						else
						{
							jointEvaluation = SkeletonComparer.CompareQuaternions(
								firstSkel.HiararchicalQuaternions[jointType], secondSkel.HiararchicalQuaternions[jointType]);
						}
					}
					catch (Exception e) { }

					overallResult[jointType] += jointEvaluation / aFrames;
				}
			}

			return SortAndPrepeareToReturn(overallResult.ToList());
		}