<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Tileset HitTest error when camera outside frustum.]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1907&amp;type=atom" />
	<updated>2022-01-26T23:16:48Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1907</id>
		<entry>
			<title type="html"><![CDATA[Re: Tileset HitTest error when camera outside frustum.]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8060#p8060" />
			<content type="html"><![CDATA[<p>Please show the stack trace of next error.</p><p>Unfortunately, I don&#039;t know if you&#039;re doing the right thing or not.<br />For more or less simple cases, I can give advice on a short description of the problem.<br />But this is not your case.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2022-01-26T23:16:48Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8060#p8060</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tileset HitTest error when camera outside frustum.]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8056#p8056" />
			<content type="html"><![CDATA[<p>Thanks Alex.&nbsp; That change definitely helped, but led to the next error.&nbsp; Maybe I&#039;m going about this incorrectly for what it is I&#039;m trying to accomplish.&nbsp; All I want to do is...</p><p>1.&nbsp; Have an AR Camera where all the user sees is the 3D markers (via map) within AR scene. I have this working using Tileset.</p><p>2.&nbsp; Have a slide-in map where the user can zoom, pan and rotate the Map.&nbsp; I have the slide-in map working using ortho camera (NOT Texture on UI/Canvas). What I am trying to do is add the ability for the user to zoom, pan, and rotate (cameraOrbit) while the Map is in view. </p><p>3.&nbsp; When map slides-back-out-of-view (user is back in AR world) the Tileset map/3D markers from step #1 are exactly as they were&nbsp; (before any changes were made by user zoom/pan/orbit).</p><p>To accomplish step #2 I added the Map Camera to the tileset map and give User Control and Zoom, plus added CameraOrbit component.&nbsp; By &quot;assigning&quot; the Map Camera to the tileset, I started receiving the frustum errors, which is why I created this post.&nbsp; </p><p>I spent a little time looking at the Tileset with Map Camera UI tutorial.<br />...and before I make a hot-mess of everything I thought I would check...<br />...just want to make sure I&#039;m doing things the write way; I tend to make things way too difficult.</p><p>Thanks.</p>]]></content>
			<author>
				<name><![CDATA[digitalrock]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=308</uri>
			</author>
			<updated>2022-01-26T17:53:21Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8056#p8056</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Tileset HitTest error when camera outside frustum.]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8054#p8054" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Try this (OnlineMapsTileSetControl.HitTest):<br /></p><div class="codebox"><pre><code>protected override bool HitTest(Vector2 position)
{
#if NGUI
    if (UICamera.Raycast(position)) return false;
#endif
    Rect rect = activeCamera.rect;
    if (rect.width == 0 || rect.height == 0) return false;
    return cl.Raycast(activeCamera.ScreenPointToRay(position), out lastRaycastHit, OnlineMapsUtils.maxRaycastDistance);
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2022-01-26T11:35:01Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8054#p8054</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Tileset HitTest error when camera outside frustum.]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8053#p8053" />
			<content type="html"><![CDATA[<p>Hi Alex,</p><p>I have a Map Camera which slides in from the side of the device.&nbsp; I use a Tileset control in my AR App, and map not visible to the AR camera via the culling.&nbsp; So while the Map Camera is out-of-view, I get the following errors:</p><p>Screen position out of view frustum (screen pos 0.000000, 0.000000) (Camera rect 0 0 0 1024)<br />UnityEngine.Camera:ScreenPointToRay (UnityEngine.Vector3)<br />OnlineMapsTileSetControl:HitTest </p><p>I&#039;m curious what is the best way to tackling having the map slide-in/out without getting the errors?&nbsp; My thought was to disable the map renderer, till the Display Map Button is clicked.&nbsp; Then, turn on renderer AND start camera slide into view.&nbsp; I do think there is a possibility of a few errors each time however, due to the renderer being enabled slightly before camera rect is updated.</p><p>What do you think?</p><p>EDIT: Maybe it would be better to switch between Main-Camera and Map camera (and back again) based on if the Display Map Button is clicked.</p><p>Thanks.</p>]]></content>
			<author>
				<name><![CDATA[digitalrock]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=308</uri>
			</author>
			<updated>2022-01-25T20:43:38Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8053#p8053</id>
		</entry>
</feed>
