Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

ManipulationUpdatedEvent only called on X-Axis

lukaswerzlukaswerz
edited October 2016 in Questions And Answers

Hello everybody

I reuse the GestureManager from the ToolKit. I want to implement a "move" manipulation.

But my ManipulationUpdatedEvent is only called when I move on the X-Axis. Not on Y or Z.
I have the same problem with Navigation...

Has someone an idea?


void Awake()
        {
            NavigationRecognizer = new GestureRecognizer();

            NavigationRecognizer.SetRecognizableGestures(
                GestureSettings.Tap |
                GestureSettings.NavigationX |
                GestureSettings.NavigationY |
                GestureSettings.NavigationZ |
                GestureSettings.Hold);

            NavigationRecognizer.TappedEvent += NavigationRecognizer_TappedEvent;
            NavigationRecognizer.NavigationStartedEvent += NavigationRecognizer_NavigationStartedEvent;
            NavigationRecognizer.NavigationUpdatedEvent += NavigationRecognizer_NavigationUpdatedEvent;
            NavigationRecognizer.NavigationCompletedEvent += NavigationRecognizer_NavigationCompletedEvent;
            NavigationRecognizer.NavigationCanceledEvent += NavigationRecognizer_NavigationCanceledEvent;

            ManipulationRecognizer = new GestureRecognizer();

            ManipulationRecognizer.SetRecognizableGestures(
                GestureSettings.ManipulationTranslate | GestureSettings.Tap | GestureSettings.Hold);

            ManipulationRecognizer.ManipulationStartedEvent += ManipulationRecognizer_ManipulationStartedEvent;
            ManipulationRecognizer.ManipulationUpdatedEvent += ManipulationRecognizer_ManipulationUpdatedEvent;
            ManipulationRecognizer.ManipulationCompletedEvent += ManipulationRecognizer_ManipulationCompletedEvent;
            ManipulationRecognizer.ManipulationCanceledEvent += ManipulationRecognizer_ManipulationCanceledEvent;

            ResetGestureRecognizers();
        }

 private void ManipulationRecognizer_ManipulationUpdatedEvent(InteractionSourceKind source, Vector3 position, Ray ray)
        {
            Debug.Log("ManipulationUpdatedEvent: " + position.x + ", " + position.y + ", " + position.z);
            if (HandsManager.Instance.FocusedGameObject != null)
            {
                IsManipulating = true;

                ManipulationPosition = position;

                HandsManager.Instance.FocusedGameObject.SendMessageUpwards("PerformManipulationUpdate", position);
            }
        }

Best Answer

Answers

Sign In or Register to comment.