<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Interactions with Daydream VR controller]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=431&amp;type=atom" />
	<updated>2017-02-24T13:56:09Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=431</id>
		<entry>
			<title type="html"><![CDATA[Re: Interactions with Daydream VR controller]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1886#p1886" />
			<content type="html"><![CDATA[<p>The map only works with the code above, if it is direct in front of the camera and has no rotation. </p><p>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.</p><p>Does anybody has a solution for this problem?</p>]]></content>
			<author>
				<name><![CDATA[schina]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=389</uri>
			</author>
			<updated>2017-02-24T13:56:09Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1886#p1886</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Interactions with Daydream VR controller]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1884#p1884" />
			<content type="html"><![CDATA[<p>Thanks, but was does &quot;and use the center of screen as the cursor&quot; mean? I have a controller which has its own cursor. Or do I misunderstand that?</p><p>I had some issues, but the main part is this for interaction with buttons</p><div class="codebox"><pre><code>    protected override void BeforeUpdate()
    {
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WEBGL || UNITY_ANDROID
       
        if (GvrController.ClickButtonDown) { OnMapBasePress(); }
        else if (GvrController.ClickButtonUp) { OnMapBaseRelease(); }

    }</code></pre></div><p>and for position of controller:</p><div class="codebox"><pre><code>    public Vector2 GetInputPosition()
    {
        if (OnGetInputPosition != null) { Debug.Log(&quot;return OnGetInputPosition&quot;); return OnGetInputPosition(); }
        Vector2 vec2 = Input.mousePosition;
#if UNITY_HAS_GOOGLEVR &amp;&amp; (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;
    }</code></pre></div><p>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.</p>]]></content>
			<author>
				<name><![CDATA[schina]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=389</uri>
			</author>
			<updated>2017-02-23T17:20:12Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1884#p1884</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Interactions with Daydream VR controller]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1880#p1880" />
			<content type="html"><![CDATA[<p>Hello.</p><p>The most simple way (without modification of Online Maps scripts):<br /><a href="http://infinity-code.com/atlas/online-maps/pages/InterceptInputExample.html">http://infinity-code.com/atlas/online-m … ample.html</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-02-23T02:08:01Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1880#p1880</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Interactions with Daydream VR controller]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1879#p1879" />
			<content type="html"><![CDATA[<p>Okay, I did it. To answer the question on my own: Yes, every interaction has to be &quot;transleted&quot; to inputs from controller.</p>]]></content>
			<author>
				<name><![CDATA[schina]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=389</uri>
			</author>
			<updated>2017-02-22T23:59:31Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1879#p1879</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Interactions with Daydream VR controller]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1877#p1877" />
			<content type="html"><![CDATA[<p>I want to make it to support Daydream inputs, so custom controller inputs.</p><p>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.</p><p>That way of &quot;translating&quot; the interactions does not feel good. Is there better way to use custom inputs generally?</p>]]></content>
			<author>
				<name><![CDATA[schina]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=389</uri>
			</author>
			<updated>2017-02-22T19:29:48Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1877#p1877</id>
		</entry>
</feed>
