updated documentation for ag.loadModel() and ag.create*() for reference objects

git-svn-id: svn://anubis/anaglym/trunk@245 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2010-02-16 19:35:38 +00:00
parent 468ecb0c35
commit 83a183d5b5
2 changed files with 56 additions and 33 deletions

1
.todo
View File

@ -1,4 +1,3 @@
update documentation for loadModel*(), create*()
add documentation for motors add documentation for motors
add Lua interface for showing/hiding mouse cursor add Lua interface for showing/hiding mouse cursor
add 3d-picking routines using temporary ODE ray geometries add 3d-picking routines using temporary ODE ray geometries

View File

@ -286,7 +286,7 @@ See <a href="#key_names">Key Names</a> for key names.
<a name="ag_loadModel" /> <a name="ag_loadModel" />
<h3>loadModel</h3> <h3>loadModel</h3>
<p><tt>object = ag.loadModel(model_name [, scale])</tt></p> <p><tt>object = ag.loadModel(model_name [, optargs])</tt></p>
<p> <p>
This function loads an object file and returns the object loaded. This function loads an object file and returns the object loaded.
If the returned value is <tt>nil</tt>, loading of the object failed. If the returned value is <tt>nil</tt>, loading of the object failed.
@ -294,21 +294,32 @@ If the returned value is <tt>nil</tt>, loading of the object failed.
the model file, without the ".obj" extension. the model file, without the ".obj" extension.
Models are searched for relative to the folder containing the Models are searched for relative to the folder containing the
hosted script first, then relative to the engine library folder. hosted script first, then relative to the engine library folder.
<tt>scale</tt> is an optional parameter that defaults to 1.0.
</p> </p>
<a name="ag_loadModelStatic" />
<h3>loadModelStatic</h3>
<p><tt>object = ag.loadModelStatic(model_name [, scale])</tt></p>
<p> <p>
<tt>loadModelStatic()</tt> is the same as <tt>loadModel()</tt>, with If specified, <tt>optargs</tt> should be a table of named parameters.
the exception that the object loaded is created as a static object. Possible parameters are:
<ul>
<li><tt>scale</tt> - specify the scale of the model (default 1.0)</li>
<li><tt>static</tt> - boolean to indicate if the object is static</li>
<li><tt>reference</tt> - boolean to indicate if the object is a reference object </li>
</ul>
</p>
<p>
A static object can still be placed with A static object can still be placed with
<a href="#object_setPosition">setPosition()</a> and <a href="#object_setPosition">setPosition()</a> and
<a href="#object_setRotation">setRotation()</a>. <a href="#object_setRotation">setRotation()</a>.
A static object will participate in collision detection when A static object will participate in collision detection when
physics computations are performed, however a static object will not physics computations are performed, however a static object will not
be moved by any colliding objects. be moved by any colliding objects.
Static objects do not have a mass associated with them; they are considered
to be a part of the environment.
</p>
<p>
A reference object will not be drawn and cannot participate in physics.
A reference object is useful when one wishes to load a model some time
before actually using it.
You can instantiate a reference object into a normal object by calling
the <a href="#object_clone">clone()</a> method on the object.
</p> </p>
<a name="ag_loadTexture" /> <a name="ag_loadTexture" />
@ -478,24 +489,25 @@ and rotation, can be controlled by using the
<a name="ag_createBox" /> <a name="ag_createBox" />
<h3><tt>createBox</tt></h3> <h3><tt>createBox</tt></h3>
<p><tt>obj = ag.createBox(width, depth, height)</tt></p> <p><tt>obj = ag.createBox(width, depth, height [, optargs])</tt></p>
<p> <p>
This function creates a managed object which is a box with This function creates a managed object which is a box with
dimensions given by (width, depth, height). dimensions given by (width, depth, height).
The center of the box is initially located at the origin. The center of the box is initially located at the origin.
</p> </p>
<a name="ag_createBoxStatic" />
<h3><tt>createBoxStatic</tt></h3>
<p><tt>obj = ag.createBoxStatic(width, depth, height)</tt></p>
<p> <p>
Identical to <tt>ag.createBox()</tt> except that the created If specified, <tt>optargs</tt> should be a table containing
object is static. named parameters.
Valid parameters:
<ul>
<li><tt>static</tt> - boolean to indicate if the object is static</li>
<li><tt>reference</tt> - boolean to indicate if the object is a reference object </li>
</ul>
</p> </p>
<a name="ag_createCapsul" /> <a name="ag_createCapsule" />
<h3><tt>createCapsule</tt></h3> <h3><tt>createCapsule</tt></h3>
<p><tt>obj = ag.createCapsule(radius, length)</tt></p> <p><tt>obj = ag.createCapsule(radius, length [, optargs])</tt></p>
<p> <p>
This function creates a capsule managed object. This function creates a capsule managed object.
A capsule is like a cylinder, but has a half-sphere "capping" A capsule is like a cylinder, but has a half-sphere "capping"
@ -506,19 +518,20 @@ the capsule (not including the caps).
The capsule is oriented with its axis along the Z axis and its The capsule is oriented with its axis along the Z axis and its
center point at the origin. center point at the origin.
</p> </p>
<a name="ag_createCapsuleStatic" />
<h3><tt>createCapsuleStatic</tt></h3>
<p><tt>obj = ag.createCapsuleStatic(radius, length)</tt></p>
<p> <p>
Identical to <tt>ag.createCapsule()</tt> except that the created If specified, <tt>optargs</tt> should be a table containing
object is static. named parameters.
Valid parameters:
<ul>
<li><tt>static</tt> - boolean to indicate if the object is static</li>
<li><tt>reference</tt> - boolean to indicate if the object is a reference object </li>
</ul>
</p> </p>
<a name="ag_createPlane" /> <a name="ag_createPlane" />
<h3><tt>createPlane</tt></h3> <h3><tt>createPlane</tt></h3>
<p>1) <tt>obj = ag.createPlane(a, b, c, d)</tt></p> <p>1) <tt>obj = ag.createPlane(a, b, c, d [, optargs])</tt></p>
<p>2) <tt>obj = ag.createPlane(x, y, z, rot_x, rot_y, rot_z)</tt></p> <p>2) <tt>obj = ag.createPlane(x, y, z, rot_x, rot_y, rot_z [, optargs])</tt></p>
<p> <p>
The <tt>createPlane()</tt> function creates a managed plane object. The <tt>createPlane()</tt> function creates a managed plane object.
All planes are static and are not moved as a result of physics All planes are static and are not moved as a result of physics
@ -535,21 +548,30 @@ the surface and the surface normal, see the
<a href="#std_createPlanePointNormal">std.createPlanePointNormal()</a> <a href="#std_createPlanePointNormal">std.createPlanePointNormal()</a>
function. function.
</p> </p>
<p>
If specified, <tt>optargs</tt> should be a table containing
named parameters.
Valid parameters:
<ul>
<li><tt>reference</tt> - boolean to indicate if the object is a reference object </li>
</ul>
</p>
<a name="ag_createSphere" /> <a name="ag_createSphere" />
<h3><tt>createSphere</tt></h3> <h3><tt>createSphere</tt></h3>
<p><tt>obj = ag.createSphere(radius)</tt></p> <p><tt>obj = ag.createSphere(radius [, optargs])</tt></p>
<p> <p>
This function creates a managed sphere object with the radius given. This function creates a managed sphere object with the radius given.
The center of the sphere is initially located at the origin. The center of the sphere is initially located at the origin.
</p> </p>
<a name="ag_createSphereStatic" />
<h3><tt>createSphereStatic</tt></h3>
<p><tt>obj = ag.createSphereStatic(radius)</tt></p>
<p> <p>
Identical to <tt>ag.createSphere()</tt> except that the created If specified, <tt>optargs</tt> should be a table containing
object is static. named parameters.
Valid parameters:
<ul>
<li><tt>static</tt> - boolean to indicate if the object is static</li>
<li><tt>reference</tt> - boolean to indicate if the object is a reference object </li>
</ul>
</p> </p>
<hr /> <hr />
@ -606,6 +628,8 @@ One should call
<tt>new_obj:<a href="#object_setPosition">setPosition()</a></tt> <tt>new_obj:<a href="#object_setPosition">setPosition()</a></tt>
in order to place <tt>new_obj</tt> somewhere where it is not in order to place <tt>new_obj</tt> somewhere where it is not
intersecting with other objects in order to pacify the physics engine. intersecting with other objects in order to pacify the physics engine.
The new object created will be a regular (non-reference) object, regardless
of whether <tt>obj</tt> was a regular or reference object.
</p> </p>
<a name="object_destroy" /> <a name="object_destroy" />