updated documentation for ag.pickObjects() and ag.pickOne()

git-svn-id: svn://anubis/anaglym/trunk@312 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2010-09-17 14:57:39 +00:00
parent ea623bdf65
commit 7ea2aa3644

View File

@ -513,6 +513,34 @@ This function allows for 3D object "picking."
"pick line" (the line from the camera through the "pick point" on the "pick line" (the line from the camera through the "pick point" on the
screen. screen.
Upon error, <tt>pickObjects</tt> returns <tt>nil</tt>. Upon error, <tt>pickObjects</tt> returns <tt>nil</tt>.
For each object in the "pick line", the following properties are set:
<ul>
<li><tt>pick_dist</tt> - the distance to the object along the pick line</li>
<li><tt>pick_pos</tt> - the 3D coordinates of the pick point</li>
<li><tt>pick_normal</tt> - the normal of the object at the pick point</li>
</ul>
</p>
<a name="ag_pickOne" />
<h3>pickOne</h3>
<p><tt>objects = ag.pickOne(x, y, obj)</tt></p>
<p>
This function allows for 3D object "picking," but only tests the given
object for intersection with the pick line and is thus much more efficient
than <a href="#ag_pickObjects">pickObjects()</a> if you only care about
selecting on a given object.
<tt>x</tt> and <tt>y</tt> should be the 2D screen coordinates of the
"pick point."
<tt>obj</tt> indicates which object to be tested.
<tt>pickOne</tt> returns a boolean for whether or not the given object
was hit by the "pick line."
If the return value is <tt>true</tt>, then the following properties are
set on <tt>obj</tt>:
<ul>
<li><tt>pick_dist</tt> - the distance to the object along the pick line</li>
<li><tt>pick_pos</tt> - the 3D coordinates of the pick point</li>
<li><tt>pick_normal</tt> - the normal of the object at the pick point</li>
</ul>
</p> </p>
<a name="ag_print" /> <a name="ag_print" />