void Instance_OnManipulationStarted(UnityEngine.VR.WSA.Input.InteractionSourceKind sourceKind) { if (CanTrack) { CreateAndStartTrackingGameObject(); } }
// Move Gesture private void MoveRecognizer_ManipulationStartedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, Vector3 position, Ray ray) { IsManipulating = true; InitialHandleObject(focusedObject); initialHeadPos = Camera.main.transform.position; handlePlacement.PerformManipulationStart(position); }
private void GestureRecognizer_TappedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, int tapCount, Ray headRay) { GazeManager gm = GazeManager.Instance; if (gm.IsGazingAtObject) { // Get the target object GameObject obj = gm.HitInfo.collider.gameObject; // Try and get a TTS Manager TextToSpeechManager tts = null; if (obj != null) { tts = obj.GetComponent <TextToSpeechManager>(); } // If we have a text to speech manager on the target object, say something. // This voice will appear to emanate from the object. if (tts != null && !tts.IsSpeaking()) { // Get the name var voiceName = Enum.GetName(typeof(TextToSpeechVoice), tts.Voice); // Create message var msg = string.Format("This is the {0} voice. It should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.", voiceName); // Speak message tts.SpeakText(msg); } else if (tts.IsSpeaking()) { tts.StopSpeaking(); } } }
private void InputActionRecognizer_HoldStartEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, Ray headRay) { _audioSource.clip = ChargeSound; _audioSource.Play(); //StartRecordButtonOnClickHandler(); }
public void PerformManipulationStart(UnityEngine.VR.WSA.Input.InteractionSourceKind sourceKind) { if (IsThisFocusedByGaze()) { initialPosition = transform.position; beingManipulated = true; } }
private void Recognizer_TappedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, int tapCount, Ray headRay) { var cube = GameObject.CreatePrimitive(PrimitiveType.Cube); // Create a cube cube.transform.localScale = Vector3.one * 0.3f; // Make the cube smaller cube.transform.position = Camera.main.transform.position + Camera.main.transform.forward; // Start to drop it in front of the camera cube.AddComponent <Rigidbody>(); // Apply physics }
/// <summary> /// Constructor /// </summary> public HoloHand() { this.KIND = UnityEngine.VR.WSA.Input.InteractionSourceKind.Hand; _position = UnityEngine.Vector3.zero; _savedPosition = UnityEngine.Vector3.zero; _deltaPosition = UnityEngine.Vector3.zero; _velocity = UnityEngine.Vector3.zero; }
private void MoveRecognizer_ManipulationCanceledEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, Vector3 position, Ray ray) { IsManipulating = false; if (handleObj != null) { FreeHandleObject(); } ShowCursorHoldingFeedback(false); }
private void ZoomRecognizer_NavigationCanceledEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, Vector3 relativePosition, Ray ray) { IsZooming = false; if (handleObj != null) { FreeHandleObject(); } ShowCursorHoldingFeedback(false); }
/// <summary> /// Fired when user tapped an object in the scene. /// </summary> /// <param name="source">InteractionSourceKind</param> /// <param name="tapCount">int</param> /// <param name="ray">Ray</param> private void OnTapEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, int tapCount, UnityEngine.Ray head_ray) { if (onTappedDelegate != null) { onTappedDelegate(); } if (this.FocusedObject != null) { this.FocusedObject.SendMessageUpwards(Misc.HoloEvents.ON_SELECT); } }
/// <summary> /// Fired when user is manipulating the manipulation object. /// </summary> /// <param name="source">InteractionSourceKind</param> /// <param name="cumulativeData">Vector3</param> /// /// <param name="head_ray">Ray</param> private void OnManipulationUpdateEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, UnityEngine.Vector3 cumulativeData, UnityEngine.Ray head_ray) { if (onManipulationDelegate != null) { onManipulationDelegate(); } if (this.ManipulationObject != null) { this.ManipulationObject.SendMessageUpwards(Misc.HoloEvents.ON_MANIPULATE, cumulativeData); } }
/// <summary> /// Fired when user completed holding the focussed object. /// </summary> /// <param name="source">InteractionSourceKind</param> /// <param name="ray">Ray</param> private void OnHoldCompletedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, UnityEngine.Ray head_ray) { if (onHoldEndDelegate != null) { onHoldEndDelegate(); } if (this.FocusedObject != null) { this.FocusedObject.SendMessageUpwards(Misc.HoloEvents.ON_HOLD_END, head_ray); } }
private void MoveRecognizer_ManipulationUpdatedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, Vector3 position, Ray ray) { IsManipulating = true; handlePlacement.PerformManipulationUpdate(position - Camera.main.transform.position + initialHeadPos); ShowCursorHoldingFeedback(true); }
public void PerformManipulationEnd(UnityEngine.VR.WSA.Input.InteractionSourceKind sourceKind) { beingManipulated = false; snapToGrid(); }
private void SaveRecognizer_TappedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, int tapCount, Ray headRay) { PointsManager.Instance.AddPoint(); }
private void ZoomRecognizer_NavigationUpdatedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, Vector3 relativePosition, Ray ray) { IsZooming = true; handlePlacement.PerformScale(relativePosition); ShowCursorHoldingFeedback(true); }
void Instance_OnManipulationCompleted(UnityEngine.VR.WSA.Input.InteractionSourceKind sourceKind) { ThrowTrackedGameObject(); }
protected void OnManipulationCanceledEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, Vector3 cumulativeDelta, Ray headray) { inputManager.RaiseManipulationCanceled(this, 0, cumulativeDelta); }
protected void OnHoldCompletedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, Ray headray) { inputManager.RaiseHoldCompleted(this, 0); }
protected void OnTappedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, int tapCount, Ray headRay) { inputManager.RaiseInputClicked(this, 0, tapCount); }
private void RotateRecognizer_NavigationCompletedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, Vector3 relativePosition, Ray ray) { IsNavigating = false; FreeHandleObject(); ShowCursorHoldingFeedback(false); }
// Zoom Gesture private void ZoomRecognizer_NavigationStartedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, Vector3 relativePosition, Ray ray) { IsZooming = true; InitialHandleObject(focusedObject); }
private void Instance_InputTapped(UnityEngine.VR.WSA.Input.InteractionSourceKind sourceKind, int tapCount, Ray ray) { tapped = true; }
private void InputTapped(UnityEngine.VR.WSA.Input.InteractionSourceKind arg1, int tapCount, Ray arg2) { HideAllCards(); }
// Click Gesture private void ClickRecognizer_TappedEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, int tapCount, Ray headRay) { focusedObject.SendMessage("OnSelect"); }
protected void OnNavigationCanceledEvent(UnityEngine.VR.WSA.Input.InteractionSourceKind source, Vector3 normalizedOffset, Ray headray) { inputManager.RaiseNavigationCanceled(this, 0, normalizedOffset); }
void Instance_OnManipulationCanceled(UnityEngine.VR.WSA.Input.InteractionSourceKind sourceKind) { DestoryTrackedGameObject(); }