Beispiel #1
0
        IEnumerator startGrabCoroutine(HandVRSphereHand.EitherHand hand, Vector3 centerPosition)
        {
            yield return(new WaitForSeconds(0.1f));

            focusedObjects_[(int)hand].StartGrab(hand, centerPosition);
            startGrabCoroutineRunning_[(int)hand] = null;
        }
Beispiel #2
0
 public void EndFocus(HandVRSphereHand.EitherHand hand)
 {
     focusHands_.Remove(hand);
     if (focusHands_.Count == 0)
     {
         material_.color = defaultColor_;
     }
 }
Beispiel #3
0
 public void StartFocus(HandVRSphereHand.EitherHand hand)
 {
     if (focusHands_.Count == 0)
     {
         material_.color = FocusedColor;
     }
     focusHands_.Add(hand);
 }
Beispiel #4
0
        IEnumerator endGrabCoroutine(HandVRSphereHand.EitherHand hand)
        {
            yield return(new WaitForSeconds(0.1f));

            focusedObjects_[(int)hand].EndGrab(hand);
            endGrabCoroutineRunning_[(int)hand] = null;
            isGrab_[(int)hand] = false;
        }
Beispiel #5
0
        public int GetIdFromHandednesses(HandVRSphereHand.EitherHand hand)
        {
            float score0 = GetHandednessesScoreOnLeft(0);
            float score1 = GetHandednessesScoreOnLeft(1);

            if (score0 < 0f && score1 < 0f)
            {
                return(-1);
            }
            else if (!BothHand)
            {
                if (score0 < 0f)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            else if (score0 < 0f)
            {
                if (score1 >= 0f &&
                    (hand == HandVRSphereHand.EitherHand.Left && score1 >= 0.5f ||
                     hand == HandVRSphereHand.EitherHand.Right && score1 < 0.5f))
                {
                    return(1);
                }
                else
                {
                    return(-1);
                }
            }
            else if (score1 < 0f)
            {
                if (hand == HandVRSphereHand.EitherHand.Left && score0 >= 0.5f ||
                    hand == HandVRSphereHand.EitherHand.Right && score0 < 0.5f)
                {
                    return(0);
                }
                else
                {
                    return(-1);
                }
            }
            else
            {
                if (hand == HandVRSphereHand.EitherHand.Left && score0 >= score1 ||
                    hand == HandVRSphereHand.EitherHand.Right && score0 < score1)
                {
                    return(0);
                }
                else
                {
                    return(1);
                }
            }
        }
Beispiel #6
0
        public void StayGrab(HandVRSphereHand.EitherHand hand, Vector3 centerPosition)
        {
            if (targetTransformParent_ == null)
            {
                return;
            }

            targetTransformParent_.position = centerPosition;
        }
Beispiel #7
0
    public void StartGrab(HandVRSphereHand.EitherHand hand, Vector3 centerPosition)
    {
        if (focusHands_.Contains(hand))
        {
            detect();

            focusHands_.Remove(hand);
            material_.color = defaultColor_;
        }
    }
Beispiel #8
0
        void touch(HandVRSphereHand.EitherHand hand)
        {
            if (focusHands_.Contains(hand))
            {
                detect();

                focusHands_.Remove(hand);
                material_.color = DetectColor;
            }
        }
Beispiel #9
0
    public void StartGrab(HandVRSphereHand.EitherHand hand, Vector3 centerPosition)
    {
        if (grabHands_.Count == 0)
        {
            material_.color = GrabColor;

            targetTransformParent_.position = centerPosition;
            targetTransformParent_.LookAt(transform);
            targetTransform_.rotation = transform.rotation;
            targetTransform_.position = transform.position;
        }
        grabHands_.Add(hand);
    }
Beispiel #10
0
        IEnumerator focusStartCoroutine(HandVRSphereHand.EitherHand hand)
        {
            yield return(null);

            if (focusStartHands_.Remove(hand))
            {
                if (focusHands_.Count == 0 && material_.color != DetectColor)
                {
                    material_.color = FocusedColor;
                }
                focusHands_.Add(hand);
            }
        }
Beispiel #11
0
 public void EndGrab(HandVRSphereHand.EitherHand hand)
 {
     grabHands_.Remove(hand);
     if (grabHands_.Count == 0)
     {
         if (focusHands_.Count > 0)
         {
             material_.color = FocusedColor;
         }
         else
         {
             material_.color = defaultColor_;
         }
     }
 }
Beispiel #12
0
        public void EndGrab(HandVRSphereHand.EitherHand hand)
        {
            if (targetTransformParent_ == null)
            {
                return;
            }

            grabHands_.Remove(hand);
            if (grabHands_.Count == 0)
            {
                if (focusHands_.Count > 0)
                {
                    material_.color = FocusedColor;
                }
                else
                {
                    material_.color = defaultColor_;
                }
            }
        }
Beispiel #13
0
 public void EndTouch(HandVRSphereHand.EitherHand hand)
 {
 }
Beispiel #14
0
 public void StayTouch(HandVRSphereHand.EitherHand hand, Vector3 centerPosition)
 {
     touch(hand);
 }
Beispiel #15
0
 public void EndGrab(HandVRSphereHand.EitherHand hand)
 {
 }
Beispiel #16
0
 public void StayGrab(HandVRSphereHand.EitherHand hand, Vector3 centerPosition)
 {
 }
Beispiel #17
0
 public void StartFocus(HandVRSphereHand.EitherHand hand)
 {
     focusStartHands_.Add(hand);
     StartCoroutine(focusStartCoroutine(hand));
 }
Beispiel #18
0
 public void StayGrab(HandVRSphereHand.EitherHand hand, Vector3 centerPosition)
 {
     targetTransformParent_.position = centerPosition;
 }