From 83a183d5b5dc0a894256697b641481ac64b92893 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 16 Feb 2010 19:35:38 +0000 Subject: [PATCH] updated documentation for ag.loadModel() and ag.create*() for reference objects git-svn-id: svn://anubis/anaglym/trunk@245 99a6e188-d820-4881-8870-2d33a10e2619 --- .todo | 1 - doc/index.html | 88 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 56 insertions(+), 33 deletions(-) diff --git a/.todo b/.todo index 5c27e71..fa2b4fc 100644 --- a/.todo +++ b/.todo @@ -1,4 +1,3 @@ -update documentation for loadModel*(), create*() add documentation for motors add Lua interface for showing/hiding mouse cursor add 3d-picking routines using temporary ODE ray geometries diff --git a/doc/index.html b/doc/index.html index 789268d..f553c93 100644 --- a/doc/index.html +++ b/doc/index.html @@ -286,7 +286,7 @@ See Key Names for key names.

loadModel

-

object = ag.loadModel(model_name [, scale])

+

object = ag.loadModel(model_name [, optargs])

This function loads an object file and returns the object loaded. If the returned value is nil, loading of the object failed. @@ -294,21 +294,32 @@ If the returned value is nil, loading of the object failed. the model file, without the ".obj" extension. Models are searched for relative to the folder containing the hosted script first, then relative to the engine library folder. -scale is an optional parameter that defaults to 1.0.

- -
-

loadModelStatic

-

object = ag.loadModelStatic(model_name [, scale])

-loadModelStatic() is the same as loadModel(), with -the exception that the object loaded is created as a static object. +If specified, optargs should be a table of named parameters. +Possible parameters are: +

+

+

A static object can still be placed with setPosition() and setRotation(). A static object will participate in collision detection when physics computations are performed, however a static object will not 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. +

+

+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 clone() method on the object.

@@ -478,24 +489,25 @@ and rotation, can be controlled by using the

createBox

-

obj = ag.createBox(width, depth, height)

+

obj = ag.createBox(width, depth, height [, optargs])

This function creates a managed object which is a box with dimensions given by (width, depth, height). The center of the box is initially located at the origin.

- -
-

createBoxStatic

-

obj = ag.createBoxStatic(width, depth, height)

-Identical to ag.createBox() except that the created -object is static. +If specified, optargs should be a table containing +named parameters. +Valid parameters: +

-
+

createCapsule

-

obj = ag.createCapsule(radius, length)

+

obj = ag.createCapsule(radius, length [, optargs])

This function creates a capsule managed object. 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 center point at the origin.

- -
-

createCapsuleStatic

-

obj = ag.createCapsuleStatic(radius, length)

-Identical to ag.createCapsule() except that the created -object is static. +If specified, optargs should be a table containing +named parameters. +Valid parameters: +

createPlane

-

1) obj = ag.createPlane(a, b, c, d)

-

2) obj = ag.createPlane(x, y, z, rot_x, rot_y, rot_z)

+

1) obj = ag.createPlane(a, b, c, d [, optargs])

+

2) obj = ag.createPlane(x, y, z, rot_x, rot_y, rot_z [, optargs])

The createPlane() function creates a managed plane object. 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 std.createPlanePointNormal() function.

+

+If specified, optargs should be a table containing +named parameters. +Valid parameters: +

+

createSphere

-

obj = ag.createSphere(radius)

+

obj = ag.createSphere(radius [, optargs])

This function creates a managed sphere object with the radius given. The center of the sphere is initially located at the origin.

- -
-

createSphereStatic

-

obj = ag.createSphereStatic(radius)

-Identical to ag.createSphere() except that the created -object is static. +If specified, optargs should be a table containing +named parameters. +Valid parameters: +


@@ -606,6 +628,8 @@ One should call new_obj:
setPosition() in order to place new_obj somewhere where it is not 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 obj was a regular or reference object.