Пример #1
0
        /*
         * // adds current pose of poseModel to the saved poses list
         * private void AddCurrentPoseToSaved(float fCurrentTime, bool isMirrored)
         * {
         *
         *  PoseModelData pose = new PoseModelData();
         *  pose.fTime = fCurrentTime;
         *  pose.avBoneDirs = new Vector3[poseJoints.Count];
         *
         *  // save model rotation
         *  Quaternion poseModelRotation = poseModel.transform.rotation;
         *
         *
         *  for (int i = 0; i < poseJoints.Count; i++)
         *  {
         *      HumanBodyBones joint = poseJoints[i];
         *      HumanBodyBones nextJoint = HumanBodyBones.GetNextJoint(joint);
         *
         *      if (nextJoint != joint && (int)nextJoint >= 0 && (int)nextJoint < jointCount)
         *      {
         *          Transform poseTransform1 = poseModel.GetBoneTransform(poseModel.GetBoneIndexByJoint(joint, isMirrored));
         *          Transform poseTransform2 = poseModel.GetBoneTransfsorm(poseModel.GetBoneIndexByJoint(nextJoint, isMirrored));
         *
         *          if (poseTransform1 != null && poseTransform2 != null)
         *          {
         *              pose.avBoneDirs[i] = (poseTransform2.position - poseTransform1.position).normalized;
         *          }
         *      }
         *  }
         *
         *  // add pose to the list
         *  alSavedPoses.Add(pose);
         *
         *  // restore model rotation
         *  poseModel.transform.rotation = poseModelRotation;
         * }*/

        private Transform[] GetBoneData(PoseModelHelper ModelData)
        {
            for (int j = 0; j < ModelData.GetBoneTransformCount(); j++)
            {
                bone_data[j] = ModelData.GetBoneTransform(j);
                Debug.Log(bone_data[j].position);
            }
            return(bone_data);
        }