Exemplo n.º 1
0
        //-------------------------------------------------
        private void HandHoverUpdate(Hand hand)
        {
            if (hand.GetStandardInteractionButtonDown())
            {
                // Trigger was just pressed
                lastHandProjected = ComputeToTransformProjected(hand.hoverSphereTransform);

                if (hoverLock)
                {
                    hand.HoverLock(GetComponent <Interactable>());
                    handHoverLocked = hand;
                }

                driving = true;

                ComputeAngle(hand);
                UpdateAll();

                ControllerButtonHints.HideButtonHint(hand, EVRButtonId.k_EButton_SteamVR_Trigger);
            }
            else if (hand.GetStandardInteractionButtonUp())
            {
                // Trigger was just released
                if (hoverLock)
                {
                    hand.HoverUnlock(GetComponent <Interactable>());
                    handHoverLocked = null;
                }
            }
            else if (driving && hand.GetStandardInteractionButton() && hand.hoveringInteractable == GetComponent <Interactable>())
            {
                ComputeAngle(hand);
                UpdateAll();
            }
        }
Exemplo n.º 2
0
 //-------------------------------------------------
 private void HandHoverUpdate(Hand hand)
 {
     if (hand.GetStandardInteractionButtonDown())
     {
         PhysicsAttach(hand);
     }
 }
Exemplo n.º 3
0
 //-------------------------------------------------
 private void HandHoverUpdate(Hand hand)
 {
     if (hand.GetStandardInteractionButtonDown())
     {
         InputModule.instance.Submit(gameObject);
         ControllerButtonHints.HideButtonHint(hand, EVRButtonId.k_EButton_SteamVR_Trigger);
     }
 }
Exemplo n.º 4
0
 //-------------------------------------------------
 private void HandHoverUpdate(Hand hand)
 {
     //Trigger got pressed
     if (hand.GetStandardInteractionButtonDown())
     {
         hand.AttachObject(gameObject, attachmentFlags, attachmentPoint);
         ControllerButtonHints.HideButtonHint(hand, EVRButtonId.k_EButton_SteamVR_Trigger);
     }
 }
Exemplo n.º 5
0
        //-------------------------------------------------
        private void HandHoverUpdate(Hand hand)
        {
            if (hand.GetStandardInteractionButtonDown())
            {
                hand.HoverLock(GetComponent <Interactable>());

                initialMappingOffset = linearMapping.value - CalculateLinearMapping(hand.transform);
                sampleCount          = 0;
                mappingChangeRate    = 0.0f;
            }

            if (hand.GetStandardInteractionButtonUp())
            {
                hand.HoverUnlock(GetComponent <Interactable>());

                CalculateMappingChangeRate();
            }

            if (hand.GetStandardInteractionButton())
            {
                UpdateLinearMapping(hand.transform);
            }
        }