Ejemplo n.º 1
0
 private void Recognizer_TappedEvent(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
 }
    private void GestureRecognizer_TappedEvent(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();
            }
        }
    }
Ejemplo n.º 3
0
    public override bool OnTapped(InteractionSourceKind source, int tapCount, Ray ray)
    {
        if (isHolding)
        {
            ReleaseContent();
            return true;
        }

        return false;
    }
Ejemplo n.º 4
0
    public override bool OnTapped(InteractionSourceKind source, int tapCount, Ray ray)
    {
        if (orbitMesh)
        {
            pointOfInterest.GoToScene();
            displayCard.SetActive(false);
            return true;
        }

        return false;
    }
    public override bool OnTapped(InteractionSourceKind source, int tapCount, Ray ray)
    {
        if (audioSource)
        {
            audioSource.PlayOneShot(AirtapSound);
        }

        VOManager.Instance.Stop(clearQueue: true);
        VOManager.Instance.PlayClip(VOManager.Instance.TrueScale);

        if (!IsAnimating)
        {
            indicatorRenderer.material.mainTexture = IsReal ? SimplifiedIcon : RealIcon;

            // Each view of the solar system has a different max zoom size.
            if (IsReal)
            {
                // Set simplified view max zoom
                ToolManager.Instance.LargestZoom = SimpleViewMaxScale;
            }
            else
            {
                // Set realistic view max zoom
                ToolManager.Instance.LargestZoom = RealisticViewMaxScale;
            }

            IsAnimating = true;

            TransitionManager.Instance.ResetView();

            StartCoroutine(AnimateUsingCurve(IsReal ? OrbitScaleDeHydrationCurve : OrbitScaleHydrationCurve, () => { IsReal = !IsReal; }));

            if (AlternateDescription != null)
            {
                if (descriptionAnimator != null)
                {
                    descriptionAnimator.SetBool("hover", false);
                }

                GameObject tempDescription = Description;
                Description = AlternateDescription;
                AlternateDescription = tempDescription;

                descriptionAnimator = Description.GetComponent<Animator>();
                if (descriptionAnimator != null)
                {
                    Description.SetActive(true);
                    descriptionAnimator.SetBool("hover", true);
                }
            }
        }

        return true;
    }
Ejemplo n.º 6
0
    public override bool OnTapped(InteractionSourceKind source, int tapCount, Ray ray)
    {
        if (audioSource)
        {
            audioSource.PlayOneShot(AirtapSound);
        }

        if (CardPOIManager.Instance != null)
        {
            CardPOIManager.Instance.HideAllCards();
        }

        GoToScene();
        return true;
    }
        private void BeginManipulation(InteractionSourceKind sourceKind)
        {
            // Check if the gesture manager is not null, we're currently focused on this Game Object, and a current manipulation is in progress.
            if (gestureManager != null && gestureManager.FocusedObject != null && gestureManager.FocusedObject == gameObject && gestureManager.ManipulationInProgress)
            {
                Manipulating = true;

                targetInterpolator = gameObject.GetComponent<Interpolator>();

                // In order to ensure that any manipulated objects move with the user, we do all our math relative to the camera,
                // so when we save the initial manipulation position and object position we first transform them into the camera's coordinate space
                initialManipulationPosition = Camera.main.transform.InverseTransformPoint(gestureManager.ManipulationPosition);
                initialObjectPosition = Camera.main.transform.InverseTransformPoint(transform.position);
            }
        }
Ejemplo n.º 8
0
    public override bool OnTapped(InteractionSourceKind source, int tapCount, Ray ray)
    {
        if (Clicked != null)
        {
            Clicked();
        }

        if (!string.IsNullOrEmpty(URL))
        {
        #if NETFX_CORE
            var uri = new System.Uri(URL);
            var unused = Windows.System.Launcher.LaunchUriAsync(uri);
        #else
            Application.OpenURL(URL);
        #endif
        }

        return true;
    }
    private void GestureRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
    {
        GazeManager gm = GazeManager.Instance;
        if (gm.Hit)
        {
            // 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.SpeakText("This voice should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.");
            }
        }
    }
