<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Find Markers within Range]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=119&amp;type=atom" />
	<updated>2016-03-28T19:16:26Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=119</id>
		<entry>
			<title type="html"><![CDATA[Re: Find Markers within Range]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=516#p516" />
			<content type="html"><![CDATA[<p>Awesome, thanks!</p>]]></content>
			<author>
				<name><![CDATA[Quidam]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=76</uri>
			</author>
			<updated>2016-03-28T19:16:26Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=516#p516</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Find Markers within Range]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=515#p515" />
			<content type="html"><![CDATA[<p>Hello.</p><p>It is also a good way. Much better than Physics.OverlapSphere.<br />I think this is the fastest way (your link).</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-03-28T18:54:01Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=515#p515</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Find Markers within Range]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=514#p514" />
			<content type="html"><![CDATA[<p>Thanks! Does that remain true if there are a large number of markers on the map?</p><p>Also, in looking into the efficiency of calculating distance issue, I found this article and wondered how it compared with what you have in the DistanceBetweenPoints code.</p><p><a href="http://docs.unity3d.com/Manual/DirectionDistanceFromOneObjectToAnother.html">http://docs.unity3d.com/Manual/Directio … other.html</a></p>]]></content>
			<author>
				<name><![CDATA[Quidam]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=76</uri>
			</author>
			<updated>2016-03-28T18:32:24Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=514#p514</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Find Markers within Range]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=513#p513" />
			<content type="html"><![CDATA[<p>Hello.</p><p>This is one of the possible solutions.</p><p>But there is another way:<br />1. Сonvert Unity World Position into coordinates.<br />2. Calculate the distance to each marker (OnlineMapsUtils.DistanceBetweenPoints). If the distance is less than some value, this marker in the range.</p><br /><p>This way will work much faster than Physics.OverlapSphere.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-03-26T20:12:37Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=513#p513</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Find Markers within Range]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=512#p512" />
			<content type="html"><![CDATA[<p>I want the most efficient way of returning a list of markers within a given range of a specified point. I know I could just go through the entire collection of markers and compute the distance, but thought there might be something more along the lines of the code below:</p><div class="codebox"><pre><code>            Collider[] hitColliders = Physics.OverlapSphere(position, range);
            HashSet&lt;int&gt; nearbyObjectIds = new HashSet&lt;int&gt;();
            List&lt;WorldObject&gt; nearbyObjects = new List&lt;WorldObject&gt;();
            for (int i = 0; i &lt; hitColliders.Length; i++)</code></pre></div><p>Will iterating through all the markers currently on the map be the best way to go about it, or is there some more elegant solution?</p><p>Thanks!</p>]]></content>
			<author>
				<name><![CDATA[Quidam]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=76</uri>
			</author>
			<updated>2016-03-25T19:34:45Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=512#p512</id>
		</entry>
</feed>
