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

Inside-Out Tap Gesture Recognition

edited April 2017 in Questions And Answers

I am currently implementing a system that needs to look for the tap gesture itself.
I don't want to attach a script to every single object if all it will do is return "True" if the tap gesture was performed while the object was in focus.

One example is if I tap in open space I would like a cube to appear 10 Meters away from my face where I tapped.

Another example is when I tap a cube that ONLY has a transform component attached, I want to destroy it.

All I am looking to do is Inside-Out sensing rather than Outside-In.

Thank You

Tagged:

Best Answer

Answers

  • Options
    stepan_stulovstepan_stulov ✭✭✭
    edited April 2017
    1. To register a tap gesture regardless of what you'r looking at you can simply use GestureRecognizer. Set its active gestures, subscribe to the one you need and receive the event. No need to have any objects in the scene at all.
    2. To destroy the cube you're looking at you need to know that you're looking at it. This can be achieved easily by raycasting a ray from the camera and finding a collider that's hit. Physics' raycasting works with colliders only. If you for some strange reason don't want a collider then you can re-implement raycasting yourself and see whether the cube or at least its centre is in the camera's frustum. But why doing that if the collider way is much easier.
    3. What do you mean by "inside out sensing"?

    Building the future of holographic navigation. We're hiring.

  • Options

    I am trying to understand the event system a little better. If I want to look for a tap event when GazeManager.Instance.HitObject == null do I have to grab the event handler from GestureRecognizer and look to see when an event is subscribed to public event TappedEventDelegate TappedEvent;?

    I'm just not understanding the process to go about receiving an empty tap.

    i.e. In Unity if I tap empty space print "Hello World."

    3A: When I say inside out sensing I am referring to the way tapping is recognized. Similar to VR where you have the HTC Vive with base stations that is considered outside in sensing. What I'm trying to simply phrase is the process of NOT having objects determine whether or not they have been tapped, but instead have a listener look for when an object it tapped.

    i.e. An object looks for a tap gesture by using
    public void OnInputClicked(InputClickedEventData eventData)
    A listener looks for a tap gesture by using ????GestureRecognizer????

Sign In or Register to comment.