Ejemplo n.º 10
0
    private void HandleUpdatedInput(InteractionSourceKind kind, Vector3 direction, Ray ray)
    {
        if (!contentToManipulate)
        {
            return;
        }

        float y = 0.0f;

        switch (type)
        {
            case ToolType.Pan:
                y = direction.y;

                contentToManipulate.transform.localPosition = new Vector3(contentToManipulate.transform.localPosition.x, contentToManipulate.transform.localPosition.y + (Time.deltaTime * y * PanSpeed), contentToManipulate.transform.localPosition.z);
                break;

            case ToolType.Rotate:
                y = direction.y;

                if (kind == InteractionSourceKind.Hand)
                {
                    y = -y;
                }

                var cam = Camera.main;
                var toContent = (contentToManipulate.transform.position - cam.transform.position).normalized;
                var right = Vector3.Cross(Vector3.up, toContent).normalized;

                var targetUp = Quaternion.AngleAxis(Mathf.Sign(y) * MaxRotationAngle, right) * Vector3.up;

                var currentRotationSpeed = kind == InteractionSourceKind.Hand ? RotationSpeed : ClickerRotationSpeed;

                // use the hero view to determine limits on rotation; however, move the content by the
                // change in rotation, so we are consistently moving the same content/object everywhere
                // (works with resetting content to hero view for example)
                GameObject heroView = ViewLoader.Instance.GetHeroView();
                var desiredUp = Vector3.Slerp(heroView.transform.up, targetUp, Mathf.Clamp01(Time.deltaTime * Mathf.Abs(y) * currentRotationSpeed));
                var upToNewUp = Quaternion.FromToRotation(heroView.transform.up, desiredUp);

                contentToManipulate.transform.rotation =
                    Quaternion.LookRotation(upToNewUp * heroView.transform.forward, desiredUp) * Quaternion.Inverse(heroView.transform.rotation) * // hero view rotation delta
                    contentToManipulate.transform.rotation;
                break;

            case ToolType.Zoom:
                float smallestScale = ToolManager.Instance.TargetMinZoomSize;

                Bounds currentBounds = GetContentBounds();

                float contentXSize = currentBounds.extents.x == 0 ? smallestScale : currentBounds.extents.x;
                float zoomHandDistanceFactor = Mathf.Abs(Mathf.Pow(direction.x, 3)) * Mathf.Sign(direction.x);
                float zoomContentSizeFactor = contentXSize / smallestScale;
                float contentScalar = ToolManager.Instance.SmallestZoom / ToolManager.Instance.TargetMinZoomSize;
                float newScale = contentToManipulate.transform.localScale.x + (Time.deltaTime * zoomHandDistanceFactor * ScaleSpeed * zoomContentSizeFactor * scalePercentValue * contentScalar);

                if (newScale < ToolManager.Instance.SmallestZoom)
                {
                    newScale = ToolManager.Instance.SmallestZoom;
                }

                if (newScale > ToolManager.Instance.LargestZoom)
                {
                    newScale = ToolManager.Instance.LargestZoom;
                }

                contentToManipulate.transform.localScale = new Vector3(newScale, newScale, newScale);
                break;
        }
    }
Ejemplo n.º 11
0
 private void InvokeHoldEvent(GestureEventType eventType, InteractionSourceKind source, Ray headRay)
 {
     switch (eventType)
     {
         case GestureEventType.HoldCanceled:
         {
             HoldCanceledEventDelegate holdCanceledEvent = this.HoldCanceledEvent;
             if (holdCanceledEvent != null)
             {
                 holdCanceledEvent(source, headRay);
             }
             break;
         }
         case GestureEventType.HoldCompleted:
         {
             HoldCompletedEventDelegate holdCompletedEvent = this.HoldCompletedEvent;
             if (holdCompletedEvent != null)
             {
                 holdCompletedEvent(source, headRay);
             }
             break;
         }
         case GestureEventType.HoldStarted:
         {
             HoldStartedEventDelegate holdStartedEvent = this.HoldStartedEvent;
             if (holdStartedEvent != null)
             {
                 holdStartedEvent(source, headRay);
             }
             break;
         }
         default:
             throw new ArgumentException("InvokeHoldEvent: Invalid GestureEventType");
     }
 }
