<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - rayHit (In layman's terms)]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=827</link>
		<description><![CDATA[The most recent posts in rayHit (In layman's terms).]]></description>
		<lastBuildDate>Sun, 13 Oct 2013 05:47:02 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: rayHit (In layman's terms)]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5486#p5486</link>
			<description><![CDATA[<p>&quot;point&quot; returns the 3D coordinates of the location where the collision happen between the ray and an object with physics..<br />If you want to use it as a boolean, just check &quot;if point then ...&quot;</p><p>&quot;object&quot; returns the actual object hit by the ray, so yes it detects the specific object being hit.<br />You can get the position of this object using &quot;if object then getPosition(object) end&quot;.<br />You can get its name using getName(object) function.</p><p>NB: object is returned even if you didn&#039;t declare it previously with the getObject() function.</p>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Sun, 13 Oct 2013 05:47:02 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5486#p5486</guid>
		</item>
		<item>
			<title><![CDATA[rayHit (In layman's terms)]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5480#p5480</link>
			<description><![CDATA[<p>Here is the example in the wiki:</p><div class="codebox"><pre><code>Example2, test the intersection with an object :
   object = getObject(&quot;object&quot;)
   
   function onSceneUpdate()
       start = {0, 0, 0}
       end = {100, 0, 0}
       point = rayHit(start, end, object)
       if point then
           print(point)
       end
   end</code></pre></div><p>Here is my understanding of what the rayHit() function does, and how it can be used:</p><p>The rayHit() function shoots out a beam from a start position to an end position.<br />If the beam collides with something it returns the location of the object. If it doesn&#039;t it returns &quot;nil&quot;</p><p>Here is where my understanding breaks down. Is the &quot;point&quot; variable a point in 3d space or is it a boolean?<br />For instance, if there IS a collision then does the rayHit() function return TRUE and therefore make the point variable equale to TRUE?</p><p>How can it be both if it is?</p><p>And what is the &quot;object&quot; variable really doing? Is it making the rayHit() function detect a specific object? If so, what does it do with that object? give it&#039;s location? If it does give it&#039;s location, is it making the &quot;point&quot; variable equal to it&#039;s location (a 3d point in space)?</p><p>I need to understand this in layman&#039;s terms (as dumb as you can make it, yet clear).</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Sun, 13 Oct 2013 03:11:35 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5480#p5480</guid>
		</item>
	</channel>
</rss>
