/// <summary> /// 获取每个骨骼分别与坐标系的夹角(X,Y,Z轴的夹角) /// </summary> /// <param name="joints3"></param> /// <returns></returns> public static List <KeyBone> GetBodyAllKeyBones(IReadOnlyDictionary <JointType, Joint> joints3) { var boneDic = SkeletonDictionary.GetBoneDic(); var jointDic = SkeletonDictionary.GetJointDic(); List <KeyBone> keyBones = new List <KeyBone>(); foreach (Bone bone in SkeletonDictionary.GetBoneDic().Keys) { CameraSpacePoint point1 = joints3[boneDic[bone].Item1].Position; CameraSpacePoint point2 = joints3[boneDic[bone].Item2].Position; CameraSpacePoint vector = VectorHelp.GetVector(point1, point2); KeyBone keyBone = new KeyBone { Name = bone, Vector = vector, AngleX = VectorHelp.GetVectorAngle(vector, new CameraSpacePoint() { X = 1, Y = 0, Z = 0 }), AngleY = VectorHelp.GetVectorAngle(vector, new CameraSpacePoint() { X = 0, Y = 1, Z = 0 }), AngleZ = VectorHelp.GetVectorAngle(vector, new CameraSpacePoint() { X = 0, Y = 0, Z = 1 }) }; keyBones.Add(keyBone); } return(keyBones); }