<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - rayHit (In layman's terms)]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=827&amp;type=atom"/>
	<updated>2013-10-13T05:47:02Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=827</id>
		<entry>
			<title type="html"><![CDATA[Re: rayHit (In layman's terms)]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5486#p5486"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[com3D]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1488</uri>
			</author>
			<updated>2013-10-13T05:47:02Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5486#p5486</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[rayHit (In layman's terms)]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5480#p5480"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2013-10-13T03:11:35Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5480#p5480</id>
		</entry>
</feed>
