Esempio n. 1
0
        /// <summary>
        /// Display rotation information of joints of all active hand models.
        /// </summary>
        public void ShowHandsRotationInfo()
        {
            StringBuilder ss = new StringBuilder();

            foreach (UnityHandController handController in _handControllers)
            {
                ss.Append(handController.IsRight ? "Right hand, " : "Left hand, ");
                ss.AppendLine();
                IHandRotationNormalized handRotationNormalized =
                    handController.GetCurrentFingerRotationInfo();
                string rotationInfo = handRotationNormalized.ToString();
                ss.Append(rotationInfo);
                ss.AppendLine();
            }
            string handsRotationInfo = ss.ToString();

            Debug.Log(handsRotationInfo);
        }
        private void DisplayHandRotationNormalized(bool isRight)
        {
            string handLabel = isRight ? "Right Hand" : "Left Hand";

            EditorGUILayout.LabelField(handLabel);
            EditorGUI.indentLevel++;
            if (_dexmoController.HandControllerPairs == null ||
                _dexmoController.HandControllerPairs.Count == 0)
            {
                EditorGUILayout.LabelField(handLabel + " is not initialized.");
            }
            else
            {
                UnityHandController handController = isRight
                    ? _dexmoController.HandControllerPairs[0].Right
                    : _dexmoController.HandControllerPairs[0].Left;
                //if (!handController.Active)
                //{
                //    EditorGUILayout.LabelField(handLabel + " is not active.");
                //}
                //else
                {
                    IHandRotationNormalized handRotation =
                        handController.GetCurrentFingerRotationInfo();
                    int n = handRotation.Fingers.Length;
                    for (int i = 0; i < n; i++)
                    {
                        IFingerRotationNormalized fingerRotation =
                            handRotation.Fingers[i];
                        FingerType fingerType = (FingerType)i;
                        EditorGUILayout.LabelField(fingerType.ToString());
                        DisplayFingerRotationNormalized(fingerRotation);
                    }
                }
            }
            EditorGUI.indentLevel--;
        }
Esempio n. 3
0
 public bool CheckSatisfyCondition(HandPoseType pose,
                                   IHandRotationNormalized handRotation)
 {
     return(HandPoseTypeToConditionDict[pose].CheckSatisfyCondition(handRotation));
 }
 public bool CheckSatisfyCondition(IHandRotationNormalized handRotation)
 {
     return(_handCondition.CheckSatisfyCondition(handRotation));
 }