Ejemplo n.º 12
0
 private void InvokeRecognitionEvent(GestureEventType eventType, InteractionSourceKind source, Ray headRay)
 {
     if (eventType != GestureEventType.RecognitionEnded)
     {
         if (eventType != GestureEventType.RecognitionStarted)
         {
             throw new ArgumentException("InvokeRecognitionEvent: Invalid GestureEventType");
         }
     }
     else
     {
         RecognitionEndedEventDelegate recognitionEndedEvent = this.RecognitionEndedEvent;
         if (recognitionEndedEvent != null)
         {
             recognitionEndedEvent(source, headRay);
         }
         return;
     }
     RecognitionStartedEventDelegate recognitionStartedEvent = this.RecognitionStartedEvent;
     if (recognitionStartedEvent != null)
     {
         recognitionStartedEvent(source, headRay);
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Raised when the gesture manager recognizes that a manipulation has been updated.
 /// </summary>
 /// <param name="source">Input Source Kind.</param>
 /// <param name="cumulativeDelta">Cumlulative Data.</param>
 /// <param name="headRay">The Ray from the users forward direction.</param>
 private void ManipulationRecognizer_ManipulationUpdatedEvent(InteractionSourceKind source, Vector3 cumulativeDelta, Ray headRay)
 {
     OnManipulation(inProgress: true, offset: cumulativeDelta);
 }
Ejemplo n.º 14
0
 private void ManipulationRecognizer_ManipulationCompletedEvent(InteractionSourceKind source, Vector3 position, Ray ray)
 {
     IsManipulating = 0;
     IsRotating     = 0;
 }
 protected void GestureRecognizer_Tapped(InteractionSourceKind source, int tapCount, Ray headRay)
 {
     InputManager.Instance.RaiseInputClicked(this, 0, InteractionSourcePressInfo.Select, tapCount);
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Throws <see cref="OnRecognitionStarted"/>. Only used for UI states.
 /// </summary>
 /// <param name="source">Input Source.</param>
 /// <param name="headRay">The Ray from the users forward direction.</param>
 private void GestureRecognizer_RecognitionStartedEvent(InteractionSourceKind source, Ray headRay)
 {
     CalcFocusedObject();
     OnRecognitionStarted();
 }
 /// <summary>
 /// Hide the joystick
 /// </summary>
 private void HideJoystick(InteractionSourceKind source, Vector3 relativePosition, Ray ray)
 {
     SetVisibility(_renderers, false);
 }
Ejemplo n.º 18
0
        private void OnHoldCompletedEvent(InteractionSourceKind source, Ray headray)
        {
            HoldEventArgs args = new HoldEventArgs(this, 0);

            RaiseHoldCompletedEvent(args);
        }
Ejemplo n.º 19
0
 private void GestureRecognizerOnTappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
 {
     Shoot();
 }
Ejemplo n.º 20
0
    public override bool OnTapped(InteractionSourceKind source, int tapCount, Ray ray)
    {
        if (ToolManager.Instance.IsLocked)
        {
            return false;
        }

        ToolAction();
        return true;
    }
 protected void NavigationGestureRecognizer_NavigationCanceled(InteractionSourceKind source, Vector3 normalizedOffset, Ray headray)
 {
     InputManager.Instance.RaiseNavigationCanceled(this, 0);
 }
 protected void GestureRecognizer_ManipulationCanceled(InteractionSourceKind source, Vector3 cumulativeDelta, Ray headray)
 {
     InputManager.Instance.RaiseManipulationCanceled(this, 0);
 }
 protected void GestureRecognizer_HoldCompleted(InteractionSourceKind source, Ray headray)
 {
     InputManager.Instance.RaiseHoldCompleted(this, 0);
 }
Ejemplo n.º 24
0
    public override bool OnTapped(InteractionSourceKind source, int tapCount, Ray ray)
    {
        if (ToolManager.Instance.IsLocked)
        {
            return false;
        }

        bool didAction = false;
        if (IsDisabled)
        {
            ToolSounds.Instance.PlayDisabledClickSound();
        }
        else
        {
            ToolSounds.Instance.PlayClickSound();
            ButtonAction();
            didAction = true;
        }

        return didAction;
    }
Ejemplo n.º 25
0
        private void OnNavigationCanceledEvent(InteractionSourceKind source, Vector3 normalizedOffset, Ray headray)
        {
            NavigationEventArgs args = new NavigationEventArgs(this, 0, normalizedOffset);

            RaiseNavigationCanceledEvent(args);
        }
Ejemplo n.º 26
0
 private void NavigationRecognizer_NavigationCanceledEvent(InteractionSourceKind source, Vector3 relativePosition, Ray ray)
 {
     // 2.b: Set IsNavigating to be false.
 }
    public override bool OnTapped(InteractionSourceKind source, int tapCount, Ray ray)
    {
        // if a card is already up and this was tapped before selection could be faded out, then hide all of the cards (deselection)
        if (!CardPOIManager.Instance.CanTapCard)
        {
            CardPOIManager.Instance.HideAllCards();
        }
        else
        {
            // prevent other cards from being selected while this one is selected
            CardPOIManager.Instance.CanTapCard = false;

            if (CardAnimator)
            {
                if (CardAnimator.GetBool("CardVisible"))
                {
                    HideCard();
                }
                else
                {
                    CardPOIManager.Instance.HideAllCards();
                    UnhideCard();
                }
            }
        }

        return true;
    }
 public virtual bool OnTapped(InteractionSourceKind source, int tapCount, Ray ray)
 {
     return false;
 }
Ejemplo n.º 29
0
 private void ManipulationRecognizer_ManipulationCanceledEvent(InteractionSourceKind source, Vector3 position, Ray ray)
 {
     IsManipulating = false;
 }
 /// <summary>
 /// Update the position of the joystick's pinch to zoom elements
 /// </summary>
 private void UpdateJoystick(InteractionSourceKind source, Vector3 relativePosition, Ray ray)
 {
     PinchPoint.transform.localPosition = relativePosition;
 }
Ejemplo n.º 31
0
 private void GestureRecognizer_HoldCompletedEvent(InteractionSourceKind source, Ray headRay)
 {
     OnHoldCompleted();
 }
Ejemplo n.º 32
0
        private void OnManipulationCanceledEvent(InteractionSourceKind source, Vector3 cumulativeDelta, Ray headray)
        {
            ManipulationEventArgs args = new ManipulationEventArgs(this, 0, cumulativeDelta);

            RaiseManipulationCanceledEvent(args);
        }
Ejemplo n.º 33
0
    private void Recognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
    {
        //Outer target WHITE

        /*var outerTarget = GameObject.CreatePrimitive(PrimitiveType.Sphere); // Create a sphere
         * outerTarget.transform.localScale = new Vector3(0.3f, 0.01F, 0.3f); // Make the sphere smaller
         * outerTarget.transform.position = Camera.main.transform.position + Camera.main.transform.forward; //drop it in front of the camera
         * Rigidbody outerRigid = outerTarget.AddComponent<Rigidbody>(); // Apply physics
         * outerRigid.mass = 100;
         *
         * //Physic Material
         * CapsuleCollider outerPhys = outerTarget.AddComponent<CapsuleCollider>();
         * outerPhys.material = (PhysicMaterial)Resources.Load("Sphere");
         *
         *
         * // Inner target RED
         * var innerTarget = GameObject.CreatePrimitive(PrimitiveType.Sphere);
         * innerTarget.transform.localScale = new Vector3(0.2f, 0.02F, 0.2f); // Make the sphere smaller
         * innerTarget.transform.position = Camera.main.transform.position + Camera.main.transform.forward; // drop it in front of the camera
         * Rigidbody innerRigid = innerTarget.AddComponent<Rigidbody>(); // Apply physics
         * innerRigid.mass = 100;
         *
         * //Add material
         * Renderer rend = innerTarget.GetComponent<Renderer>();
         * Material red = Resources.Load("Red", typeof(Material)) as Material; // Assign Material
         * rend.material = red;*/


        /*var sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); // Create a sphere
         * sphere.transform.localScale = new Vector3(0.3f, 0.3F, 0.3f); // Make the sphere smaller
         * sphere.transform.position = Camera.main.transform.position + Camera.main.transform.forward; //drop it in front of the camera
         * Rigidbody outerRigid = sphere.AddComponent<Rigidbody>(); // Apply physics
         * outerRigid.mass = 100;*/

        /*GameObject target = Instantiate(Resources.Load("Target", typeof(GameObject))) as GameObject;
         * target.transform.localScale = new Vector3(0.3f, 0.3F, 0.3f); // Make the target smaller
         * target.transform.position = Camera.main.transform.position + Camera.main.transform.forward; //drop it in front of the camera
         * Rigidbody targetRig = target.AddComponent<Rigidbody>(); // Apply physics
         * targetRig.mass = 100;*/

        /*Renderer rend = target.GetComponent<Renderer>();
         * Material red = Resources.Load("Red", typeof(Material)) as Material; // Assign Material
         * rend.material = red;*/



        // if (numClicks == 1)
        //{

        /*cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
         * cube.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
         * cube.transform.position = Camera.main.transform.position + Camera.main.transform.forward;
         *
         * Renderer rend = cube.GetComponent<Renderer>();
         * Material red = Resources.Load("Red", typeof(Material)) as Material; // Assign Material
         * rend.material = red;*/


        GameObject targets = Instantiate(Resources.Load("Targets", typeof(GameObject))) as GameObject;

        targets.transform.position = Camera.main.transform.position + Camera.main.transform.forward; //drop it in front of the camera
        numClicks = numClicks + 1;

        if (numClicks >= 1)
        {
            Rigidbody targetRigid = targets.GetComponent <Rigidbody>(); // Apply physics
            targetRigid.constraints = RigidbodyConstraints.FreezeAll;
            targetRigid.useGravity  = true;
        }
        // }
    }
Ejemplo n.º 34
0
 /// <summary>
 /// Throws <see cref="OnTap"/>.
 /// </summary>
 /// <param name="source">Interaction Source.</param>
 /// <param name="tapCount">TODO: Need clarification on what this is </param>
 /// <param name="headRay">The Ray from the users forward direction.</param>
 private void GestureRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
 {
     CalcFocusedObject();
     OnTap();
 }
 /// <summary>
 /// Update each property when the navigation event is updated
 /// </summary>
 /// <param name="source">Hand source</param>
 /// <param name="relativePosition">Position relative to when navigation started</param>
 /// <param name="ray"></param>
 private void OnNavigationUpdated(InteractionSourceKind source, Vector3 relativePosition, Ray ray)
 {
     // If the controller has an active object update its properties
     Event.Value = relativePosition;
 }
Ejemplo n.º 36
0
 /// <summary>
 /// Throws <see cref="OnRecognitionEndeded"/>. Only used for UI states.
 /// </summary>
 /// <param name="source"></param>
 /// <param name="headRay"></param>
 private void GestureRecogniser_RecognitionEndedEvent(InteractionSourceKind source, Ray headRay)
 {
     OnRecognitionEndeded(CalcFocusedObject());
 }
 /// <summary>
 /// Set all values to zero when navigation completes
 /// </summary>
 /// <param name="source"></param>
 /// <param name="relativePosition"></param>
 /// <param name="ray"></param>
 private void OnNavigationEnded(InteractionSourceKind source, Vector3 relativePosition, Ray ray)
 {
     Event.Value = Vector3.zero;
 }
Ejemplo n.º 38
0
 private void ManipulationRecognizer_ManipulationStartedEvent(InteractionSourceKind source, Vector3 position, Ray ray)
 {
     Manipulator.Instance.tappedHandle.SendMessageUpwards("PerformManipulationStart", position);
 }
Ejemplo n.º 39
0
 private void Ended(InteractionSourceKind source, Vector3 position, Ray headRay)
 {
     isManipulating = false;
 }
Ejemplo n.º 40
0
    private void ManipulationRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray ray)
    {
        Debug.Log("tap");
        tapSound.Play();
        var        c = Camera.main.transform;
        RaycastHit hit;
        string     go = "";

        if (Physics.Raycast(c.position, c.forward, out hit))
        {
            go = hit.collider.gameObject.name;
            try
            {
                hit.collider.gameObject.GetComponentInChildren <Text>().color = Color.green;
                lastChange = Time.time;
            }
            catch
            {
            }
        }
        var d = Mathf.Clamp(hit.distance, 1, 3);

        Debug.Log(go);
        if (go == "sizeplus")
        {
            target.transform.localScale *= 1.1f;
        }
        else if (go == "sizeminus")
        {
            target.transform.localScale *= .9f;
        }
        else if (go == "reset")
        {
            manuallyPositioned = false;
            menu.SetActive(false);
            cursor.SetActive(false);
            target.GetComponent <Text>().color = Color.white;
        }
        else if (go == "toggle_rotation")
        {
            rotateText = !rotateText;
        }
        else if (go == "ColorPicker")
        {
            Texture2D texture = hit.collider.gameObject.GetComponent <Renderer>().material.mainTexture as Texture2D;
            Vector2   pixelUV = hit.textureCoord;
            pixelUV.x *= texture.width;
            pixelUV.y *= texture.height;

            Color col = texture.GetPixel((int)pixelUV.x, (int)pixelUV.y);
            if (col != Color.black)
            {
                target.GetComponent <Text>().color = col;
            }
        }
        else
        {
            if (menu.activeInHierarchy)
            {
                menu.SetActive(false);
                cursor.SetActive(false);
            }
            else
            {
                menu.SetActive(true);
                cursor.SetActive(true);
                cursor.transform.localPosition = new Vector3(cursor.transform.localPosition.x, cursor.transform.localPosition.y, d - .1f);
                menu.transform.position        = c.position;
                menu.transform.rotation        = c.rotation;
                menu.transform.position       += c.forward * (d - .1f);
            }
        }
    }
 private void OnHoldStartedEvent(InteractionSourceKind source, Ray headray)
 {
     HoldEventArgs args = new HoldEventArgs(this, 0);
     RaiseHoldStartedEvent(args);
 }
Ejemplo n.º 42
0
 private void InvokeNavigationEvent(GestureEventType eventType, InteractionSourceKind source, Vector3 relativePosition, Ray headRay)
 {
     switch (eventType)
     {
         case GestureEventType.NavigationCanceled:
         {
             NavigationCanceledEventDelegate navigationCanceledEvent = this.NavigationCanceledEvent;
             if (navigationCanceledEvent != null)
             {
                 navigationCanceledEvent(source, relativePosition, headRay);
             }
             break;
         }
         case GestureEventType.NavigationCompleted:
         {
             NavigationCompletedEventDelegate navigationCompletedEvent = this.NavigationCompletedEvent;
             if (navigationCompletedEvent != null)
             {
                 navigationCompletedEvent(source, relativePosition, headRay);
             }
             break;
         }
         case GestureEventType.NavigationStarted:
         {
             NavigationStartedEventDelegate navigationStartedEvent = this.NavigationStartedEvent;
             if (navigationStartedEvent != null)
             {
                 navigationStartedEvent(source, relativePosition, headRay);
             }
             break;
         }
         case GestureEventType.NavigationUpdated:
         {
             NavigationUpdatedEventDelegate navigationUpdatedEvent = this.NavigationUpdatedEvent;
             if (navigationUpdatedEvent != null)
             {
                 navigationUpdatedEvent(source, relativePosition, headRay);
             }
             break;
         }
         default:
             throw new ArgumentException("InvokeNavigationEvent: Invalid GestureEventType");
     }
 }
 private void OnNavigationUpdatedEvent(InteractionSourceKind source, Vector3 normalizedOffset, Ray headray)
 {
     NavigationEventArgs args = new NavigationEventArgs(this, 0, normalizedOffset);
     RaiseNavigationUpdatedEvent(args);
 }
Ejemplo n.º 44
0
 private void InvokeTapEvent(InteractionSourceKind source, Ray headRay, int tapCount)
 {
     TappedEventDelegate tappedEvent = this.TappedEvent;
     if (tappedEvent != null)
     {
         tappedEvent(source, tapCount, headRay);
     }
 }
Ejemplo n.º 45
0
 private void Recognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
 {
     HandleStickyNoteTap();
     HandleDismissOnSelect();
 }
Ejemplo n.º 46
0
 private void ManipulationRecognizer_ManipulationCompletedEvent(InteractionSourceKind source, Vector3 position, Ray ray)
 {
     manipulationPreviousPosition = Vector3.zero;
 }
 private void EndManipulation(InteractionSourceKind sourceKind)
 {
     Manipulating = false;
 }
 private void OnManipulationUpdatedEvent(InteractionSourceKind source, Vector3 cumulativeDelta, Ray headray)
 {
     ManipulationEventArgs args = new ManipulationEventArgs(this, 0, cumulativeDelta);
     RaiseManipulationUpdatedEvent(args);
 }
Ejemplo n.º 49
0
 private void IntroRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray ray)
 {
     Scene.SetActive(true);
     Destroy(gameObject);
 }
 private void OnTappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
 {
     SourceClickEventArgs args = new SourceClickEventArgs(this, 0, tapCount);
     RaiseSourceClickedEvent(args);
 }
Ejemplo n.º 51
0
        private void OnTappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
        {
            SourceClickEventArgs args = new SourceClickEventArgs(this, 0, tapCount);

            RaiseSourceClickedEvent(args);
        }
 public override bool OnTapped(InteractionSourceKind source, int tapCount, Ray ray)
 {
     SelectionPOITarget.OnTapped(source, tapCount, ray);
     return true;
 }
Ejemplo n.º 53
0
 private void GestureRecogniser_RecognitionEndedEvent(InteractionSourceKind source, Ray headRay)
 {
     OnRecognitionEndeded();
 }
Ejemplo n.º 54
0
 private void NavigationRecognizer_NavigationUpdatedEvent(InteractionSourceKind source, Vector3 cumulativeDelta, Ray headRay)
 {
     OnNavigation(true, cumulativeDelta);
 }
 /// <summary>
 /// Show the joystick
 /// </summary>
 private void ShowJoystick(InteractionSourceKind source, Vector3 relativePosition, Ray ray)
 {
     transform.position = ray.origin;
     SetVisibility(_renderers, true);
 }
 public override bool OnTapped(InteractionSourceKind source, int tapCount, Ray ray)
 {
     pointOfInterest.OnTapped(source, tapCount, ray);
     return true;
 }
 public virtual bool OnNavigationUpdated(InteractionSourceKind source, Vector3 relativePosition, Ray ray)
 {
     return false;
 }