Topic: Interactions with Daydream VR controller

I want to make it to support Daydream inputs, so custom controller inputs.

I started with the raycasting and adapted the PointerEventData from Vector2 to Vector3 (controller) in OnlineMapsUIImageControl. Fine. Next step would be the interactions like zooming.

That way of "translating" the interactions does not feel good. Is there better way to use custom inputs generally?

Re: Interactions with Daydream VR controller

Okay, I did it. To answer the question on my own: Yes, every interaction has to be "transleted" to inputs from controller.

Re: Interactions with Daydream VR controller

Hello.

The most simple way (without modification of Online Maps scripts):
http://infinity-code.com/atlas/online-m … ample.html

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Interactions with Daydream VR controller

Thanks, but was does "and use the center of screen as the cursor" mean? I have a controller which has its own cursor. Or do I misunderstand that?

I had some issues, but the main part is this for interaction with buttons

    protected override void BeforeUpdate()
    {
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WEBGL || UNITY_ANDROID
       
        if (GvrController.ClickButtonDown) { OnMapBasePress(); }
        else if (GvrController.ClickButtonUp) { OnMapBaseRelease(); }

    }

and for position of controller:

    public Vector2 GetInputPosition()
    {
        if (OnGetInputPosition != null) { Debug.Log("return OnGetInputPosition"); return OnGetInputPosition(); }
        Vector2 vec2 = Input.mousePosition;
#if UNITY_HAS_GOOGLEVR && (UNITY_ANDROID || UNITY_EDITOR)
        vec2 = DaydreamInput();
#endif
        return vec2;
    }

    private Vector2 DaydreamInput()
    {
        Transform pointerTransform = pointer.GetPointerTransform();
        float maxPointerDistance = pointer.GetMaxPointerDistance();
        Vector3 pointerPos = pointerTransform.position + (pointerTransform.forward * maxPointerDistance);
        Vector2 vector2 = new Vector2(pointerPos.x, pointerPos.y);
        return vector2;
    }

That works perfectly for a map which is in front of me directly. But if the map is under me (turned 90° over x axis), only the lng value changes. The translation from Vector3 to Vector2 seems to be a problem.

Re: Interactions with Daydream VR controller

The map only works with the code above, if it is direct in front of the camera and has no rotation.

Example: If it has rotation around Y the position of the pointer is not correct. And it has +90° X rotation (map lies on ground) I can only drag the map so that the lng values changes, but lat is constant.

Does anybody has a solution for this problem?