//-------------------------------------------------
 private void HandHoverUpdate(VRTRIXGloveGrab hand)
 {
     //Trigger got pressed
     //Debug.Log(hand.GetStandardInteractionButtonDown());
     if (hand.GetStandardInteractionButtonDown())
     {
         hand.AttachObject(gameObject, attachmentFlags, attachmentPoint);
         //ControllerButtonHints.HideButtonHint(hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger);
     }
 }
        //-------------------------------------------------
        private void OnHandHoverBegin(VRTRIXGloveGrab hand)
        {
            //bool showHint = false;

            // "Catch" the throwable by holding down the interaction button instead of pressing it.
            // Only do this if the throwable is moving faster than the prescribed threshold speed,
            // and if it isn't attached to another hand
            if (!attached)
            {
                if (hand.GetStandardInteractionButton())
                {
                    Rigidbody rb = GetComponent <Rigidbody>();
                    if (rb.velocity.magnitude >= catchSpeedThreshold)
                    {
                        hand.AttachObject(gameObject, attachmentFlags, attachmentPoint);
                        //showHint = false;
                    }
                }
            }
        }
Exemple #3
0
        //-------------------------------------------------
        // Called every Update() while a Hand is hovering over this object
        //-------------------------------------------------
        private void HandHoverUpdate(VRTRIXGloveGrab hand)
        {
            //Debug.Log(VRTRIXGloveVRInteraction.GetGesture(hand.GetHandType()));
            if (hand.GetStandardInteractionButtonDown())
            {
                if (hand.currentAttachedObject != gameObject)
                {
                    // Save our position/rotation so that we can restore it when we detach
                    oldPosition = transform.position;
                    oldRotation = transform.rotation;

                    //Call this to continue receiving HandHoverUpdate messages,
                    // and prevent the hand from hovering over anything else
                    hand.HoverLock(GetComponent <VRTRIXInteractable>());

                    // Attach this object to the hand
                    hand.AttachObject(gameObject, attachmentFlags);
                }
            }
        }