void OnHandHoverBegin( VRHand hand ) { bool showHint = true; // "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; } } } if ( showHint ) { VRControllerButtonHints.Show( hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger ); } }
void OnHandHoverBegin(VRHand hand) { bool showHint = true; // "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; } } } if (showHint) { VRControllerButtonHints.Show(hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger); } }
private void Pulse() { if (hand && (hand.controller != null) && (hand.GetStandardInteractionButton())) { ushort duration = ( ushort )Random.Range(minimumPulseDuration, maximumPulseDuration + 1); hand.controller.TriggerHapticPulse(duration); onPulse.Invoke(); } }
void OnHandHoverBegin( VRHand hand ) { // "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, snapOnAttach, attachmentPoint, detachOthers ); } } } }
void OnHandHoverBegin(VRHand hand) { // "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, snapOnAttach, attachmentPoint, detachOthers); } } } }
void HandHoverUpdate( VRHand hand ) { if ( hand.currentAttachedObject ) return; if ( hand.GetStandardInteractionButtonDown() ) { hand.HoverLock( GetComponent<VRInteractable>() ); } if ( hand.GetStandardInteractionButtonUp() ) { hand.HoverUnlock( GetComponent<VRInteractable>() ); } if ( hand.GetStandardInteractionButton() ) { UpdateLinearMapping( hand.transform ); } }
void HandHoverUpdate(VRHand hand) { if (hand.currentAttachedObject) { return; } if (hand.GetStandardInteractionButtonDown()) { hand.HoverLock(GetComponent <VRInteractable>()); } if (hand.GetStandardInteractionButtonUp()) { hand.HoverUnlock(GetComponent <VRInteractable>()); } if (hand.GetStandardInteractionButton()) { UpdateLinearMapping(hand.transform); } }
void HandHoverUpdate(VRHand hand) { if (hand.GetStandardInteractionButtonDown()) { hand.HoverLock(GetComponent <VRInteractable>()); initialMappingOffset = linearMapping.value - CalculateLinearMapping(hand.transform); sampleCount = 0; mappingChangeRate = 0.0f; } if (hand.GetStandardInteractionButtonUp()) { hand.HoverUnlock(GetComponent <VRInteractable>()); CalculateMappingChangeRate(); } if (hand.GetStandardInteractionButton()) { UpdateLinearMapping(hand.transform); } }
void HandHoverUpdate( VRHand hand ) { if ( hand.GetStandardInteractionButtonDown() ) { hand.HoverLock( GetComponent<VRInteractable>() ); initialMappingOffset = linearMapping.value - CalculateLinearMapping( hand.transform ); sampleCount = 0; mappingChangeRate = 0.0f; } if ( hand.GetStandardInteractionButtonUp() ) { hand.HoverUnlock( GetComponent<VRInteractable>() ); CalculateMappingChangeRate(); } if ( hand.GetStandardInteractionButton() ) { UpdateLinearMapping( hand.transform ); } }