diff --git a/.todo b/.todo index fa2b4fc..54ec4be 100644 --- a/.todo +++ b/.todo @@ -1,4 +1,3 @@ -add documentation for motors add Lua interface for showing/hiding mouse cursor add 3d-picking routines using temporary ODE ray geometries add audio capabilities diff --git a/doc/index.html b/doc/index.html index f553c93..b551ef6 100644 --- a/doc/index.html +++ b/doc/index.html @@ -63,6 +63,77 @@ See Lua event handlers for a list of events. This function removes all objects from the world.

+ +

createAMotor

+

motor = ag.createAMotor(obj1, obj2, axis0 [, axis1 [, axis2 ] ])

+

+This function creates an angular motor in the simulation. +An angular motor supplies torque to the bodies it is connected to around the +axes specified in order to control the relative angular velocities of +the two objects around the axes. +Up to three axes can be specified, but only one is required. +obj1 and obj2 specify the two objects that are connected +with the motor. +One of obj1 or obj2 can be the number 0 to signify +that the other object should be connected to the static environment. +

+

+Connecting two objects with an angular motor does not restrict their +positions relative to one another. +See createHinge(). +

+

+Each axisn argument should be a table containing named parameters. +All parameters are optional. +Valid parameters: +

+The motor will only allow movement around each axis from the lo_stop +to hi_stop angles. +The motor will attempt to maintain relative angular velocities of vel +around each axis. +The maximum amount of force that the motor is allowed to apply in order to +maintain this velocity is specified by the fmax axis parameter. +Specifying a low fmax value will cause the motor to take a while +to reach its target velocity, and will mean that other objects can +slow down or stop the motor easily. +In contrast, a very high fmax value will allow the motor to reach +its target velocity more quickly and the motor will be harder to stop by +collisions with other objects. +The bounce parameter should range from 0 to 1, with 0 meaning a hard stop and 1 meaning full bounciness. +

+ + +

createHinge

+

hinge = ag.createHinge(obj1, obj2, anchor, axis)

+

+This function creates a hinge joint between two objects, +keeping a single axis from each object aligned. +The two objects can rotate around this axis independently. +One of obj1 or obj2 can be the number 0 to signify +that the other object should be connected to the static environment. +anchor and axis should be Lua "arrays" (tables with +integer indices starting at 1), with three elemenets each. +anchor gives the coordinates of a point on the hinge. +axis gives the direction vector of the hinge. +

+

doPhysics

ag.doPhysics()