Exemplo n.º 1
0
        public static IKBone ToIKBone(HumanBodyBones boneID)
        {
            if (_toIKBone.Count == 0)
            {
                for (IKBone b = 0; b < IKBone.LastBone; b++)
                {
                    _toIKBone[QuickUtils.ParseEnum <HumanBodyBones>(b.ToString())] = b;
                }
            }

            return(_toIKBone[boneID]);
        }
Exemplo n.º 2
0
        public static HumanBodyBones ToHumanBodyBones(IKBone ikBone)
        {
            if (_toHumanBodyBones.Count == 0)
            {
                for (IKBone b = 0; b < IKBone.LastBone; b++)
                {
                    _toHumanBodyBones.Add(QuickUtils.ParseEnum <HumanBodyBones>(b.ToString()));
                }
            }

            return(_toHumanBodyBones[(int)ikBone]);
        }
Exemplo n.º 3
0
        protected virtual T CreateIKSolver <T>(IKBone ikBone) where T : QuickIKSolver
        {
            Transform ikSolversRoot = transform.CreateChild(IK_SOLVERS_ROOT_NAME);
            Transform t             = ikSolversRoot.CreateChild(IK_SOLVER_PREFIX + ikBone.ToString());
            T         ikSolver      = t.GetComponent <T>();

            if (!ikSolver)
            {
                ikSolver = t.gameObject.AddComponent <T>();

                //And configure it according to the bone
                HumanBodyBones boneLimb = ToHumanBodyBones(ikBone);
                ikSolver._boneUpper = GetBoneUpper(boneLimb);
                ikSolver._boneMid   = GetBoneMid(boneLimb);
                ikSolver._boneLimb  = _animator.GetBoneTransform((QuickHumanBodyBones)boneLimb);
            }

            return(ikSolver);
        }
Exemplo n.º 4
0
 protected override void DrawIKSolverProperties(IKBone ikBone)
 {
     _target.SetIKControl(ikBone, (QuickUnityVR.ControlType)EditorGUILayout.EnumPopup(ikBone.ToString(), _target.GetIKControl(ikBone)));
     if (_target.GetIKControl(ikBone) != QuickUnityVR.ControlType.Animation)
     {
         DrawIKSolverPropertiesBase(_target.GetIKSolver(ikBone));
     }
 }
 protected virtual void DrawIKSolverProperties(IKBone ikBone)
 {
     DrawIKSolverProperties(_ikManager.GetIKSolver(ikBone), ikBone.ToString());
 }