lugre_ode_L.cpp

Go to the documentation of this file.
00001 #include "lugre_prefix.h"
00002 #include "lugre_luabind.h"
00003 #include "lugre_fifo.h"
00004 #include "lugre_scripting.h"
00005 
00006 extern "C" {
00007     #include "lua.h"
00008     #include "lauxlib.h"
00009     #include "lualib.h"
00010 }
00011 
00012 #ifdef ENABLE_ODE
00013 
00014 #include <ode/ode.h>
00015 
00016 using namespace Lugre;
00017 
00018 #define PUSHUDATA(x)        lua_pushlightuserdata(L,reinterpret_cast<void*>(x))
00019 #define PUSHNUMBER(x)       lua_pushnumber(L,(x))
00020 #define PUSHBOOL(x)         lua_pushboolean(L,(x))
00021 #define PUSHVEC_(x,n)       PUSHNUMBER(x[(n)+0]);PUSHNUMBER(x[(n)+1]);PUSHNUMBER(x[(n)+2])
00022 #define PUSHVEC(x)          PUSHVEC_(x,0)
00023 #define PUSHQUAT_(x,n)      PUSHNUMBER(x[(n)+0]);PUSHNUMBER(x[(n)+1]);PUSHNUMBER(x[(n)+2]);PUSHNUMBER(x[(n)+3])
00024 #define PUSHQUAT(x)         PUSHQUAT_(x,0)
00025 
00026 #define GETFIFO(n)          (cLuaBind<cFIFO>::checkudata(L,n))
00027 #define GETBOOL(n)          luaL_checkbool(L,n)
00028 #define GETNUMBER(n)        luaL_checknumber(L,n)
00029 #define GETINT(n)           ((int)GETNUMBER(n))
00030 #define GETUINT(n)          ((unsigned int)GETNUMBER(n))
00031 #define GETLONG(n)          ((long)GETNUMBER(n))
00032 #define GETULONG(n)         ((unsigned long)GETNUMBER(n))
00033 #define GETSTRING(n)        luaL_checkstring(L,n)
00034 #define GETUDATA(n)         lua_touserdata(L,n)
00035 #define GETVEC(n)           GETNUMBER((n)+0),GETNUMBER((n)+1),GETNUMBER((n)+2)
00036 #define GETQUAT(n,v)        v[0] = GETNUMBER((n)+0);v[1] = GETNUMBER((n)+1);v[2] = GETNUMBER((n)+2);v[3] = GETNUMBER((n)+3)
00037 // lua w,x,y,z <-> ode 3 0 1 2
00038 #define QUAT4(n,q)          dQuaternion q; q[0] = GETNUMBER((n)+0); q[1] = GETNUMBER((n)+1); q[2] = GETNUMBER((n)+2); q[3] = GETNUMBER((n)+3)
00039 #define VEC3_(n,v)          v[0] = GETNUMBER((n)+0); v[1] = GETNUMBER((n)+1); v[2] = GETNUMBER((n)+2)
00040 #define VEC3(n,v)           dVector3 v; VEC3_(n,v)
00041 
00042 #define GEOMID(n)           ((dGeomID)(lua_touserdata(L,n)))
00043 #define BODYID(n)           ((dBodyID)(lua_touserdata(L,n)))
00044 #define SPACEID(n)          ((dSpaceID)(lua_touserdata(L,n)))
00045 #define WORLDID(n)          ((dWorldID)(lua_touserdata(L,n)))
00046 #define JOINTGROUPID(n)     ((dJointGroupID)(lua_touserdata(L,n)))
00047 #define JOINTID(n)          ((dJointID)(lua_touserdata(L,n)))
00048 #define MASSID(n)           ((dMass *)(lua_touserdata(L,n)))
00049 #define STOPWATCHID(n)      ((dStopwatch *)(lua_touserdata(L,n)))
00050 #define CONTACTGEOMID(n)    ((dContactGeom *)(lua_touserdata(L,n)))
00051 #define JOINTFEEDBACKID(n)  ((dJointFeedback *)(lua_touserdata(L,n)))
00052 #define TRIMESHDATAID(n)    ((dTriMeshDataID)(lua_touserdata(L,n)))
00053 #define TRIMESHRAWDATAID(n) ((cTriangleMeshRawData *)(lua_touserdata(L,n)))
00054 #define HEIGHTFIELDDATAID(n)    ((dHeightfieldDataID)(lua_touserdata(L,n)))
00055 #define CONTACTID(n)        ((dContact *)(lua_touserdata(L,n)))
00056 
00057 
00058 
00059 /*
00060 typedef dReal dVector3[4];
00061 typedef dReal dVector4[4];
00062 typedef dReal dMatrix3[4*3];
00063 typedef dReal dMatrix4[4*4];
00064 typedef dReal dMatrix6[8*6];
00065 typedef dReal dQuaternion[4];
00066 */
00067 
00068 
00069 static void stackDump (lua_State *L) {
00070   int i;
00071   int top = lua_gettop(L);
00072   for (i = 1; i <= top; i++) {  /* repeat for each level */
00073     int t = lua_type(L, i);
00074     switch (t) {
00075 
00076       case LUA_TSTRING:  /* strings */
00077         printf("`%s'", lua_tostring(L, i));
00078         break;
00079 
00080       case LUA_TBOOLEAN:  /* booleans */
00081         printf(lua_toboolean(L, i) ? "true" : "false");
00082         break;
00083 
00084       case LUA_TNUMBER:  /* numbers */
00085         printf("%g", lua_tonumber(L, i));
00086         break;
00087 
00088       default:  /* other values */
00089         printf("%s", lua_typename(L, t));
00090         break;
00091 
00092     }
00093     printf("  ");  /* put a separator */
00094   }
00095   printf("\n");  /* end the listing */
00096 }
00097     
00098 
00099 
00100 struct sCallbackData {
00101     int fun;
00102     lua_State *L;
00103 };
00104 
00105 
00106 
00107 // lua_pushlightuserdata(L,reinterpret_cast<void*>(iRemoteAddr));
00108 // uint32 iServerAddr = (uint32)(long)(lua_touserdata(L,3));
00109 
00117 // lua : void OdeGeomSetData(dGeomID geom, void* data) [ from ode ]
00118 static int l_OdeGeomSetData (lua_State *L) { PROFILE
00119     dGeomSetData(GEOMID(1), lua_touserdata(L,2));
00120     return 0;
00121 }
00122 
00129 // lua : udata OdedGeomGetData(dGeomID geom) [ from ode ]
00130 static int l_OdeGeomGetData (lua_State *L) { PROFILE
00131     PUSHUDATA( dGeomGetData(GEOMID(1)) );
00132     return 1;
00133 }
00134 
00153 // lua : void OdeGeomSetBody(dGeomID geom, dBodyID body) [ from ode ]
00154 static int l_OdeGeomSetBody (lua_State *L) { PROFILE
00155     dGeomSetBody(GEOMID(1), BODYID(2));
00156     return 0;
00157 }
00158 
00165 // lua : dBodyID OdeGeomGetBody(dGeomID geom) [ from ode ]
00166 static int l_OdeGeomGetBody (lua_State *L) { PROFILE
00167     PUSHUDATA( dGeomGetBody(GEOMID(1)) );
00168     return 1;
00169 }
00170 
00185 // lua : void OdeGeomSetPosition(dGeomID geom, dReal x, dReal y, dReal z) [ from ode ]
00186 static int l_OdeGeomSetPosition (lua_State *L) { PROFILE
00187     dGeomSetPosition(GEOMID(1), GETVEC(2));
00188     return 0;
00189 }
00190 
00204 // lua : void OdeGeomSetQuaternion(dGeomID geom, const dQuaternion Q) [ from ode ]
00205 static int l_OdeGeomSetQuaternion (lua_State *L) { PROFILE
00206     dQuaternion q;
00207     GETQUAT(2,q);
00208     dGeomSetQuaternion(GEOMID(1), q);
00209     return 0;
00210 }
00211 
00228 // lua : x,y,z OdeGeomGetPosition(dGeomID geom) [ from ode ]
00229 static int l_OdeGeomGetPosition (lua_State *L) { PROFILE
00230     const dReal *x = dGeomGetPosition(GEOMID(1));
00231     PUSHVEC(x);
00232     return 3;
00233 }
00234 
00248 // lua : w,x,y,z OdeGeomGetQuaternion(dGeomID geom) [ from ode ]
00249 static int l_OdeGeomGetQuaternion (lua_State *L) { PROFILE
00250     dQuaternion q;
00251     dGeomGetQuaternion(GEOMID(1), q);
00252     PUSHQUAT(q);
00253     return 4;
00254 }
00255 
00272 // lua : ax,ay,az,bx,by,bz OdeGeomGetAABB(dGeomID geom) [ from ode ]
00273 static int l_OdeGeomGetAABB (lua_State *L) { PROFILE
00274     dReal aabb[6];
00275     dGeomGetAABB(GEOMID(1), aabb);
00276     PUSHVEC_(aabb,0);
00277     PUSHVEC_(aabb,3);
00278     return 6;
00279 }
00280 
00287 // lua : int OdeGeomIsSpace(dGeomID geom) [ from ode ]
00288 static int l_OdeGeomIsSpace (lua_State *L) { PROFILE
00289     PUSHBOOL(dGeomIsSpace(GEOMID(1)));
00290     return 1;
00291 }
00292 
00300 // lua : dSpaceID OdeGeomGetSpace(dGeomID) [ from ode ]
00301 static int l_OdeGeomGetSpace (lua_State *L) { PROFILE
00302     PUSHUDATA(dGeomGetSpace(GEOMID(1)));
00303     return 1;
00304 }
00305 
00330 // lua : int OdeGeomGetClass(dGeomID geom) [ from ode ]
00331 static int l_OdeGeomGetClass (lua_State *L) { PROFILE
00332     PUSHNUMBER( dGeomGetClass(GEOMID(1)) );
00333     return 1;
00334 }
00335 
00348 // lua : void OdeGeomSetCategoryBits(dGeomID geom, unsigned long bits) [ from ode ]
00349 static int l_OdeGeomSetCategoryBits (lua_State *L) { PROFILE
00350     dGeomSetCategoryBits(GEOMID(1), GETULONG(2));
00351     return 0;
00352 }
00353 
00366 // lua : void OdeGeomSetCollideBits(dGeomID geom, unsigned long bits) [ from ode ]
00367 static int l_OdeGeomSetCollideBits (lua_State *L) { PROFILE
00368     dGeomSetCollideBits(GEOMID(1), GETULONG(2));
00369     return 0;
00370 }
00371 
00380 // lua : long OdeGeomGetCategoryBits(dGeomID) [ from ode ]
00381 static int l_OdeGeomGetCategoryBits (lua_State *L) { PROFILE
00382     PUSHNUMBER(dGeomGetCategoryBits(GEOMID(1)));
00383     return 1;
00384 }
00385 
00394 // lua : long OdeGeomGetCollideBits(dGeomID) [ from ode ]
00395 static int l_OdeGeomGetCollideBits (lua_State *L) { PROFILE
00396     PUSHNUMBER( dGeomGetCollideBits(GEOMID(1)) );
00397     return 1;
00398 }
00399 
00412 // lua : void OdeGeomEnable(dGeomID geom) [ from ode ]
00413 static int l_OdeGeomEnable (lua_State *L) { PROFILE
00414     dGeomEnable(GEOMID(1));
00415     return 0;
00416 }
00417 
00430 // lua : void OdeGeomDisable(dGeomID geom) [ from ode ]
00431 static int l_OdeGeomDisable (lua_State *L) { PROFILE
00432     dGeomDisable(GEOMID(1));
00433     return 0;
00434 }
00435 
00449 // lua : int OdeGeomIsEnabled(dGeomID geom) [ from ode ]
00450 static int l_OdeGeomIsEnabled (lua_State *L) { PROFILE
00451     PUSHBOOL(dGeomIsEnabled(GEOMID(1)));
00452     return 1;
00453 }
00454 
00455 /* ************************************************************************ */
00456 /* geom offset from body */
00457 
00473 // lua : void OdeGeomSetOffsetPosition(dGeomID geom, dReal x, dReal y, dReal z) [ from ode ]
00474 static int l_OdeGeomSetOffsetPosition (lua_State *L) { PROFILE
00475     dGeomSetOffsetPosition(GEOMID(1), GETVEC(2));
00476     return 0;
00477 }
00478 
00479 
00493 // lua : void OdeGeomSetOffsetQuaternion(dGeomID geom, const dQuaternion Q) [ from ode ]
00494 static int l_OdeGeomSetOffsetQuaternion (lua_State *L) { PROFILE
00495     QUAT4(2,q);
00496     dGeomSetOffsetQuaternion(GEOMID(1), q);
00497     return 0;
00498 }
00499 
00516 // lua : void OdeGeomSetOffsetWorldPosition(dGeomID geom, dReal x, dReal y, dReal z) [ from ode ]
00517 static int l_OdeGeomSetOffsetWorldPosition (lua_State *L) { PROFILE
00518     dGeomSetOffsetWorldPosition(GEOMID(1), GETVEC(2));
00519     return 0;
00520 }
00521 
00522 
00537 // lua : void OdeGeomSetOffsetWorldQuaternion(dGeomID geom, const dQuaternion) [ from ode ]
00538 static int l_OdeGeomSetOffsetWorldQuaternion (lua_State *L) { PROFILE
00539     QUAT4(2,q);
00540     dGeomSetOffsetWorldQuaternion(GEOMID(1), q);
00541     return 0;
00542 }
00543 
00557 // lua : void OdeGeomClearOffset(dGeomID geom) [ from ode ]
00558 static int l_OdeGeomClearOffset (lua_State *L) { PROFILE
00559     dGeomClearOffset(GEOMID(1));
00560     return 0;
00561 }
00562 
00578 // lua : int OdeGeomIsOffset(dGeomID geom) [ from ode ]
00579 static int l_OdeGeomIsOffset (lua_State *L) { PROFILE
00580     PUSHNUMBER(dGeomIsOffset(GEOMID(1)));
00581     return 1;
00582 }
00583 
00597 // lua : x,y,z OdeGeomGetOffsetPosition(dGeomID geom) [ from ode ]
00598 static int l_OdeGeomGetOffsetPosition (lua_State *L) { PROFILE
00599     const dReal *x = dGeomGetOffsetPosition(GEOMID(1));
00600     PUSHVEC(x);
00601     return 3;
00602 }
00603 
00604 
00615 // lua : w,x,y,z OdeGeomGetOffsetQuaternion(dGeomID geom, dQuaternion result) [ from ode ]
00616 static int l_OdeGeomGetOffsetQuaternion (lua_State *L) { PROFILE
00617     dQuaternion result;
00618     dGeomGetOffsetQuaternion(GEOMID(1), result);
00619     PUSHQUAT(result);
00620     return 4;
00621 }
00622 
00623 /* ************************************************************************ */
00624 /* collision detection */
00625 
00672 /*
00673 // lua : int OdeCollide(dGeomID o1, dGeomID o2, int flags, dContactGeom *contact,int skip) [ from ode ]
00674 static int l_OdeCollide (lua_State *L) { PROFILE
00675     int skip = sizeof(dContactGeom);
00676 
00677     if(lua_gettop(L) == 5)skip = GETINT(5);
00678 
00679     PUSHNUMBER(dCollide(GEOMID(1), GEOMID(2), GETINT(3), CONTACTGEOMID(4),skip));
00680     return 1;
00681 }
00682 */
00683 
00684 /*
00685   typedef struct dContactGeom {
00686   dVector3 pos;          ///< contact position
00687   dVector3 normal;       ///< normal vector
00688   dReal depth;           ///< penetration depth
00689   dGeomID g1,g2;         ///< the colliding geoms
00690   int side1,side2;       ///< (to be documented)
00691 } dContactGeom;
00692 */
00693 // lua : px,py,pz, nx,ny,nz, depth, g1,g2, side1, side2 OdeContactGeomCreate(contactgeomid)
00694 static int l_OdeContactGeomGetParams (lua_State *L) { PROFILE
00695     dContactGeom *p = CONTACTGEOMID(1);
00696     if(p){
00697         PUSHVEC(p->pos);
00698 
00699         PUSHVEC(p->normal);
00700         
00701         PUSHNUMBER(p->depth);
00702         
00703         PUSHUDATA(p->g1);
00704         PUSHUDATA(p->g2);
00705         
00706         PUSHNUMBER(p->side1);
00707         PUSHNUMBER(p->side2);
00708         
00709         return 11;
00710     } else return 0;
00711 }
00712 
00713 static int l_OdeContactGeomCreate (lua_State *L) { PROFILE
00714     dContactGeom *p = new dContactGeom;
00715     PUSHUDATA( p );
00716     return 1;
00717 }
00718 
00719 static int l_OdeContactGeomDestroy (lua_State *L) { PROFILE
00720     dContactGeom *p = CONTACTGEOMID(1);
00721     if(p)delete p;
00722     return 0;
00723 }
00724 
00725 void nearCallbackLua(void *data, dGeomID o0, dGeomID o1) {
00726     if (dGeomIsSpace (o0) || dGeomIsSpace (o1)) {
00727         // colliding a space with something
00728         dSpaceCollide2 (o0,o1,data,&nearCallbackLua);
00729         // collide all geoms internal to the space(s)
00730         if (dGeomIsSpace (o0)) dSpaceCollide((dSpaceID)o0,data,&nearCallbackLua);
00731         if (dGeomIsSpace (o1)) dSpaceCollide((dSpaceID)o1,data,&nearCallbackLua);
00732     } else {
00733         sCallbackData *d = (sCallbackData *) data;
00734         //printf("nearCallbackLua: fun(%x,%x)\n",o0,o1);
00735         //printf("                 body(%x,%x)\n",dGeomGetBody(o0),dGeomGetBody(o1));
00736         lua_rawgeti(d->L, LUA_REGISTRYINDEX, d->fun);
00737         lua_pushlightuserdata(d->L,reinterpret_cast<void*>(o0));
00738         lua_pushlightuserdata(d->L,reinterpret_cast<void*>(o1));
00739         lua_call(d->L, 2, 0); // TODO : see also PCallWithErrFuncWrapper for protected call in case of error (for error messages)
00740     }
00741 }   
00742 
00743 
00744 // lua : {contact,...} OdeCollide(dGeomID o1, dGeomID o2,count)
00745 static int l_OdeCollide (lua_State *L) { PROFILE
00746     dGeomID o0 = GEOMID(1);
00747     dGeomID o1 = GEOMID(2);
00748     //int flags = GETINT(3);
00749     int count = GETINT(3);
00750     
00751     // Create an array of dContact objects to hold the contact joints
00752     static const int MAX_CONTACTS = 10;
00753     static dContact contact[MAX_CONTACTS];
00754 
00755     if(count > MAX_CONTACTS)count = MAX_CONTACTS;
00756 
00757     if (int numc = dCollide(o0, o1, count, &contact[0].geom, sizeof(dContact))){
00758         // To add each contact point found to our joint group we call dJointCreateContact which is just one of the many
00759         // different joint types available.  
00760         lua_newtable(L);
00761         for (int i = 0; i < numc; i++){
00762             lua_pushlightuserdata( L, reinterpret_cast<void*>(contact + i));
00763             lua_rawseti( L, -2, i );
00764         }
00765         return 1;
00766     }   
00767         
00768     return 0;
00769 }
00770 
00771 /*
00772   int mode;
00773   dReal mu;
00774 
00775   dReal mu2;
00776   dReal bounce;
00777   dReal bounce_vel;
00778   dReal soft_erp;
00779   dReal soft_cfm;
00780   dReal motion1,motion2;
00781   dReal slip1,slip2;
00782 } dSurfaceParameters;
00783 */
00784 // lua : mode,mu,mu2,bounce,bounce_vel,soft_erp,soft_cfm,motion1,motion2,slip1,slip2 OdeGetContactSurface(dContact *p)
00785 static int l_OdeGetContactSurface (lua_State *L) { PROFILE
00786     dSurfaceParameters *p = &(CONTACTID(1)->surface);
00787     //1
00788     PUSHNUMBER(p->mode);
00789     PUSHNUMBER(p->mu);
00790     //3
00791     PUSHNUMBER(p->mu2);
00792     PUSHNUMBER(p->bounce);
00793     //5
00794     PUSHNUMBER(p->bounce_vel);
00795     PUSHNUMBER(p->soft_erp);
00796     //7
00797     PUSHNUMBER(p->soft_cfm);
00798     PUSHNUMBER(p->motion1);
00799     //9
00800     PUSHNUMBER(p->motion2);
00801     PUSHNUMBER(p->slip1);
00802     //11
00803     PUSHNUMBER(p->slip2);
00804     return 11;
00805 }
00806     
00807 // lua : OdeSetContactSurface(dContact *p,mode,mu,mu2,bounce,bounce_vel,soft_erp,soft_cfm,motion1,motion2,slip1,slip2)
00808 static int l_OdeSetContactSurface (lua_State *L) { PROFILE
00809     dSurfaceParameters *p = &(CONTACTID(1)->surface);
00810     p->mode = GETINT(2);
00811     p->mu = GETNUMBER(3);
00812     p->mu2 = GETNUMBER(4);
00813     p->bounce = GETNUMBER(5);
00814     p->bounce_vel = GETNUMBER(6);
00815     p->soft_erp = GETNUMBER(7);
00816     p->soft_cfm = GETNUMBER(8);
00817     p->motion1 = GETNUMBER(9);
00818     p->motion2 = GETNUMBER(10);
00819     p->slip1 = GETNUMBER(11);
00820     p->slip2 = GETNUMBER(12);
00821     return 0;
00822 }
00823  
00824  /*
00825 typedef struct dContactGeom {
00826   dVector3 pos;          ///< contact position
00827   dVector3 normal;       ///< normal vector
00828   dReal depth;           ///< penetration depth
00829   dGeomID g1,g2;         ///< the colliding geoms
00830   int side1,side2;       ///< (to be documented)
00831 } dContactGeom;
00832 */  
00833 
00834 // lua : OdeSetContactGeom(dContact *p,mode,mu,mu2,bounce,bounce_vel,soft_erp,soft_cfm,motion1,motion2,slip1,slip2)
00835 static int l_OdeSetContactGeom (lua_State *L) { PROFILE
00836     dContactGeom *p = &(CONTACTID(1)->geom);
00837     //2
00838     VEC3_(2,p->pos);
00839     //5
00840     VEC3_(5,p->normal);
00841     //8
00842     p->depth = GETNUMBER(8);
00843     p->g1 = GEOMID(9);
00844     p->g2 = GEOMID(10);
00845     //11
00846     p->side1 = GETINT(11);
00847     p->side2 = GETINT(12);
00848     return 0;
00849 }
00850     
00851 // lua : posx,posy,posz,normalx,normaly,normalz,depth,g1,g2,side1,side2 OdeGetContactGeom(dContact *p)
00852 static int l_OdeGetContactGeom (lua_State *L) { PROFILE
00853     dContactGeom *p = &(CONTACTID(1)->geom);
00854     //1
00855     PUSHVEC(p->pos);
00856     //4
00857     PUSHVEC(p->normal);
00858     //7
00859     PUSHNUMBER(p->depth);
00860     PUSHUDATA(p->g1);   
00861     PUSHUDATA(p->g2);   
00862     //10
00863     PUSHNUMBER(p->side1);
00864     PUSHNUMBER(p->side2);
00865     
00866     return 11;
00867 }
00868 
00869  
00899 // lua : void OdeSpaceCollide(dSpaceID space,fun(o0,o1))
00900 static int l_OdeSpaceCollide (lua_State *L) { PROFILE
00901     sCallbackData data;
00902     
00903     data.L = L;
00904     data.fun = luaL_ref(L, LUA_REGISTRYINDEX);
00905     
00906     dSpaceID space = SPACEID(1);
00907     lua_pop(L,1);
00908     
00909     dSpaceCollide(space, &data, &nearCallbackLua);
00910     
00911     luaL_unref(L, LUA_REGISTRYINDEX, data.fun);
00912     
00913     return 0;
00914 }
00915 
00916 /*
00917 // like OdeSpaceCollide but with an additional callback function
00918 // fun() : function to create the collision feedback joints
00919 //         function callback(o0,o1,posx,posy,posz,normalx,normaly,normalz,depth,g1,g2,side1,side2) 
00920 //           return mode,mu,mu2,bounce,bounce_vel,soft_erp,soft_cfm,motion1,motion2,slip1,slip2  
00921 //         end
00922 // lua : void OdeSpaceCollideWithCallback(dWorldID, dJointGroupID, dSpaceID space,fun())
00923 static int l_OdeSpaceCollideWithCallback (lua_State *L) { PROFILE
00924     sCollisionData data;
00925 
00926     data.fun = luaL_ref(L, LUA_REGISTRYINDEX);
00927 
00928     data.world = WORLDID(1);
00929     data.contactgroup = JOINTGROUPID(2);
00930     dSpaceID space = SPACEID(3);
00931     
00932     lua_pop(L, 3);
00933     
00934     data.L = L;
00935     
00936     dSpaceCollide(space, &data, &nearCallback);
00937 
00938     luaL_unref(L, LUA_REGISTRYINDEX, data.fun);
00939 
00940     return 0;
00941 }
00942 */
00943 
00978 // lua : void OdeSpaceCollide2(dGeomID space1, dGeomID space2, fun(o0,o1))
00979 static int l_OdeSpaceCollide2 (lua_State *L) { PROFILE
00980     sCallbackData data;
00981     
00982     data.L = L;
00983     data.fun = luaL_ref(L, LUA_REGISTRYINDEX);
00984     
00985     dGeomID space1 = GEOMID(1);
00986     dGeomID space2 = GEOMID(2);
00987     
00988     lua_pop(L,2);
00989     
00990     dSpaceCollide2(space1, space2, &data, &nearCallbackLua);
00991 
00992     luaL_unref(L, LUA_REGISTRYINDEX, data.fun);
00993     
00994     return 0;
00995 }
00996 
01016 // lua : dGeomID OdeCreateSphere(dSpaceID space, dReal radius) [ from ode ]
01017 static int l_OdeCreateSphere (lua_State *L) { PROFILE
01018     PUSHUDATA( dCreateSphere(SPACEID(1), GETNUMBER(2)) );
01019     return 1;
01020 }
01021 
01031 // lua : void OdeGeomSphereSetRadius(dGeomID sphere, dReal radius) [ from ode ]
01032 static int l_OdeGeomSphereSetRadius (lua_State *L) { PROFILE
01033     dGeomSphereSetRadius(GEOMID(1), GETNUMBER(2));
01034     return 0;
01035 }
01036 
01045 // lua : dReal OdeGeomSphereGetRadius(dGeomID sphere) [ from ode ]
01046 static int l_OdeGeomSphereGetRadius (lua_State *L) { PROFILE
01047     PUSHNUMBER(dGeomSphereGetRadius(GEOMID(1)));
01048     return 1;
01049 }
01050 
01065 // lua : dReal OdeGeomSpherePointDepth(dGeomID sphere, dReal x, dReal y, dReal z) [ from ode ]
01066 static int l_OdeGeomSpherePointDepth (lua_State *L) { PROFILE
01067     PUSHNUMBER(dGeomSpherePointDepth(GEOMID(1), GETVEC(2)));
01068     return 1;
01069 }
01070 
01071 //--> Convex Functions
01072 // lua : dGeomID OdeCreateConvex(dSpaceID space,dReal *_planes,unsigned int _planecount,dReal *_points,unsigned int _pointcount,unsigned int *_polygons) [ from ode ]
01073 static int l_OdeCreateConvex (lua_State *L) { PROFILE
01074     // TODO dCreateConvex(dSpaceID space,dReal *_planes,unsigned int _planecount,dReal *_points,unsigned int _pointcount,unsigned int *_polygons);
01075     return 0;
01076 }
01077 
01078 
01079 // lua : void OdeGeomSetConvex(dGeomID g,dReal *_planes,unsigned int _count,dReal *_points,unsigned int _pointcount,unsigned int *_polygons) [ from ode ]
01080 static int l_OdeGeomSetConvex (lua_State *L) { PROFILE
01081     // TODO dGeomSetConvex(dGeomID g,dReal *_planes,unsigned int _count,dReal *_points,unsigned int _pointcount,unsigned int *_polygons);
01082     return 0;
01083 }
01084 
01085 //<-- Convex Functions
01086 
01108 // lua : dGeomID OdeCreateBox(dSpaceID space, dReal lx, dReal ly, dReal lz) [ from ode ]
01109 static int l_OdeCreateBox (lua_State *L) { PROFILE
01110     PUSHUDATA(dCreateBox(SPACEID(1), GETVEC(2)));
01111     return 1;
01112 }
01113 
01125 // lua : void OdeGeomBoxSetLengths(dGeomID box, dReal lx, dReal ly, dReal lz) [ from ode ]
01126 static int l_OdeGeomBoxSetLengths (lua_State *L) { PROFILE
01127     dGeomBoxSetLengths(GEOMID(1), GETVEC(2));
01128     return 0;
01129 }
01130 
01140 // lua : lx,ly,lz OdeGeomBoxGetLengths(dGeomID box, dVector3 result) [ from ode ]
01141 static int l_OdeGeomBoxGetLengths (lua_State *L) { PROFILE
01142     dVector3 result;
01143     dGeomBoxGetLengths(GEOMID(1), result);
01144     PUSHVEC(result);
01145     return 3;
01146 }
01147 
01160 // lua : dReal OdeGeomBoxPointDepth(dGeomID box, dReal x, dReal y, dReal z) [ from ode ]
01161 static int l_OdeGeomBoxPointDepth (lua_State *L) { PROFILE
01162     PUSHNUMBER( dGeomBoxPointDepth(GEOMID(1), GETVEC(2)) );
01163     return 1;
01164 }
01165 
01166 
01167 // lua : dGeomID OdeCreatePlane(dSpaceID space, dReal a, dReal b, dReal c, dReal d) [ from ode ]
01168 static int l_OdeCreatePlane (lua_State *L) { PROFILE
01169     PUSHUDATA( dCreatePlane(SPACEID(1), GETVEC(2), GETNUMBER(5)) );
01170     return 1;
01171 }
01172 
01173 
01174 // lua : void OdeGeomPlaneSetParams(dGeomID plane, dReal a, dReal b, dReal c, dReal d) [ from ode ]
01175 static int l_OdeGeomPlaneSetParams (lua_State *L) { PROFILE
01176     dGeomPlaneSetParams(GEOMID(1), GETVEC(2), GETNUMBER(5));
01177     return 0;
01178 }
01179 
01180 
01181 // lua : a,b,c,d OdeGeomPlaneGetParams(dGeomID plane, dVector4 result) [ from ode ]
01182 static int l_OdeGeomPlaneGetParams (lua_State *L) { PROFILE
01183     dVector4 result;
01184     dGeomPlaneGetParams(GEOMID(1), result);
01185     PUSHVEC(result);
01186     PUSHNUMBER(result[3]);
01187     return 4;
01188 }
01189 
01190 
01191 // lua : dReal OdeGeomPlanePointDepth(dGeomID plane, dReal x, dReal y, dReal z) [ from ode ]
01192 static int l_OdeGeomPlanePointDepth (lua_State *L) { PROFILE
01193     PUSHNUMBER( dGeomPlanePointDepth(GEOMID(1), GETVEC(2)) );
01194     return 1;
01195 }
01196 
01197 
01198 // lua : dGeomID OdeCreateCapsule(dSpaceID space, dReal radius, dReal length) [ from ode ]
01199 static int l_OdeCreateCapsule (lua_State *L) { PROFILE
01200     PUSHUDATA( dCreateCapsule(SPACEID(1), GETNUMBER(2), GETNUMBER(3)) );
01201     return 1;
01202 }
01203 
01204 
01205 // lua : void OdeGeomCapsuleSetParams(dGeomID ccylinder, dReal radius, dReal length) [ from ode ]
01206 static int l_OdeGeomCapsuleSetParams (lua_State *L) { PROFILE
01207     dGeomCapsuleSetParams(GEOMID(1), GETNUMBER(2), GETNUMBER(3));
01208     return 0;
01209 }
01210 
01211 
01212 // lua : r,l OdeGeomCapsuleGetParams(dGeomID ccylinder, dReal *radius, dReal *length) [ from ode ]
01213 static int l_OdeGeomCapsuleGetParams (lua_State *L) { PROFILE
01214     dReal r,l;
01215     dGeomCapsuleGetParams(GEOMID(1), &r, &l);
01216     PUSHNUMBER(r);
01217     PUSHNUMBER(l);
01218     return 2;
01219 }
01220 
01221 
01222 // lua : dReal OdeGeomCapsulePointDepth(dGeomID ccylinder, dReal x, dReal y, dReal z) [ from ode ]
01223 static int l_OdeGeomCapsulePointDepth (lua_State *L) { PROFILE
01224     PUSHNUMBER( dGeomCapsulePointDepth(GEOMID(1), GETVEC(2)) );
01225     return 1;
01226 }
01227 
01228 
01229 // lua : void OdeGeomCylinderSetParams(dGeomID cylinder, dReal radius, dReal length) [ from ode ]
01230 static int l_OdeGeomCylinderSetParams (lua_State *L) { PROFILE
01231     dGeomCylinderSetParams(GEOMID(1), GETNUMBER(2), GETNUMBER(3));
01232     return 0;
01233 }
01234 
01235 
01236 // lua : r,l OdeGeomCylinderGetParams(dGeomID cylinder, dReal *radius, dReal *length) [ from ode ]
01237 static int l_OdeGeomCylinderGetParams (lua_State *L) { PROFILE
01238     dReal r,l;
01239     dGeomCylinderGetParams(GEOMID(1), &r,&l);
01240     PUSHNUMBER(r);
01241     PUSHNUMBER(l);
01242     return 2;
01243 }
01244 
01245 
01246 // lua : dGeomID OdeCreateRay(dSpaceID space, dReal length) [ from ode ]
01247 static int l_OdeCreateRay (lua_State *L) { PROFILE
01248     PUSHUDATA( dCreateRay(SPACEID(1), GETNUMBER(2)) );
01249     return 1;
01250 }
01251 
01252 
01253 // lua : void OdeGeomRaySetLength(dGeomID ray, dReal length) [ from ode ]
01254 static int l_OdeGeomRaySetLength (lua_State *L) { PROFILE
01255     dGeomRaySetLength(GEOMID(1), GETNUMBER(2));
01256     return 0;
01257 }
01258 
01259 
01260 // lua : dReal OdeGeomRayGetLength(dGeomID ray) [ from ode ]
01261 static int l_OdeGeomRayGetLength (lua_State *L) { PROFILE
01262     PUSHNUMBER( dGeomRayGetLength(GEOMID(1)) );
01263     return 1;
01264 }
01265 
01266 
01267 // lua : void OdeGeomRaySet(dGeomID ray, dReal px, dReal py, dReal pz,dReal dx, dReal dy, dReal dz) [ from ode ]
01268 static int l_OdeGeomRaySet (lua_State *L) { PROFILE
01269     dGeomRaySet(GEOMID(1), GETVEC(2), GETVEC(5));
01270     return 0;
01271 }
01272 
01273 // lua : void OdeGeomDestroy(dGeomID)
01274 static int l_OdeGeomDestroy (lua_State *L) { PROFILE
01275     dGeomDestroy(GEOMID(1));
01276     return 0;
01277 }
01278 
01279 
01280 // lua : px,py,pz, dx,dy,dz OdeGeomRayGet(dGeomID ray, dVector3 start, dVector3 dir) [ from ode ]
01281 static int l_OdeGeomRayGet (lua_State *L) { PROFILE
01282     dVector3 start;
01283     dVector3 dir;
01284     dGeomRayGet(GEOMID(1), start, dir);
01285     PUSHVEC(start);
01286     PUSHVEC(dir);
01287     return 6;
01288 }
01289 
01290 /*
01291  * Set/get ray flags that influence ray collision detection.
01292  * These flags are currently only noticed by the trimesh collider, because
01293  * they can make a major differences there.
01294  */
01295 // lua : void OdeGeomRaySetParams(dGeomID g, int FirstContact, int BackfaceCull) [ from ode ]
01296 static int l_OdeGeomRaySetParams (lua_State *L) { PROFILE
01297     dGeomRaySetParams(GEOMID(1), GETINT(2), GETINT(3));
01298     return 0;
01299 }
01300 
01301 
01302 // lua : FirstContact, BackfaceCull OdeGeomRayGetParams(dGeomID g, int *FirstContact, int *BackfaceCull) [ from ode ]
01303 static int l_OdeGeomRayGetParams (lua_State *L) { PROFILE
01304     int FirstContact, BackfaceCull;
01305     dGeomRayGetParams(GEOMID(1), &FirstContact, &BackfaceCull);
01306     PUSHNUMBER(FirstContact);
01307     PUSHNUMBER(BackfaceCull);
01308     return 2;
01309 }
01310 
01311 
01312 // lua : void OdeGeomRaySetClosestHit(dGeomID g, int closestHit) [ from ode ]
01313 static int l_OdeGeomRaySetClosestHit (lua_State *L) { PROFILE
01314     dGeomRaySetClosestHit(GEOMID(1), GETINT(2));
01315     return 0;
01316 }
01317 
01318 
01319 // lua : int OdeGeomRayGetClosestHit(dGeomID g) [ from ode ]
01320 static int l_OdeGeomRayGetClosestHit (lua_State *L) { PROFILE
01321     PUSHNUMBER( dGeomRayGetClosestHit(GEOMID(1)) );
01322     return 1;
01323 }
01324 
01325 
01326 // lua : void OdeGeomTransformSetGeom(dGeomID g, dGeomID obj) [ from ode ]
01327 static int l_OdeGeomTransformSetGeom (lua_State *L) { PROFILE
01328     dGeomTransformSetGeom(GEOMID(1), GEOMID(2));
01329     return 0;
01330 }
01331 
01332 
01333 // lua : dGeomID OdeGeomTransformGetGeom(dGeomID g) [ from ode ]
01334 static int l_OdeGeomTransformGetGeom (lua_State *L) { PROFILE
01335     PUSHUDATA( dGeomTransformGetGeom(GEOMID(1)) );
01336     return 1;
01337 }
01338 
01339 
01340 // lua : void OdeGeomTransformSetCleanup(dGeomID g, int mode) [ from ode ]
01341 static int l_OdeGeomTransformSetCleanup (lua_State *L) { PROFILE
01342     dGeomTransformSetCleanup(GEOMID(1), GETINT(2));
01343     return 0;
01344 }
01345 
01346 
01347 // lua : int OdeGeomTransformGetCleanup(dGeomID g) [ from ode ]
01348 static int l_OdeGeomTransformGetCleanup (lua_State *L) { PROFILE
01349     PUSHNUMBER( dGeomTransformGetCleanup(GEOMID(1)) );
01350     return 1;
01351 }
01352 
01353 
01354 // lua : void OdeGeomTransformSetInfo(dGeomID g, int mode) [ from ode ]
01355 static int l_OdeGeomTransformSetInfo (lua_State *L) { PROFILE
01356     dGeomTransformSetInfo(GEOMID(1), GETINT(2));
01357     return 0;
01358 }
01359 
01360 
01361 // lua : int OdeGeomTransformGetInfo(dGeomID g) [ from ode ]
01362 static int l_OdeGeomTransformGetInfo (lua_State *L) { PROFILE
01363     PUSHNUMBER( dGeomTransformGetInfo(GEOMID(1)) );
01364     return 1;
01365 }
01366 
01386 // lua : dGeomID OdeCreateHeightfield( dSpaceID space,dHeightfieldDataID data, int bPlaceable ) [ from ode ]
01387 static int l_OdeCreateHeightfield (lua_State *L) { PROFILE
01388     PUSHUDATA( dCreateHeightfield( SPACEID(1), HEIGHTFIELDDATAID(2), GETINT(3) ) );
01389     return 1;
01390 }
01391 
01400 // lua : void OdeGeomHeightfieldDataDestroy( dHeightfieldDataID d ) [ from ode ]
01401 static int l_OdeGeomHeightfieldDataDestroy (lua_State *L) { PROFILE
01402     dGeomHeightfieldDataDestroy( HEIGHTFIELDDATAID(1) );
01403     return 0;
01404 }
01405 
01406 // lua : dHeightfieldDataID OdeGeomHeightfieldDataCreate() [ from ode ]
01407 static int l_OdeGeomHeightfieldDataCreate (lua_State *L) { PROFILE
01408     PUSHUDATA( dGeomHeightfieldDataCreate() );
01409     return 1;
01410 }
01411 
01412 
01453 // lua : void OdeGeomHeightfieldDataBuildCallback( dHeightfieldDataID d,void* pUserData, dHeightfieldGetHeight* pCallback,dReal width, dReal depth, int widthSamples, int depthSamples,dReal scale, dReal offset, dReal thickness, int bWrap ) [ from ode ]
01454 static int l_OdeGeomHeightfieldDataBuildCallback (lua_State *L) { PROFILE
01455     // TODO dGeomHeightfieldDataBuildCallback( dHeightfieldDataID d,void* pUserData, dHeightfieldGetHeight* pCallback,dReal width, dReal depth, int widthSamples, int depthSamples,dReal scale, dReal offset, dReal thickness, int bWrap );
01456     return 0;
01457 }
01458 
01459 
01460 float CallLuaGetHeightFun(lua_State *L, int fun,const float x,const float z){
01461     lua_rawgeti(L, LUA_REGISTRYINDEX, fun);
01462     lua_pushnumber(L, x);
01463     lua_pushnumber(L, z);
01464     lua_call(L, 2, 1); // TODO : see also PCallWithErrFuncWrapper for protected call in case of error (for error messages)
01465     float r = GETNUMBER(lua_gettop(L));
01466     lua_pop(L, 1);
01467     return r;
01468 }
01469 
01470 #define HF_BUFFERINDEX(w,h,x,z) ((w)*(z)+(x))
01471 
01472 // lua : void OdeGeomHeightfieldDataBuildFromFun( dHeightfieldDataID d,width,height,dx,dz,float fun(x,z))
01473 static int l_OdeGeomHeightfieldDataBuildFromFun (lua_State *L) { PROFILE
01474     dHeightfieldDataID hf = HEIGHTFIELDDATAID(1);
01475     float w = GETNUMBER(2);
01476     float h = GETNUMBER(3);
01477     float dx = GETNUMBER(4);
01478     float dz = GETNUMBER(5);
01479     
01480     int px = (int)floor(w / dx);
01481     int pz = (int)floor(h / dz);
01482     
01483     // stores the given lua function in the registry
01484     int fun = luaL_ref(L, LUA_REGISTRYINDEX);
01485     
01486     // clears the lua stack that we can call the given lua function
01487     lua_pop(L, 5);
01488     
01489     int bw = px + 1;
01490     int bh = pz + 1;
01491     
01492     float *fdata = new float[bw * bh];
01493     
01494     for(int x=0;x <= px;++x)
01495         for(int z=0;z <= pz;++z){
01496             //printf("[%f,%f]",(float)x*dx,(float)y*dy);
01497             float y = CallLuaGetHeightFun(L,fun,(float)x*dx,(float)z*dz);
01498             //printf(" => %f\n",z);
01499             
01500             fdata[HF_BUFFERINDEX(bw,bh,x,z)] = y;
01501         }
01502     
01503     float min = fdata[0];
01504     float max = fdata[0];
01505     
01506     for(int x=0;x <= px;++x)
01507         for(int z=0;z <= pz;++z){
01508             float y = fdata[HF_BUFFERINDEX(bw,bh,x,z)];
01509             if(y > max)max = y;
01510             if(y < min)min = y;
01511         }   
01512 
01513     if(0){ // byte
01514         float offset = min;
01515         float dy = max - min;
01516         float scale = dy / 255.0f;
01517         
01518         unsigned char *bdata = new unsigned char[bw * bh];
01519 
01520         for(int x=0;x <= px;++x)
01521             for(int z=0;z <= pz;++z){
01522                 float y = fdata[HF_BUFFERINDEX(bw,bh,x,z)];
01523                 bdata[HF_BUFFERINDEX(bw,bh,x,z)] = (unsigned char)( ((y - offset) * 255.0f) / dy );
01524             }   
01525     
01526         printf("DEBUG hf=%d  w=%f h=%f px=%d pz=%d offset=%f scale=%f min=%f max=%f\n",hf,w,h,px,pz,offset,scale,min,max);
01527     
01528         /*
01529         for(int x=0;x <= px;++x)
01530             for(int z=0;z <= pz;++z){
01531                 float y = bdata[HF_BUFFERINDEX(bw,bh,x,z)];
01532                 printf("HF byte: [%f %f] %d -> %f\n",(float)x * dx,(float)z * dz,(int)y,y * scale + offset);
01533             }   
01534         */
01535         
01536         // return (h * m_fScale) + m_fOffset;
01537         // dGeomHeightfieldDataBuildByte( dHeightfieldDataID d,const unsigned char* pHeightData, int bCopyHeightData,
01538         // dReal width, dReal depth, int widthSamples, int depthSamples,dReal scale, dReal offset, dReal thickness, int bWrap );
01539         dGeomHeightfieldDataBuildByte( hf, bdata, true, w, h, px + 1, pz + 1, scale, offset, 1.0f, false);
01540 
01541         delete[] bdata;
01542     } else { // float
01543         dGeomHeightfieldDataBuildSingle( hf, fdata, true, w, h, px + 1, pz + 1, 1.0f, 0.0f, 1.0f, false);
01544         dGeomHeightfieldDataSetBounds(hf, min, max);
01545     }
01546     
01547     delete[] fdata;
01548     
01549 
01550     // release the given lua function
01551     luaL_unref(L, LUA_REGISTRYINDEX, fun);
01552 
01553     return 0;
01554 }
01555 
01599 // lua : void OdeGeomHeightfieldDataBuildByte( dHeightfieldDataID d,const unsigned char* pHeightData, int bCopyHeightData,dReal width, dReal depth, int widthSamples, int depthSamples,dReal scale, dReal offset, dReal thickness,  int bWrap ) [ from ode ]
01600 static int l_OdeGeomHeightfieldDataBuildByte (lua_State *L) { PROFILE
01601     // TODO dGeomHeightfieldDataBuildByte( dHeightfieldDataID d,const unsigned char* pHeightData, int bCopyHeightData,dReal width, dReal depth, int widthSamples, int depthSamples,dReal scale, dReal offset, dReal thickness,  int bWrap );
01602     return 0;
01603 }
01604 
01648 // lua : void OdeGeomHeightfieldDataBuildShort( dHeightfieldDataID d,const short* pHeightData, int bCopyHeightData,dReal width, dReal depth, int widthSamples, int depthSamples,dReal scale, dReal offset, dReal thickness, int bWrap ) [ from ode ]
01649 static int l_OdeGeomHeightfieldDataBuildShort (lua_State *L) { PROFILE
01650     // TODO dGeomHeightfieldDataBuildShort( dHeightfieldDataID d,const short* pHeightData, int bCopyHeightData,dReal width, dReal depth, int widthSamples, int depthSamples,dReal scale, dReal offset, dReal thickness, int bWrap );
01651     return 0;
01652 }
01653 
01699 // lua : void OdeGeomHeightfieldDataBuildSingle( dHeightfieldDataID d,const float* pHeightData, int bCopyHeightData,dReal width, dReal depth, int widthSamples, int depthSamples,dReal scale, dReal offset, dReal thickness, int bWrap ) [ from ode ]
01700 static int l_OdeGeomHeightfieldDataBuildSingle (lua_State *L) { PROFILE
01701     // TODO dGeomHeightfieldDataBuildSingle( dHeightfieldDataID d,const float* pHeightData, int bCopyHeightData,dReal width, dReal depth, int widthSamples, int depthSamples,dReal scale, dReal offset, dReal thickness, int bWrap );
01702     return 0;
01703 }
01704 
01750 // lua : void OdeGeomHeightfieldDataBuildDouble( dHeightfieldDataID d,const double* pHeightData, int bCopyHeightData,dReal width, dReal depth, int widthSamples, int depthSamples,dReal scale, dReal offset, dReal thickness, int bWrap ) [ from ode ]
01751 static int l_OdeGeomHeightfieldDataBuildDouble (lua_State *L) { PROFILE
01752     // TODO dGeomHeightfieldDataBuildDouble( dHeightfieldDataID d,const double* pHeightData, int bCopyHeightData,dReal width, dReal depth, int widthSamples, int depthSamples,dReal scale, dReal offset, dReal thickness, int bWrap );
01753     return 0;
01754 }
01755 
01773 // lua : void OdeGeomHeightfieldDataSetBounds( dHeightfieldDataID d,dReal minHeight, dReal maxHeight ) [ from ode ]
01774 static int l_OdeGeomHeightfieldDataSetBounds (lua_State *L) { PROFILE
01775     dGeomHeightfieldDataSetBounds( HEIGHTFIELDDATAID(1), GETNUMBER(2), GETNUMBER(3) );
01776     return 0;
01777 }
01778 
01789 // lua : void OdeGeomHeightfieldSetHeightfieldData( dGeomID g, dHeightfieldDataID d ) [ from ode ]
01790 static int l_OdeGeomHeightfieldSetHeightfieldData (lua_State *L) { PROFILE
01791     dGeomHeightfieldSetHeightfieldData( GEOMID(1), HEIGHTFIELDDATAID(2) );
01792     return 0;
01793 }
01794 
01804 // lua : dHeightfieldDataID OdeGeomHeightfieldGetHeightfieldData( dGeomID g ) [ from ode ]
01805 static int l_OdeGeomHeightfieldGetHeightfieldData (lua_State *L) { PROFILE
01806     PUSHUDATA( dGeomHeightfieldGetHeightfieldData( GEOMID(1) ) );
01807     return 1;
01808 }
01809 
01810 /* ************************************************************************ */
01811 /* utility functions */
01812 // lua : cp1x,cp1y,cp1z,cp2x,cp2y,cp2z OdeClosestLineSegmentPoints(const dVector3 a1, const dVector3 a2,const dVector3 b1, const dVector3 b2) [ from ode ]
01813 static int l_OdeClosestLineSegmentPoints (lua_State *L) { PROFILE
01814     VEC3(1,a1);
01815     VEC3(4,a2);
01816     VEC3(7,b1);
01817     VEC3(10,b2);
01818     
01819     dVector3 cp1,cp2;
01820     dClosestLineSegmentPoints(a1,a2,b1,b2,cp1,cp2);
01821     
01822     PUSHVEC(cp1);
01823     PUSHVEC(cp2);
01824     return 6;
01825 }
01826 
01827 
01828 // lua : int OdeBoxTouchesBox(const dVector3 _p1, const dMatrix3 R1,const dVector3 side1, const dVector3 _p2,const dMatrix3 R2, const dVector3 side2) [ from ode ]
01829 static int l_OdeBoxTouchesBox (lua_State *L) { PROFILE
01830     // TODO dBoxTouchesBox(const dVector3 _p1, const dMatrix3 R1,const dVector3 side1, const dVector3 _p2,const dMatrix3 R2, const dVector3 side2);
01831     return 0;
01832 }
01833 
01834 // lua : ax,ay,az, bx,by,bz OdeInfiniteAABB(dGeomID geom, dReal aabb[6]) [ from ode ]
01835 static int l_OdeInfiniteAABB (lua_State *L) { PROFILE
01836     dReal aabb[6];
01837     dInfiniteAABB(GEOMID(1), aabb);
01838     PUSHVEC_(aabb,0);
01839     PUSHVEC_(aabb,3);
01840     return 6;
01841 }
01842 
01843 
01844 // lua : void OdeInitODE(void) [ from ode ]
01845 static int l_OdeInitODE (lua_State *L) { PROFILE
01846     dInitODE();
01847     return 0;
01848 }
01849 
01850 
01851 // lua : void OdeCloseODE(void) [ from ode ]
01852 static int l_OdeCloseODE (lua_State *L) { PROFILE
01853     dCloseODE();
01854     return 0;
01855 }
01856 
01857 
01858 // lua : int OdeCreateGeomClass(const dGeomClass *classptr) [ from ode ]
01859 static int l_OdeCreateGeomClass (lua_State *L) { PROFILE
01860     // TODO dCreateGeomClass(const dGeomClass *classptr);
01861     return 0;
01862 }
01863 
01864 
01865 // lua : * OdeGeomGetClassData(dGeomID) [ from ode ]
01866 static int l_OdeGeomGetClassData (lua_State *L) { PROFILE
01867     // TODO dGeomGetClassData(dGeomID);
01868     return 0;
01869 }
01870 
01871 
01872 // lua : dGeomID OdeCreateGeom(int classnum) [ from ode ]
01873 static int l_OdeCreateGeom (lua_State *L) { PROFILE
01874     PUSHUDATA( dCreateGeom(GETINT(1)) );
01875     return 1;
01876 }
01877 
01878 
01879 // lua : dSpaceID OdeSimpleSpaceCreate(dSpaceID space) [ from ode ]
01880 static int l_OdeSimpleSpaceCreate (lua_State *L) { PROFILE
01881     PUSHUDATA( dSimpleSpaceCreate(SPACEID(1)) );
01882     return 1;
01883 }
01884 
01885 
01886 // lua : dSpaceID OdeHashSpaceCreate(dSpaceID space) [ from ode ]
01887 static int l_OdeHashSpaceCreate (lua_State *L) { PROFILE
01888     PUSHUDATA( dHashSpaceCreate(SPACEID(1)) );
01889     return 1;
01890 }
01891 
01892 
01893 // lua : dSpaceID OdeQuadTreeSpaceCreate(dSpaceID space, dVector3 Center, dVector3 Extents, int Depth) [ from ode ]
01894 static int l_OdeQuadTreeSpaceCreate (lua_State *L) { PROFILE
01895     VEC3(2,v);
01896     VEC3(5,w);
01897     PUSHUDATA( dQuadTreeSpaceCreate(SPACEID(1), v,w, GETINT(8)) );
01898     return 1;
01899 }
01900 
01901 
01902 // lua : void OdeSpaceDestroy(dSpaceID) [ from ode ]
01903 static int l_OdeSpaceDestroy (lua_State *L) { PROFILE
01904     dSpaceDestroy(SPACEID(1));
01905     return 0;
01906 }
01907 
01908 
01909 // lua : void OdeHashSpaceSetLevels(dSpaceID space, int minlevel, int maxlevel) [ from ode ]
01910 static int l_OdeHashSpaceSetLevels (lua_State *L) { PROFILE
01911     dHashSpaceSetLevels(SPACEID(1), GETINT(2), GETINT(3));
01912     return 0;
01913 }
01914 
01915 
01916 // lua : minlevel,maxlevel OdeHashSpaceGetLevels(dSpaceID space, int *minlevel, int *maxlevel) [ from ode ]
01917 static int l_OdeHashSpaceGetLevels (lua_State *L) { PROFILE
01918     int minlevel, maxlevel;
01919     dHashSpaceGetLevels(SPACEID(1), &minlevel, &maxlevel);
01920     PUSHNUMBER(minlevel);
01921     PUSHNUMBER(maxlevel);
01922     return 2;
01923 }
01924 
01925 
01926 // lua : void OdeSpaceSetCleanup(dSpaceID space, int mode) [ from ode ]
01927 static int l_OdeSpaceSetCleanup (lua_State *L) { PROFILE
01928     dSpaceSetCleanup(SPACEID(1), GETINT(2));
01929     return 0;
01930 }
01931 
01932 
01933 // lua : int OdeSpaceGetCleanup(dSpaceID space) [ from ode ]
01934 static int l_OdeSpaceGetCleanup (lua_State *L) { PROFILE
01935     PUSHNUMBER( dSpaceGetCleanup(SPACEID(1)) );
01936     return 1;
01937 }
01938 
01939 
01940 // lua : void OdeSpaceAdd(dSpaceID, dGeomID) [ from ode ]
01941 static int l_OdeSpaceAdd (lua_State *L) { PROFILE
01942     dSpaceAdd(SPACEID(1), GEOMID(2));
01943     return 0;
01944 }
01945 
01946 
01947 // lua : void OdeSpaceRemove(dSpaceID, dGeomID) [ from ode ]
01948 static int l_OdeSpaceRemove (lua_State *L) { PROFILE
01949     dSpaceRemove(SPACEID(1), GEOMID(2));
01950     return 0;
01951 }
01952 
01953 
01954 // lua : int OdeSpaceQuery(dSpaceID, dGeomID) [ from ode ]
01955 static int l_OdeSpaceQuery (lua_State *L) { PROFILE
01956     PUSHNUMBER( dSpaceQuery(SPACEID(1), GEOMID(2)) );
01957     return 1;
01958 }
01959 
01960 
01961 // lua : void OdeSpaceClean(dSpaceID) [ from ode ]
01962 static int l_OdeSpaceClean (lua_State *L) { PROFILE
01963     dSpaceClean(SPACEID(1));
01964     return 0;
01965 }
01966 
01967 
01968 // lua : int OdeSpaceGetNumGeoms(dSpaceID) [ from ode ]
01969 static int l_OdeSpaceGetNumGeoms (lua_State *L) { PROFILE
01970     PUSHNUMBER( dSpaceGetNumGeoms(SPACEID(1)) );
01971     return 1;
01972 }
01973 
01974 
01975 // lua : dGeomID OdeSpaceGetGeom(dSpaceID, int i) [ from ode ]
01976 static int l_OdeSpaceGetGeom (lua_State *L) { PROFILE
01977     PUSHUDATA( dSpaceGetGeom(SPACEID(1), GETINT(2)) );
01978     return 1;
01979 }
01980 
01981 /*
01982  * These dont make much sense now, but they will later when we add more
01983  * features.
01984  */
01985 
01986 
01987 class cTriangleMeshRawData {
01988 public:
01989     dVector3 *mVertexData;
01990     unsigned int *mIndicesData;
01991     unsigned int miTriangles;
01992     unsigned int miVertexes;
01993     unsigned int miIndices;
01994     
01996     cTriangleMeshRawData(cFIFO *f){
01997         assert(f && "f must not be 0");
01998         
01999         int trianglesize = 3 * 3 * sizeof(float);
02000         miTriangles = f->size() / trianglesize;
02001         miVertexes = miTriangles * 3;
02002         miIndices = miTriangles * 3;
02003         
02004         mVertexData = new dVector3[miVertexes];
02005         mIndicesData = new unsigned int[miIndices];
02006         
02007         unsigned int index = 0;
02008         while(f->size() > 0){
02009             mVertexData[index][0] = f->PopF();
02010             mVertexData[index][1] = f->PopF();
02011             mVertexData[index][2] = f->PopF();
02012             mVertexData[index][3] = 1.0f;
02013             mIndicesData[index] = index;
02014             ++index;
02015         }
02016     }
02017 
02018     void Print(){
02019         printf("DEBUG trimesh triangles=%d vertexes=%d indices=%d\n",miTriangles,miVertexes,miIndices);
02020         
02021         for(unsigned int i=0;i<miVertexes;++i){
02022             printf("Vertex[%f,%f,%f,%f]\n",mVertexData[i][0],mVertexData[i][1],mVertexData[i][2],mVertexData[i][3]);
02023         }
02024         for(unsigned int i=0;i<miIndices;i+=3){
02025             printf("Indices[%d,%d,%d]\n",mIndicesData[i],mIndicesData[i+1],mIndicesData[i+2]);
02026         }
02027         
02028         printf("dReal=%d dVector3=%d\n",sizeof(dReal),sizeof(dVector3));
02029     }
02030     
02031     ~cTriangleMeshRawData(){
02032         delete[] mVertexData;
02033         delete[] mIndicesData;
02034     }
02035 };
02036 
02037 // lua : cTriangleMeshRawData OdeTriMeshRawDataCreate(fifo)
02038 static int l_OdeTriMeshRawDataCreate (lua_State *L) { PROFILE
02039     cFIFO *f = GETFIFO(1);
02040     if(f){
02041         PUSHUDATA( new cTriangleMeshRawData(f) );   
02042         return 1;
02043     } else return 0;
02044 }
02045 
02046 
02047 // lua : void OdeTriMeshRawDataDestroy(cTriangleMeshRawData)
02048 static int l_OdeTriMeshRawDataDestroy (lua_State *L) { PROFILE
02049     cTriangleMeshRawData *p = TRIMESHRAWDATAID(1);
02050     if(p)delete p;
02051     return 0;
02052 }
02053 
02054 // lua : void OdeTriMeshRawDataPrint(cTriangleMeshRawData)
02055 static int l_OdeTriMeshRawDataPrint (lua_State *L) { PROFILE
02056     cTriangleMeshRawData *p = TRIMESHRAWDATAID(1);
02057     if(p)p->Print();
02058     return 0;
02059 }
02060 
02061 // lua : dTriMeshDataID OdeGeomTriMeshDataCreate(void) [ from ode ]
02062 static int l_OdeGeomTriMeshDataCreate (lua_State *L) { PROFILE
02063     PUSHUDATA( dGeomTriMeshDataCreate() );
02064     return 1;
02065 }
02066 
02067 
02068 // lua : void OdeGeomTriMeshDataDestroy(dTriMeshDataID g) [ from ode ]
02069 static int l_OdeGeomTriMeshDataDestroy (lua_State *L) { PROFILE
02070     dGeomTriMeshDataDestroy(TRIMESHDATAID(1));
02071     return 0;
02072 }
02073 
02074 
02075 // lua : void OdeGeomTriMeshDataSet(dTriMeshDataID g, int data_id, void* in_data) [ from ode ]
02076 static int l_OdeGeomTriMeshDataSet (lua_State *L) { PROFILE
02077     // TODO dGeomTriMeshDataSet(dTriMeshDataID g, int data_id, void* in_data);
02078     return 0;
02079 }
02080 
02081 
02082 // lua : void* OdeGeomTriMeshDataGet(dTriMeshDataID g, int data_id) [ from ode ]
02083 static int l_OdeGeomTriMeshDataGet (lua_State *L) { PROFILE
02084     // TODO dGeomTriMeshDataGet(dTriMeshDataID g, int data_id);
02085     return 0;
02086 }
02087 
02093 // lua : void OdeGeomTriMeshSetLastTransform( dGeomID g, dMatrix4 last_trans ) [ from ode ]
02094 static int l_OdeGeomTriMeshSetLastTransform (lua_State *L) { PROFILE
02095     // TODO dGeomTriMeshSetLastTransform( dGeomID g, dMatrix4 last_trans );
02096     return 0;
02097 }
02098 
02099 
02100 // lua : dReal* OdeGeomTriMeshGetLastTransform( dGeomID g ) [ from ode ]
02101 static int l_OdeGeomTriMeshGetLastTransform (lua_State *L) { PROFILE
02102     // TODO dGeomTriMeshGetLastTransform( dGeomID g );
02103     return 0;
02104 }
02105 
02106 /*
02107  * Build TriMesh data with single precision used in vertex data .
02108  */
02109 // lua : void OdeGeomTriMeshDataBuildSingle(dTriMeshDataID g,const void* Vertices, int VertexStride, int VertexCount,const void* Indices, int IndexCount, int TriStride) [ from ode ]
02110 static int l_OdeGeomTriMeshDataBuildSingle (lua_State *L) { PROFILE
02111     // TODO dGeomTriMeshDataBuildSingle(dTriMeshDataID g,const void* Vertices, int VertexStride, int VertexCount,const void* Indices, int IndexCount, int TriStride);
02112     return 0;
02113 }
02114 
02115 /* same again with a normals array (used as trimesh-trimesh optimization) */
02116 // lua : void OdeGeomTriMeshDataBuildSingle1(dTriMeshDataID g,const void* Vertices, int VertexStride, int VertexCount,const void* Indices, int IndexCount, int TriStride,const void* Normals) [ from ode ]
02117 static int l_OdeGeomTriMeshDataBuildSingle1 (lua_State *L) { PROFILE
02118     // TODO dGeomTriMeshDataBuildSingle1(dTriMeshDataID g,const void* Vertices, int VertexStride, int VertexCount,const void* Indices, int IndexCount, int TriStride,const void* Normals);
02119     return 0;
02120 }
02121 
02122 /*
02123 * Build TriMesh data with double pricision used in vertex data .
02124 */
02125 // lua : void OdeGeomTriMeshDataBuildDouble(dTriMeshDataID g,const void* Vertices,  int VertexStride, int VertexCount,const void* Indices, int IndexCount, int TriStride) [ from ode ]
02126 static int l_OdeGeomTriMeshDataBuildDouble (lua_State *L) { PROFILE
02127     // TODO dGeomTriMeshDataBuildDouble(dTriMeshDataID g,const void* Vertices,  int VertexStride, int VertexCount,const void* Indices, int IndexCount, int TriStride);
02128     return 0;
02129 }
02130 
02131 /* same again with a normals array (used as trimesh-trimesh optimization) */
02132 // lua : void OdeGeomTriMeshDataBuildDouble1(dTriMeshDataID g,const void* Vertices,  int VertexStride, int VertexCount,const void* Indices, int IndexCount, int TriStride,const void* Normals) [ from ode ]
02133 static int l_OdeGeomTriMeshDataBuildDouble1 (lua_State *L) { PROFILE
02134     // TODO dGeomTriMeshDataBuildDouble1(dTriMeshDataID g,const void* Vertices,  int VertexStride, int VertexCount,const void* Indices, int IndexCount, int TriStride,const void* Normals);
02135     return 0;
02136 }
02137 
02138 /*
02139  * Simple build. Single/double precision based on dSINGLE/dDOUBLE!
02140 
02141   void dGeomTriMeshDataBuildSingle1(dTriMeshDataID g,
02142                                   const void* Vertices, int VertexStride, int VertexCount,
02143                                   const void* Indices, int IndexCount, int TriStride,
02144                                   const void* Normals)
02145 */
02146 // lua : void OdeGeomTriMeshDataBuildFromRaw(dTriMeshDataID g,cTriangleMeshRawData)
02147 static int l_OdeGeomTriMeshDataBuildFromRaw (lua_State *L) { PROFILE
02148     cTriangleMeshRawData *p = TRIMESHRAWDATAID(2);
02149     if(p){
02150 #ifdef dSINGLE
02151         dGeomTriMeshDataBuildSingle1(TRIMESHDATAID(1),
02152             p->mVertexData, sizeof(dVector3), p->miVertexes, 
02153             p->mIndicesData, p->miIndices, 3 * sizeof(unsigned int),
02154             0
02155         );
02156 #else
02157         dGeomTriMeshDataBuildDouble1(TRIMESHDATAID(1),
02158             p->mVertexData, 3 * sizeof(dReal), p->miVertexes, 
02159             p->mIndicesData, p->miIndices, 3 * sizeof(unsigned int),
02160             0
02161         );
02162 #endif
02163     }
02164     return 0;
02165 }
02166 
02167 /* same again with a normals array (used as trimesh-trimesh optimization) */
02168 // lua : void OdeGeomTriMeshDataBuildSimple1(dTriMeshDataID g,const dReal* Vertices, int VertexCount,const int* Indices, int IndexCount,const int* Normals) [ from ode ]
02169 static int l_OdeGeomTriMeshDataBuildSimple1 (lua_State *L) { PROFILE
02170     // TODO dGeomTriMeshDataBuildSimple1(dTriMeshDataID g,const dReal* Vertices, int VertexCount,const int* Indices, int IndexCount,const int* Normals);
02171     return 0;
02172 }
02173 
02174 /* Preprocess the trimesh data to remove mark unnecessary edges and vertices */
02175 // lua : void OdeGeomTriMeshDataPreprocess(dTriMeshDataID g) [ from ode ]
02176 static int l_OdeGeomTriMeshDataPreprocess (lua_State *L) { PROFILE
02177     // TODO dGeomTriMeshDataPreprocess(dTriMeshDataID g);
02178     return 0;
02179 }
02180 
02181 /* Get and set the internal preprocessed trimesh data buffer, for loading and saving */
02182 // lua : void OdeGeomTriMeshDataGetBuffer(dTriMeshDataID g, unsigned char** buf, int* bufLen) [ from ode ]
02183 static int l_OdeGeomTriMeshDataGetBuffer (lua_State *L) { PROFILE
02184     // TODO dGeomTriMeshDataGetBuffer(dTriMeshDataID g, unsigned char** buf, int* bufLen);
02185     return 0;
02186 }
02187 
02188 
02189 // lua : void OdeGeomTriMeshDataSetBuffer(dTriMeshDataID g, unsigned char* buf) [ from ode ]
02190 static int l_OdeGeomTriMeshDataSetBuffer (lua_State *L) { PROFILE
02191     // TODO dGeomTriMeshDataSetBuffer(dTriMeshDataID g, unsigned char* buf);
02192     return 0;
02193 }
02194 
02195 
02196 // lua : void OdeGeomTriMeshSetCallback(dGeomID g, dTriCallback* Callback) [ from ode ]
02197 static int l_OdeGeomTriMeshSetCallback (lua_State *L) { PROFILE
02198     // TODO dGeomTriMeshSetCallback(dGeomID g, dTriCallback* Callback);
02199     return 0;
02200 }
02201 
02202 
02203 // lua : dTriCallback* OdeGeomTriMeshGetCallback(dGeomID g) [ from ode ]
02204 static int l_OdeGeomTriMeshGetCallback (lua_State *L) { PROFILE
02205     // TODO dGeomTriMeshGetCallback(dGeomID g);
02206     return 0;
02207 }
02208 
02209 
02210 // lua : void OdeGeomTriMeshSetArrayCallback(dGeomID g, dTriArrayCallback* ArrayCallback) [ from ode ]
02211 static int l_OdeGeomTriMeshSetArrayCallback (lua_State *L) { PROFILE
02212     // TODO dGeomTriMeshSetArrayCallback(dGeomID g, dTriArrayCallback* ArrayCallback);
02213     return 0;
02214 }
02215 
02216 
02217 // lua : dTriArrayCallback* OdeGeomTriMeshGetArrayCallback(dGeomID g) [ from ode ]
02218 static int l_OdeGeomTriMeshGetArrayCallback (lua_State *L) { PROFILE
02219     // TODO dGeomTriMeshGetArrayCallback(dGeomID g);
02220     return 0;
02221 }
02222 
02223 
02224 // lua : void OdeGeomTriMeshSetRayCallback(dGeomID g, dTriRayCallback* Callback) [ from ode ]
02225 static int l_OdeGeomTriMeshSetRayCallback (lua_State *L) { PROFILE
02226     // TODO dGeomTriMeshSetRayCallback(dGeomID g, dTriRayCallback* Callback);
02227     return 0;
02228 }
02229 
02230 
02231 // lua : dTriRayCallback* OdeGeomTriMeshGetRayCallback(dGeomID g) [ from ode ]
02232 static int l_OdeGeomTriMeshGetRayCallback (lua_State *L) { PROFILE
02233     // TODO dGeomTriMeshGetRayCallback(dGeomID g);
02234     return 0;
02235 }
02236 
02237 /*
02238  * Trimesh class
02239  * Construction. Callbacks are optional.
02240  */
02241 // lua : dGeomID OdeCreateTriMesh(dSpaceID space, dTriMeshDataID Data)
02242 // UNUSED, dTriCallback* Callback, dTriArrayCallback* ArrayCallback, dTriRayCallback* RayCallback) [ from ode ]
02243 static int l_OdeCreateTriMesh (lua_State *L) { PROFILE
02244     PUSHUDATA( dCreateTriMesh(SPACEID(1), TRIMESHDATAID(2), 0,0,0) );
02245     // dTriCallback* Callback, dTriArrayCallback* ArrayCallback, dTriRayCallback* RayCallback);
02246     return 1;
02247 }
02248 
02249 
02250 // lua : void OdeGeomTriMeshSetData(dGeomID g, dTriMeshDataID Data) [ from ode ]
02251 static int l_OdeGeomTriMeshSetData (lua_State *L) { PROFILE
02252     // TODO dGeomTriMeshSetData(dGeomID g, dTriMeshDataID Data);
02253     return 0;
02254 }
02255 
02256 
02257 // lua : dTriMeshDataID OdeGeomTriMeshGetData(dGeomID g) [ from ode ]
02258 static int l_OdeGeomTriMeshGetData (lua_State *L) { PROFILE
02259     // TODO dGeomTriMeshGetData(dGeomID g);
02260     return 0;
02261 }
02262 
02263 // enable/disable/check temporal coherence
02264 // lua : void OdeGeomTriMeshEnableTC(dGeomID g, int geomClass, int enable) [ from ode ]
02265 static int l_OdeGeomTriMeshEnableTC (lua_State *L) { PROFILE
02266     // TODO dGeomTriMeshEnableTC(dGeomID g, int geomClass, int enable);
02267     return 0;
02268 }
02269 
02270 
02271 // lua : int OdeGeomTriMeshIsTCEnabled(dGeomID g, int geomClass) [ from ode ]
02272 static int l_OdeGeomTriMeshIsTCEnabled (lua_State *L) { PROFILE
02273     // TODO dGeomTriMeshIsTCEnabled(dGeomID g, int geomClass);
02274     return 0;
02275 }
02276 
02277 /*
02278  * Clears the internal temporal coherence caches. When a geom has its
02279  * collision checked with a trimesh once, data is stored inside the trimesh.
02280  * With large worlds with lots of seperate objects this list could get huge.
02281  * We should be able to do this automagically.
02282  */
02283 // lua : void OdeGeomTriMeshClearTCCache(dGeomID g) [ from ode ]
02284 static int l_OdeGeomTriMeshClearTCCache (lua_State *L) { PROFILE
02285     // TODO dGeomTriMeshClearTCCache(dGeomID g);
02286     return 0;
02287 }
02288 
02289 /*
02290  * returns the TriMeshDataID
02291  */
02292 // lua : dTriMeshDataID OdeGeomTriMeshGetTriMeshDataID(dGeomID g) [ from ode ]
02293 static int l_OdeGeomTriMeshGetTriMeshDataID (lua_State *L) { PROFILE
02294     // TODO dGeomTriMeshGetTriMeshDataID(dGeomID g);
02295     return 0;
02296 }
02297 
02298 /*
02299  * Gets a triangle.
02300  */
02301 // lua : void OdeGeomTriMeshGetTriangle(dGeomID g, int Index, dVector3* v0, dVector3* v1, dVector3* v2) [ from ode ]
02302 static int l_OdeGeomTriMeshGetTriangle (lua_State *L) { PROFILE
02303     // TODO dGeomTriMeshGetTriangle(dGeomID g, int Index, dVector3* v0, dVector3* v1, dVector3* v2);
02304     return 0;
02305 }
02306 
02307 /*
02308  * Gets the point on the requested triangle and the given barycentric
02309  * coordinates.
02310  */
02311 // lua : void OdeGeomTriMeshGetPoint(dGeomID g, int Index, dReal u, dReal v, dVector3 Out) [ from ode ]
02312 static int l_OdeGeomTriMeshGetPoint (lua_State *L) { PROFILE
02313     // TODO dGeomTriMeshGetPoint(dGeomID g, int Index, dReal u, dReal v, dVector3 Out);
02314     return 0;
02315 }
02316 
02317 // lua : int OdeGeomTriMeshGetTriangleCount(dGeomID g) [ from ode ]
02318 static int l_OdeGeomTriMeshGetTriangleCount (lua_State *L) { PROFILE
02319     // TODO dGeomTriMeshGetTriangleCount(dGeomID g);
02320     return 0;
02321 }
02322 
02323 
02324 // lua : void OdeGeomTriMeshDataUpdate(dTriMeshDataID g) [ from ode ]
02325 static int l_OdeGeomTriMeshDataUpdate (lua_State *L) { PROFILE
02326     // TODO dGeomTriMeshDataUpdate(dTriMeshDataID g);
02327     return 0;
02328 }
02329 
02330 
02331 // lua : udata OdeMassCreate()
02332 static int l_OdeMassCreate (lua_State *L) { PROFILE
02333     PUSHUDATA( new dMass );
02334     return 1;
02335 }
02336 
02337 // lua : void OdeMassDestroy(udata)
02338 static int l_OdeMassDestroy (lua_State *L) { PROFILE
02339     dMass *p = MASSID(1);
02340     if(p)delete p;
02341     return 0;
02342 }
02343 
02344 
02345 
02354 // lua : int OdeMassCheck(const dMass *m) [ from ode ]
02355 static int l_OdeMassCheck (lua_State *L) { PROFILE
02356     PUSHNUMBER( dMassCheck(MASSID(1)) );
02357     return 1;
02358 }
02359 
02360 
02361 // lua : void OdeMassSetZero(dMass *) [ from ode ]
02362 static int l_OdeMassSetZero (lua_State *L) { PROFILE
02363     dMassSetZero(MASSID(1));
02364     return 0;
02365 }
02366 
02367 
02368 // lua : void OdeMassSetParameters(dMass *, dReal themass,dReal cgx, dReal cgy, dReal cgz,dReal I11, dReal I22, dReal I33,dReal I12, dReal I13, dReal I23) [ from ode ]
02369 static int l_OdeMassSetParameters (lua_State *L) { PROFILE
02370     // TODO I.. parts could be a problem due to axis exchangement dMassSetParameters(MASSID(1), GETNUMBER(2), GETVEC(3), GETLIST3(3), GETLIST3(3));
02371     return 0;
02372 }
02373 
02374 
02375 // lua : void OdeMassSetSphere(dMass *, dReal density, dReal radius) [ from ode ]
02376 static int l_OdeMassSetSphere (lua_State *L) { PROFILE
02377     dMassSetSphere(MASSID(1), GETNUMBER(2), GETNUMBER(3));
02378     return 0;
02379 }
02380 
02381 
02382 // lua : void OdeMassSetSphereTotal(dMass *, dReal total_mass, dReal radius) [ from ode ]
02383 static int l_OdeMassSetSphereTotal (lua_State *L) { PROFILE
02384     dMassSetSphereTotal(MASSID(1), GETNUMBER(2), GETNUMBER(3));
02385     return 0;
02386 }
02387 
02388 
02389 // lua : void OdeMassSetCapsule(dMass *, dReal density, int direction,dReal radius, dReal length) [ from ode ]
02390 static int l_OdeMassSetCapsule (lua_State *L) { PROFILE
02391     dMassSetCapsule(MASSID(1), GETNUMBER(2), GETINT(3), GETNUMBER(4), GETNUMBER(5));
02392     return 0;
02393 }
02394 
02395 
02396 // lua : void OdeMassSetCapsuleTotal(dMass *, dReal total_mass, int direction,dReal radius, dReal length) [ from ode ]
02397 static int l_OdeMassSetCapsuleTotal (lua_State *L) { PROFILE
02398     dMassSetCapsuleTotal(MASSID(1), GETNUMBER(2), GETINT(3), GETNUMBER(4), GETNUMBER(5));
02399     return 0;
02400 }
02401 
02402 
02403 // lua : void OdeMassSetCylinder(dMass *, dReal density, int direction,dReal radius, dReal length) [ from ode ]
02404 static int l_OdeMassSetCylinder (lua_State *L) { PROFILE
02405     dMassSetCylinder(MASSID(1), GETNUMBER(2), GETINT(3), GETNUMBER(4), GETNUMBER(5));
02406     return 0;
02407 }
02408 
02409 
02410 // lua : void OdeMassSetCylinderTotal(dMass *, dReal total_mass, int direction,dReal radius, dReal length) [ from ode ]
02411 static int l_OdeMassSetCylinderTotal (lua_State *L) { PROFILE
02412     dMassSetCylinderTotal(MASSID(1), GETNUMBER(2), GETINT(3), GETNUMBER(4), GETNUMBER(5));
02413     return 0;
02414 }
02415 
02416 
02417 // lua : void OdeMassSetBox(dMass *, dReal density,dReal lx, dReal ly, dReal lz) [ from ode ]
02418 static int l_OdeMassSetBox (lua_State *L) { PROFILE
02419     dMassSetBox(MASSID(1), GETNUMBER(2), GETNUMBER(3), GETNUMBER(4), GETNUMBER(5));
02420     return 0;
02421 }
02422 
02423 
02424 // lua : void OdeMassSetBoxTotal(dMass *, dReal total_mass,dReal lx, dReal ly, dReal lz) [ from ode ]
02425 static int l_OdeMassSetBoxTotal (lua_State *L) { PROFILE
02426     dMassSetBoxTotal(MASSID(1), GETNUMBER(2), GETNUMBER(3), GETNUMBER(4), GETNUMBER(5));
02427     return 0;
02428 }
02429 
02430 
02431 // lua : void OdeMassSetTrimesh(dMass *, dReal density, dGeomID g) [ from ode ]
02432 static int l_OdeMassSetTrimesh (lua_State *L) { PROFILE
02433     dMassSetTrimesh(MASSID(1), GETNUMBER(2), GEOMID(3));
02434     return 0;
02435 }
02436 
02437 
02438 // lua : void OdeMassAdjust(dMass *, dReal newmass) [ from ode ]
02439 static int l_OdeMassAdjust (lua_State *L) { PROFILE
02440     dMassAdjust(MASSID(1), GETNUMBER(2));
02441     return 0;
02442 }
02443 
02444 
02445 // lua : void OdeMassTranslate(dMass *, dReal x, dReal y, dReal z) [ from ode ]
02446 static int l_OdeMassTranslate (lua_State *L) { PROFILE
02447     dMassTranslate(MASSID(1), GETVEC(2));
02448     return 0;
02449 }
02450 
02451 
02452 // lua : void OdeMassAdd(dMass *a, const dMass *b) [ from ode ]
02453 static int l_OdeMassAdd (lua_State *L) { PROFILE
02454     dMassAdd(MASSID(1), MASSID(2));
02455     return 0;
02456 }
02457 
02458 // lua : udata l_OdeWorldCreate() [ from ode ]
02459 static int l_OdeWorldCreate (lua_State *L) { PROFILE
02460     PUSHUDATA( dWorldCreate() );
02461     return 1;
02462 }
02463 
02473 // lua : void OdeWorldDestroy(dWorldID world) [ from ode ]
02474 static int l_OdeWorldDestroy (lua_State *L) { PROFILE
02475     dWorldDestroy(WORLDID(1));
02476     return 0;
02477 }
02478 
02487 // lua : void OdeWorldSetGravity(dWorldID, dReal x, dReal y, dReal z) [ from ode ]
02488 static int l_OdeWorldSetGravity (lua_State *L) { PROFILE
02489     dWorldSetGravity(WORLDID(1), GETVEC(2));
02490     return 0;
02491 }
02492 
02497 // lua : void OdeWorldGetGravity(dWorldID, dVector3 gravity) [ from ode ]
02498 static int l_OdeWorldGetGravity (lua_State *L) { PROFILE
02499     dVector3 gravity;
02500     dWorldGetGravity(WORLDID(1), gravity);
02501     PUSHVEC(gravity);
02502     return 3;
02503 }
02504 
02512 // lua : void OdeWorldSetERP(dWorldID, dReal erp) [ from ode ]
02513 static int l_OdeWorldSetERP (lua_State *L) { PROFILE
02514     dWorldSetERP(WORLDID(1), GETNUMBER(2));
02515     return 0;
02516 }
02517 
02523 // lua : dReal OdeWorldGetERP(dWorldID) [ from ode ]
02524 static int l_OdeWorldGetERP (lua_State *L) { PROFILE
02525     PUSHNUMBER( dWorldGetERP(WORLDID(1)) );
02526     return 1;
02527 }
02528 
02536 // lua : void OdeWorldSetCFM(dWorldID, dReal cfm) [ from ode ]
02537 static int l_OdeWorldSetCFM (lua_State *L) { PROFILE
02538     dWorldSetCFM(WORLDID(1), GETNUMBER(2));
02539     return 0;
02540 }
02541 
02547 // lua : dReal OdeWorldGetCFM(dWorldID) [ from ode ]
02548 static int l_OdeWorldGetCFM (lua_State *L) { PROFILE
02549     PUSHNUMBER( dWorldGetCFM(WORLDID(1)));
02550     return 1;
02551 }
02552 
02563 // lua : void OdeWorldStep(dWorldID, dReal stepsize) [ from ode ]
02564 static int l_OdeWorldStep (lua_State *L) { PROFILE
02565     dWorldStep(WORLDID(1), GETNUMBER(2));
02566     return 0;
02567 }
02568 
02583 // lua : void OdeWorldImpulseToForce(dWorldID, dReal stepsize,dReal ix, dReal iy, dReal iz, dVector3 force) [ from ode ]
02584 static int l_OdeWorldImpulseToForce (lua_State *L) { PROFILE
02585     dVector3 force;
02586     dWorldImpulseToForce(WORLDID(1), GETNUMBER(2), GETVEC(3), force);
02587     PUSHVEC(force);
02588     return 3;
02589 }
02590 
02622 // lua : void OdeWorldQuickStep(dWorldID w, dReal stepsize) [ from ode ]
02623 static int l_OdeWorldQuickStep (lua_State *L) { PROFILE
02624     dWorldQuickStep(WORLDID(1), GETNUMBER(2));
02625     return 0;
02626 }
02627 
02637 // lua : void OdeWorldSetQuickStepNumIterations(dWorldID, int num) [ from ode ]
02638 static int l_OdeWorldSetQuickStepNumIterations (lua_State *L) { PROFILE
02639     dWorldSetQuickStepNumIterations(WORLDID(1), GETINT(2));
02640     return 0;
02641 }
02642 
02649 // lua : int OdeWorldGetQuickStepNumIterations(dWorldID) [ from ode ]
02650 static int l_OdeWorldGetQuickStepNumIterations (lua_State *L) { PROFILE
02651     PUSHNUMBER( dWorldGetQuickStepNumIterations(WORLDID(1)) );
02652     return 1;
02653 }
02654 
02660 // lua : void OdeWorldSetQuickStepW(dWorldID, dReal over_relaxation) [ from ode ]
02661 static int l_OdeWorldSetQuickStepW (lua_State *L) { PROFILE
02662     dWorldSetQuickStepW(WORLDID(1), GETNUMBER(2));
02663     return 0;
02664 }
02665 
02671 // lua : dReal OdeWorldGetQuickStepW(dWorldID) [ from ode ]
02672 static int l_OdeWorldGetQuickStepW (lua_State *L) { PROFILE
02673     PUSHNUMBER( dWorldGetQuickStepW(WORLDID(1)) );
02674     return 1;
02675 }
02676 
02677 /* World contact parameter functions */
02678 
02687 // lua : void OdeWorldSetContactMaxCorrectingVel(dWorldID, dReal vel) [ from ode ]
02688 static int l_OdeWorldSetContactMaxCorrectingVel (lua_State *L) { PROFILE
02689     dWorldSetContactMaxCorrectingVel(WORLDID(1), GETNUMBER(2));
02690     return 0;
02691 }
02692 
02698 // lua : dReal OdeWorldGetContactMaxCorrectingVel(dWorldID) [ from ode ]
02699 static int l_OdeWorldGetContactMaxCorrectingVel (lua_State *L) { PROFILE
02700     PUSHNUMBER( dWorldGetContactMaxCorrectingVel(WORLDID(1)) );
02701     return 1;
02702 }
02703 
02715 // lua : void OdeWorldSetContactSurfaceLayer(dWorldID, dReal depth) [ from ode ]
02716 static int l_OdeWorldSetContactSurfaceLayer (lua_State *L) { PROFILE
02717     dWorldSetContactSurfaceLayer(WORLDID(1), GETNUMBER(2));
02718     return 0;
02719 }
02720 
02726 // lua : dReal OdeWorldGetContactSurfaceLayer(dWorldID) [ from ode ]
02727 static int l_OdeWorldGetContactSurfaceLayer (lua_State *L) { PROFILE
02728     PUSHNUMBER( dWorldGetContactSurfaceLayer(WORLDID(1)) );
02729     return 1;
02730 }
02731 
02732 /* StepFast1 functions */
02733 
02740 // lua : void OdeWorldStepFast1(dWorldID, dReal stepsize, int maxiterations) [ from ode ]
02741 static int l_OdeWorldStepFast1 (lua_State *L) { PROFILE
02742     dWorldStepFast1(WORLDID(1), GETNUMBER(2), GETINT(3));
02743     return 0;
02744 }
02745 
02781 // lua : void OdeWorldSetAutoEnableDepthSF1(dWorldID, int autoEnableDepth) [ from ode ]
02782 static int l_OdeWorldSetAutoEnableDepthSF1 (lua_State *L) { PROFILE
02783     dWorldSetAutoEnableDepthSF1(WORLDID(1), GETINT(2));
02784     return 0;
02785 }
02786 
02791 // lua : int OdeWorldGetAutoEnableDepthSF1(dWorldID) [ from ode ]
02792 static int l_OdeWorldGetAutoEnableDepthSF1 (lua_State *L) { PROFILE
02793     PUSHNUMBER( dWorldGetAutoEnableDepthSF1(WORLDID(1)) );
02794     return 1;
02795 }
02796 
02802 // lua : dReal OdeWorldGetAutoDisableLinearThreshold(dWorldID) [ from ode ]
02803 static int l_OdeWorldGetAutoDisableLinearThreshold (lua_State *L) { PROFILE
02804     PUSHNUMBER( dWorldGetAutoDisableLinearThreshold(WORLDID(1)) );
02805     return 0;
02806 }
02807 
02813 // lua : void OdeWorldSetAutoDisableLinearThreshold(dWorldID, dReal linear_threshold) [ from ode ]
02814 static int l_OdeWorldSetAutoDisableLinearThreshold (lua_State *L) { PROFILE
02815     dWorldSetAutoDisableLinearThreshold(WORLDID(1), GETNUMBER(2));
02816     return 0;
02817 }
02818 
02824 // lua : dReal OdeWorldGetAutoDisableAngularThreshold(dWorldID) [ from ode ]
02825 static int l_OdeWorldGetAutoDisableAngularThreshold (lua_State *L) { PROFILE
02826     PUSHNUMBER( dWorldGetAutoDisableAngularThreshold(WORLDID(1)) );
02827     return 1;
02828 }
02829 
02835 // lua : void OdeWorldSetAutoDisableAngularThreshold(dWorldID, dReal angular_threshold) [ from ode ]
02836 static int l_OdeWorldSetAutoDisableAngularThreshold (lua_State *L) { PROFILE
02837     dWorldSetAutoDisableAngularThreshold(WORLDID(1), GETNUMBER(2));
02838     return 0;
02839 }
02840 
02846 // lua : dReal OdeWorldGetAutoDisableLinearAverageThreshold(dWorldID) [ from ode ]
02847 static int l_OdeWorldGetAutoDisableLinearAverageThreshold (lua_State *L) { PROFILE
02848     // TODO PUSHNUMBER( dWorldGetAutoDisableLinearAverageThreshold(WORLDID(1)) );
02849     return 1;
02850 }
02851 
02857 // lua : void OdeWorldSetAutoDisableLinearAverageThreshold(dWorldID, dReal linear_average_threshold) [ from ode ]
02858 static int l_OdeWorldSetAutoDisableLinearAverageThreshold (lua_State *L) { PROFILE
02859     // TODO dWorldSetAutoDisableLinearAverageThreshold(WORLDID(1), GETNUMBER(2));
02860     return 0;
02861 }
02862 
02868 // lua : dReal OdeWorldGetAutoDisableAngularAverageThreshold(dWorldID) [ from ode ]
02869 static int l_OdeWorldGetAutoDisableAngularAverageThreshold (lua_State *L) { PROFILE
02870     // TODO PUSHNUMBER( dWorldGetAutoDisableAngularAverageThreshold(WORLDID(1)) );
02871     return 1;
02872 }
02873 
02879 // lua : void OdeWorldSetAutoDisableAngularAverageThreshold(dWorldID, dReal angular_average_threshold) [ from ode ]
02880 static int l_OdeWorldSetAutoDisableAngularAverageThreshold (lua_State *L) { PROFILE
02881     // TODO dWorldSetAutoDisableAngularAverageThreshold(WORLDID(1), GETNUMBER(2));
02882     return 0;
02883 }
02884 
02890 // lua : int OdeWorldGetAutoDisableAverageSamplesCount(dWorldID) [ from ode ]
02891 static int l_OdeWorldGetAutoDisableAverageSamplesCount (lua_State *L) { PROFILE
02892     PUSHNUMBER( dWorldGetAutoDisableAverageSamplesCount(WORLDID(1)) );
02893     return 1;
02894 }
02895 
02902 // lua : void OdeWorldSetAutoDisableAverageSamplesCount(dWorldID, unsigned int average_samples_count ) [ from ode ]
02903 static int l_OdeWorldSetAutoDisableAverageSamplesCount (lua_State *L) { PROFILE
02904     dWorldSetAutoDisableAverageSamplesCount(WORLDID(1), GETUINT(2));
02905     return 0;
02906 }
02907 
02913 // lua : int OdeWorldGetAutoDisableSteps(dWorldID) [ from ode ]
02914 static int l_OdeWorldGetAutoDisableSteps (lua_State *L) { PROFILE
02915     PUSHNUMBER( dWorldGetAutoDisableSteps(WORLDID(1)) );
02916     return 1;
02917 }
02918 
02924 // lua : void OdeWorldSetAutoDisableSteps(dWorldID, int steps) [ from ode ]
02925 static int l_OdeWorldSetAutoDisableSteps (lua_State *L) { PROFILE
02926     dWorldSetAutoDisableSteps(WORLDID(1), GETINT(2));
02927     return 0;
02928 }
02929 
02935 // lua : dReal OdeWorldGetAutoDisableTime(dWorldID) [ from ode ]
02936 static int l_OdeWorldGetAutoDisableTime (lua_State *L) { PROFILE
02937     PUSHNUMBER( dWorldGetAutoDisableTime(WORLDID(1)) );
02938     return 1;
02939 }
02940 
02946 // lua : void OdeWorldSetAutoDisableTime(dWorldID, dReal time) [ from ode ]
02947 static int l_OdeWorldSetAutoDisableTime (lua_State *L) { PROFILE
02948     dWorldSetAutoDisableTime(WORLDID(1), GETNUMBER(2));
02949     return 0;
02950 }
02951 
02957 // lua : int OdeWorldGetAutoDisableFlag(dWorldID) [ from ode ]
02958 static int l_OdeWorldGetAutoDisableFlag (lua_State *L) { PROFILE
02959     PUSHNUMBER( dWorldGetAutoDisableFlag(WORLDID(1)) );
02960     return 1;
02961 }
02962 
02968 // lua : void OdeWorldSetAutoDisableFlag(dWorldID, int do_auto_disable) [ from ode ]
02969 static int l_OdeWorldSetAutoDisableFlag (lua_State *L) { PROFILE
02970     dWorldSetAutoDisableFlag(WORLDID(1), GETINT(2));
02971     return 0;
02972 }
02973 
03013 // lua : dReal OdeBodyGetAutoDisableLinearThreshold(dBodyID) [ from ode ]
03014 static int l_OdeBodyGetAutoDisableLinearThreshold (lua_State *L) { PROFILE
03015     PUSHNUMBER( dBodyGetAutoDisableLinearThreshold(BODYID(1)) );
03016     return 1;
03017 }
03018 
03024 // lua : void OdeBodySetAutoDisableLinearThreshold(dBodyID, dReal linear_average_threshold) [ from ode ]
03025 static int l_OdeBodySetAutoDisableLinearThreshold (lua_State *L) { PROFILE
03026     dBodySetAutoDisableLinearThreshold(BODYID(1), GETNUMBER(2));
03027     return 0;
03028 }
03029 
03035 // lua : dReal OdeBodyGetAutoDisableAngularThreshold(dBodyID) [ from ode ]
03036 static int l_OdeBodyGetAutoDisableAngularThreshold (lua_State *L) { PROFILE
03037     PUSHNUMBER( dBodyGetAutoDisableAngularThreshold(BODYID(1)) );
03038     return 1;
03039 }
03040 
03046 // lua : void OdeBodySetAutoDisableAngularThreshold(dBodyID, dReal angular_average_threshold) [ from ode ]
03047 static int l_OdeBodySetAutoDisableAngularThreshold (lua_State *L) { PROFILE
03048     dBodySetAutoDisableAngularThreshold(BODYID(1), GETNUMBER(2));
03049     return 0;
03050 }
03051 
03057 // lua : int OdeBodyGetAutoDisableAverageSamplesCount(dBodyID) [ from ode ]
03058 static int l_OdeBodyGetAutoDisableAverageSamplesCount (lua_State *L) { PROFILE
03059     PUSHNUMBER( dBodyGetAutoDisableAverageSamplesCount(BODYID(1)) );
03060     return 1;
03061 }
03062 
03068 // lua : void OdeBodySetAutoDisableAverageSamplesCount(dBodyID, unsigned int average_samples_count) [ from ode ]
03069 static int l_OdeBodySetAutoDisableAverageSamplesCount (lua_State *L) { PROFILE
03070     dBodySetAutoDisableAverageSamplesCount(BODYID(1), GETUINT(2));
03071     return 0;
03072 }
03073 
03079 // lua : int OdeBodyGetAutoDisableSteps(dBodyID) [ from ode ]
03080 static int l_OdeBodyGetAutoDisableSteps (lua_State *L) { PROFILE
03081     PUSHNUMBER( dBodyGetAutoDisableSteps(BODYID(1)) );
03082     return 1;
03083 }
03084 
03090 // lua : void OdeBodySetAutoDisableSteps(dBodyID, int steps) [ from ode ]
03091 static int l_OdeBodySetAutoDisableSteps (lua_State *L) { PROFILE
03092     dBodySetAutoDisableSteps(BODYID(1), GETINT(2));
03093     return 0;
03094 }
03095 
03101 // lua : dReal OdeBodyGetAutoDisableTime(dBodyID) [ from ode ]
03102 static int l_OdeBodyGetAutoDisableTime (lua_State *L) { PROFILE
03103     PUSHNUMBER( dBodyGetAutoDisableTime(BODYID(1)) );
03104     return 1;
03105 }
03106 
03112 // lua : void OdeBodySetAutoDisableTime(dBodyID, dReal time) [ from ode ]
03113 static int l_OdeBodySetAutoDisableTime (lua_State *L) { PROFILE
03114     dBodySetAutoDisableTime(BODYID(1), GETNUMBER(2));
03115     return 0;
03116 }
03117 
03123 // lua : int OdeBodyGetAutoDisableFlag(dBodyID) [ from ode ]
03124 static int l_OdeBodyGetAutoDisableFlag (lua_State *L) { PROFILE
03125     PUSHNUMBER( dBodyGetAutoDisableFlag(BODYID(1)) );
03126     return 1;
03127 }
03128 
03134 // lua : void OdeBodySetAutoDisableFlag(dBodyID, int do_auto_disable) [ from ode ]
03135 static int l_OdeBodySetAutoDisableFlag (lua_State *L) { PROFILE
03136     dBodySetAutoDisableFlag(BODYID(1), GETINT(2));
03137     return 0;
03138 }
03139 
03146 // lua : void OdeBodySetAutoDisableDefaults(dBodyID) [ from ode ]
03147 static int l_OdeBodySetAutoDisableDefaults (lua_State *L) { PROFILE
03148     dBodySetAutoDisableDefaults(BODYID(1));
03149     return 0;
03150 }
03151 
03158 // lua : dWorldID OdeBodyGetWorld(dBodyID) [ from ode ]
03159 static int l_OdeBodyGetWorld (lua_State *L) { PROFILE
03160     PUSHUDATA( dBodyGetWorld(BODYID(1)) );
03161     return 1;
03162 }
03163 
03170 // lua : dBodyID OdeBodyCreate(dWorldID) [ from ode ]
03171 static int l_OdeBodyCreate (lua_State *L) { PROFILE
03172     PUSHUDATA( dBodyCreate(WORLDID(1)) );
03173     return 1;
03174 }
03175 
03184 // lua : void OdeBodyDestroy(dBodyID) [ from ode ]
03185 static int l_OdeBodyDestroy (lua_State *L) { PROFILE
03186     dBodyDestroy(BODYID(1));
03187     return 0;
03188 }
03189 
03195 // lua : void OdeBodySetData(dBodyID, void *data) [ from ode ]
03196 static int l_OdeBodySetData (lua_State *L) { PROFILE
03197     dBodySetData(BODYID(1), GETUDATA(2));
03198     return 0;
03199 }
03200 
03206 // lua : void OdeBodyGetData(dBodyID) [ from ode ]
03207 static int l_OdeBodyGetData (lua_State *L) { PROFILE
03208     PUSHUDATA( dBodyGetData(BODYID(1)) );
03209     return 1;
03210 }
03211 
03220 // lua : void OdeBodySetPosition(dBodyID, dReal x, dReal y, dReal z) [ from ode ]
03221 static int l_OdeBodySetPosition (lua_State *L) { PROFILE
03222     dBodySetPosition(BODYID(1), GETVEC(2));
03223     return 0;
03224 }
03225 
03234 // lua : void OdeBodySetQuaternion(dBodyID, const dQuaternion q) [ from ode ]
03235 static int l_OdeBodySetQuaternion (lua_State *L) { PROFILE
03236     QUAT4(2,q);
03237     dBodySetQuaternion(BODYID(1), q);
03238     return 0;
03239 }
03240 
03245 // lua : void OdeBodySetLinearVel(dBodyID, dReal x, dReal y, dReal z) [ from ode ]
03246 static int l_OdeBodySetLinearVel (lua_State *L) { PROFILE
03247     dBodySetLinearVel(BODYID(1), GETVEC(2));
03248     return 0;
03249 }
03250 
03255 // lua : void OdeBodySetAngularVel(dBodyID, dReal x, dReal y, dReal z) [ from ode ]
03256 static int l_OdeBodySetAngularVel (lua_State *L) { PROFILE
03257     dBodySetAngularVel(BODYID(1), GETVEC(2));
03258     return 0;
03259 }
03260 
03270 // lua : x,y,z OdeBodyGetPosition(dBodyID) [ from ode ]
03271 static int l_OdeBodyGetPosition (lua_State *L) { PROFILE
03272     const dReal *x = dBodyGetPosition(BODYID(1));
03273     PUSHVEC(x);
03274     return 3;
03275 }
03276 
03277 
03283 // lua : w,x,y,z OdeBodyGetQuaternion(dBodyID) [ from ode ]
03284 static int l_OdeBodyGetQuaternion (lua_State *L) { PROFILE
03285     const dReal *x = dBodyGetQuaternion(BODYID(1));
03286     PUSHQUAT(x);
03287     return 4;
03288 }
03289 
03294 // lua : * OdeBodyGetLinearVel(dBodyID) [ from ode ]
03295 static int l_OdeBodyGetLinearVel (lua_State *L) { PROFILE
03296     const dReal *x = dBodyGetLinearVel(BODYID(1));
03297     PUSHVEC(x);
03298     return 3;
03299 }
03300 
03305 // lua : * OdeBodyGetAngularVel(dBodyID) [ from ode ]
03306 static int l_OdeBodyGetAngularVel (lua_State *L) { PROFILE
03307     const dReal *x = dBodyGetAngularVel(BODYID(1));
03308     PUSHVEC(x);
03309     return 3;   
03310 }
03311 
03316 // lua : void OdeBodySetMass(dBodyID, const dMass *mass) [ from ode ]
03317 static int l_OdeBodySetMass (lua_State *L) { PROFILE
03318     dBodySetMass(BODYID(1), MASSID(2));
03319     return 0;
03320 }
03321 
03326 // lua : void OdeBodyGetMass(dBodyID, dMass *mass) [ from ode ]
03327 static int l_OdeBodyGetMass (lua_State *L) { PROFILE
03328     dBodyGetMass(BODYID(1), MASSID(2));
03329     return 0;
03330 }
03331 
03336 // lua : void OdeBodyAddForce(dBodyID, dReal fx, dReal fy, dReal fz) [ from ode ]
03337 static int l_OdeBodyAddForce (lua_State *L) { PROFILE
03338     dBodyAddForce(BODYID(1), GETVEC(2));
03339     return 0;
03340 }
03341 
03346 // lua : void OdeBodyAddTorque(dBodyID, dReal fx, dReal fy, dReal fz) [ from ode ]
03347 static int l_OdeBodyAddTorque (lua_State *L) { PROFILE
03348     dBodyAddTorque(BODYID(1), GETVEC(2));
03349     return 0;
03350 }
03351 
03356 // lua : void OdeBodyAddRelForce(dBodyID, dReal fx, dReal fy, dReal fz) [ from ode ]
03357 static int l_OdeBodyAddRelForce (lua_State *L) { PROFILE
03358     dBodyAddRelForce(BODYID(1), GETVEC(2));
03359     return 0;
03360 }
03361 
03366 // lua : void OdeBodyAddRelTorque(dBodyID, dReal fx, dReal fy, dReal fz) [ from ode ]
03367 static int l_OdeBodyAddRelTorque (lua_State *L) { PROFILE
03368     dBodyAddRelTorque(BODYID(1), GETVEC(2));
03369     return 0;
03370 }
03371 
03376 // lua : void OdeBodyAddForceAtPos(dBodyID, dReal fx, dReal fy, dReal fz,dReal px, dReal py, dReal pz) [ from ode ]
03377 static int l_OdeBodyAddForceAtPos (lua_State *L) { PROFILE
03378     dBodyAddForceAtPos(BODYID(1), GETVEC(2), GETVEC(5));
03379     return 0;
03380 }
03381 
03386 // lua : void OdeBodyAddForceAtRelPos(dBodyID, dReal fx, dReal fy, dReal fz,dReal px, dReal py, dReal pz) [ from ode ]
03387 static int l_OdeBodyAddForceAtRelPos (lua_State *L) { PROFILE
03388     dBodyAddForceAtRelPos(BODYID(1), GETVEC(2), GETVEC(5));
03389     return 0;
03390 }
03391 
03396 // lua : void OdeBodyAddRelForceAtPos(dBodyID, dReal fx, dReal fy, dReal fz,dReal px, dReal py, dReal pz) [ from ode ]
03397 static int l_OdeBodyAddRelForceAtPos (lua_State *L) { PROFILE
03398     dBodyAddRelForceAtPos(BODYID(1), GETVEC(2), GETVEC(5));
03399     return 0;
03400 }
03401 
03406 // lua : void OdeBodyAddRelForceAtRelPos(dBodyID, dReal fx, dReal fy, dReal fz,dReal px, dReal py, dReal pz) [ from ode ]
03407 static int l_OdeBodyAddRelForceAtRelPos (lua_State *L) { PROFILE
03408     dBodyAddRelForceAtRelPos(BODYID(1), GETVEC(2), GETVEC(5));
03409     return 0;
03410 }
03411 
03421 // lua : fx,fy,fz OdeBodyGetForce(dBodyID) [ from ode ]
03422 static int l_OdeBodyGetForce (lua_State *L) { PROFILE
03423     const dReal *x = dBodyGetForce(BODYID(1));
03424     PUSHVEC(x);
03425     return 3;   
03426 }
03427 
03437 // lua : x,y,z OdeBodyGetTorque(dBodyID) [ from ode ]
03438 static int l_OdeBodyGetTorque (lua_State *L) { PROFILE
03439     const dReal *x = dBodyGetTorque(BODYID(1));
03440     PUSHVEC(x);
03441     return 3;
03442 }
03443 
03452 // lua : void OdeBodySetForce(dBodyID b, dReal x, dReal y, dReal z) [ from ode ]
03453 static int l_OdeBodySetForce (lua_State *L) { PROFILE
03454     dBodySetForce(BODYID(1), GETVEC(2));
03455     return 0;
03456 }
03457 
03466 // lua : void OdeBodySetTorque(dBodyID b, dReal x, dReal y, dReal z) [ from ode ]
03467 static int l_OdeBodySetTorque (lua_State *L) { PROFILE
03468     dBodySetTorque(BODYID(1), GETVEC(2));
03469     return 0;
03470 }
03471 
03477 // lua : x,y,z OdeBodyGetRelPointPos(dBodyID, dReal px, dReal py, dReal pz,dVector3 result) [ from ode ]
03478 static int l_OdeBodyGetRelPointPos (lua_State *L) { PROFILE
03479     dVector3 result;
03480     dBodyGetRelPointPos(BODYID(1), GETVEC(2),result);
03481     PUSHVEC(result);
03482     return 3;
03483 }
03484 
03490 // lua : x,y,z OdeBodyGetRelPointVel(dBodyID, dReal px, dReal py, dReal pz,dVector3 result) [ from ode ]
03491 static int l_OdeBodyGetRelPointVel (lua_State *L) { PROFILE
03492     dVector3 result;
03493     dBodyGetRelPointVel(BODYID(1), GETVEC(2),result);
03494     PUSHVEC(result);
03495     return 3;
03496 }
03497 
03504 // lua : x,y,z OdeBodyGetPointVel(dBodyID, dReal px, dReal py, dReal pz,dVector3 result) [ from ode ]
03505 static int l_OdeBodyGetPointVel (lua_State *L) { PROFILE
03506     dVector3 result;
03507     dBodyGetPointVel(BODYID(1), GETVEC(2),result);
03508     PUSHVEC(result);
03509     return 3;
03510 }
03511 
03520 // lua : x,y,z OdeBodyGetPosRelPoint(dBodyID, dReal px, dReal py, dReal pz,dVector3 result) [ from ode ]
03521 static int l_OdeBodyGetPosRelPoint (lua_State *L) { PROFILE
03522     dVector3 result;
03523     dBodyGetPosRelPoint(BODYID(1), GETVEC(2),result);
03524     PUSHVEC(result);
03525     return 3;
03526 }
03527 
03533 // lua : x,y,z OdeBodyVectorToWorld(dBodyID, dReal px, dReal py, dReal pz,dVector3 result) [ from ode ]
03534 static int l_OdeBodyVectorToWorld (lua_State *L) { PROFILE
03535     dVector3 result;
03536     dBodyVectorToWorld(BODYID(1), GETVEC(2),result);
03537     PUSHVEC(result);
03538     return 3;
03539 }
03540 
03546 // lua : x,y,z OdeBodyVectorFromWorld(dBodyID, dReal px, dReal py, dReal pz,dVector3 result) [ from ode ]
03547 static int l_OdeBodyVectorFromWorld (lua_State *L) { PROFILE
03548     dVector3 result;
03549     dBodyVectorFromWorld(BODYID(1), GETVEC(2),result);
03550     PUSHVEC(result);
03551     return 3;
03552 }
03553 
03571 // lua : void OdeBodySetFiniteRotationMode(dBodyID, int mode) [ from ode ]
03572 static int l_OdeBodySetFiniteRotationMode (lua_State *L) { PROFILE
03573     dBodySetFiniteRotationMode(BODYID(1), GETINT(2));
03574     return 0;
03575 }
03576 
03593 // lua : void OdeBodySetFiniteRotationAxis(dBodyID, dReal x, dReal y, dReal z) [ from ode ]
03594 static int l_OdeBodySetFiniteRotationAxis (lua_State *L) { PROFILE
03595     dBodySetFiniteRotationAxis(BODYID(1), GETVEC(2));
03596     return 0;
03597 }
03598 
03604 // lua : int OdeBodyGetFiniteRotationMode(dBodyID) [ from ode ]
03605 static int l_OdeBodyGetFiniteRotationMode (lua_State *L) { PROFILE
03606     PUSHNUMBER( dBodyGetFiniteRotationMode(BODYID(1)) );
03607     return 1;
03608 }
03609 
03615 // lua : x,y,z OdeBodyGetFiniteRotationAxis(dBodyID, dVector3 result) [ from ode ]
03616 static int l_OdeBodyGetFiniteRotationAxis (lua_State *L) { PROFILE
03617     dVector3 result;
03618     dBodyGetFiniteRotationAxis(BODYID(1), result);
03619     PUSHVEC(result);
03620     return 3;
03621 }
03622 
03628 // lua : int OdeBodyGetNumJoints(dBodyID b) [ from ode ]
03629 static int l_OdeBodyGetNumJoints (lua_State *L) { PROFILE
03630     PUSHNUMBER( dBodyGetNumJoints(BODYID(1)) );
03631     return 1;
03632 }
03633 
03640 // lua : dJointID OdeBodyGetJoint(dBodyID, int index) [ from ode ]
03641 static int l_OdeBodyGetJoint (lua_State *L) { PROFILE
03642     PUSHUDATA( dBodyGetJoint(BODYID(1), GETINT(2)) );
03643     return 0;
03644 }
03645 
03651 // lua : void OdeBodyEnable(dBodyID) [ from ode ]
03652 static int l_OdeBodyEnable (lua_State *L) { PROFILE
03653     dBodyEnable(BODYID(1));
03654     return 0;
03655 }
03656 
03664 // lua : void OdeBodyDisable(dBodyID) [ from ode ]
03665 static int l_OdeBodyDisable (lua_State *L) { PROFILE
03666     dBodyDisable(BODYID(1));
03667     return 0;
03668 }
03669 
03675 // lua : int OdeBodyIsEnabled(dBodyID) [ from ode ]
03676 static int l_OdeBodyIsEnabled (lua_State *L) { PROFILE
03677     PUSHNUMBER( dBodyIsEnabled(BODYID(1)) );
03678     return 1;
03679 }
03680 
03688 // lua : void OdeBodySetGravityMode(dBodyID b, int mode) [ from ode ]
03689 static int l_OdeBodySetGravityMode (lua_State *L) { PROFILE
03690     dBodySetGravityMode(BODYID(1), GETINT(2));
03691     return 0;
03692 }
03693 
03699 // lua : int OdeBodyGetGravityMode(dBodyID b) [ from ode ]
03700 static int l_OdeBodyGetGravityMode (lua_State *L) { PROFILE
03701     PUSHNUMBER( dBodyGetGravityMode(BODYID(1)) );
03702     return 1;
03703 }
03704 
03780 // lua : dJointID OdeJointCreateBall(dWorldID, dJointGroupID) [ from ode ]
03781 static int l_OdeJointCreateBall (lua_State *L) { PROFILE
03782     PUSHUDATA( dJointCreateBall(WORLDID(1), JOINTGROUPID(2)) );
03783     return 1;
03784 }
03785 
03792 // lua : dJointID OdeJointCreateHinge(dWorldID, dJointGroupID) [ from ode ]
03793 static int l_OdeJointCreateHinge (lua_State *L) { PROFILE
03794     PUSHUDATA( dJointCreateHinge(WORLDID(1), JOINTGROUPID(2)) );
03795     return 1;
03796 }
03797 
03804 // lua : dJointID OdeJointCreateSlider(dWorldID, dJointGroupID) [ from ode ]
03805 static int l_OdeJointCreateSlider (lua_State *L) { PROFILE
03806     PUSHUDATA( dJointCreateSlider(WORLDID(1), JOINTGROUPID(2)) );
03807     return 1;
03808 }
03809 
03816 // lua : dJointID OdeJointCreateContact(dWorldID, dJointGroupID, const dContact *) [ from ode ]
03817 static int l_OdeJointCreateContact (lua_State *L) { PROFILE
03818     PUSHUDATA( dJointCreateContact(WORLDID(1), JOINTGROUPID(2), CONTACTID(3)) );
03819     return 1;
03820 }
03821 
03828 // lua : dJointID OdeJointCreateHinge2(dWorldID, dJointGroupID) [ from ode ]
03829 static int l_OdeJointCreateHinge2 (lua_State *L) { PROFILE
03830     PUSHUDATA( dJointCreateHinge2(WORLDID(1), JOINTGROUPID(2)) );
03831     return 1;
03832 }
03833 
03840 // lua : dJointID OdeJointCreateUniversal(dWorldID, dJointGroupID) [ from ode ]
03841 static int l_OdeJointCreateUniversal (lua_State *L) { PROFILE
03842     PUSHUDATA( dJointCreateUniversal(WORLDID(1), JOINTGROUPID(2)) );
03843     return 1;
03844 }
03845 
03852 // lua : dJointID OdeJointCreatePR(dWorldID, dJointGroupID) [ from ode ]
03853 static int l_OdeJointCreatePR (lua_State *L) { PROFILE
03854     PUSHUDATA( dJointCreatePR(WORLDID(1), JOINTGROUPID(2)) );
03855     return 1;
03856 }
03857 
03864 // lua : dJointID OdeJointCreateFixed(dWorldID, dJointGroupID) [ from ode ]
03865 static int l_OdeJointCreateFixed (lua_State *L) { PROFILE
03866     PUSHUDATA( dJointCreateFixed(WORLDID(1), JOINTGROUPID(2)) );
03867     return 1;
03868 }
03869 
03870 
03871 // lua : dJointID OdeJointCreateNull(dWorldID, dJointGroupID) [ from ode ]
03872 static int l_OdeJointCreateNull (lua_State *L) { PROFILE
03873     PUSHUDATA( dJointCreateNull(WORLDID(1), JOINTGROUPID(2)) );
03874     return 1;
03875 }
03876 
03883 // lua : dJointID OdeJointCreateAMotor(dWorldID, dJointGroupID) [ from ode ]
03884 static int l_OdeJointCreateAMotor (lua_State *L) { PROFILE
03885     PUSHUDATA( dJointCreateAMotor(WORLDID(1), JOINTGROUPID(2)) );
03886     return 1;
03887 }
03888 
03895 // lua : dJointID OdeJointCreateLMotor(dWorldID, dJointGroupID) [ from ode ]
03896 static int l_OdeJointCreateLMotor (lua_State *L) { PROFILE
03897     PUSHUDATA( dJointCreateLMotor(WORLDID(1), JOINTGROUPID(2)) );
03898     return 1;
03899 }
03900 
03907 // lua : dJointID OdeJointCreatePlane2D(dWorldID, dJointGroupID) [ from ode ]
03908 static int l_OdeJointCreatePlane2D (lua_State *L) { PROFILE
03909     PUSHUDATA( dJointCreatePlane2D(WORLDID(1), JOINTGROUPID(2)) );
03910     return 1;
03911 }
03912 
03921 // lua : void OdeJointDestroy(dJointID) [ from ode ]
03922 static int l_OdeJointDestroy (lua_State *L) { PROFILE
03923     dJointDestroy(JOINTID(1));
03924     return 0;
03925 }
03926 
03932 // lua : dJointGroupID OdeJointGroupCreate(int max_size) [ from ode ]
03933 static int l_OdeJointGroupCreate (lua_State *L) { PROFILE
03934     PUSHUDATA( dJointGroupCreate(8) );
03935     return 1;
03936 }
03937 
03944 // lua : void OdeJointGroupDestroy(dJointGroupID) [ from ode ]
03945 static int l_OdeJointGroupDestroy (lua_State *L) { PROFILE
03946     dJointGroupDestroy(JOINTGROUPID(1));
03947     return 0;
03948 }
03949 
03957 // lua : void OdeJointGroupEmpty(dJointGroupID) [ from ode ]
03958 static int l_OdeJointGroupEmpty (lua_State *L) { PROFILE
03959     dJointGroupEmpty(JOINTGROUPID(1));
03960     return 0;
03961 }
03962 
03976 // lua : void OdeJointAttach(dJointID, dBodyID body1, dBodyID body2) [ from ode ]
03977 static int l_OdeJointAttach (lua_State *L) { PROFILE
03978     dJointAttach(JOINTID(1), BODYID(2), BODYID(3));
03979     return 0;
03980 }
03981 
03986 // lua : void OdeJointSetData(dJointID, void *data) [ from ode ]
03987 static int l_OdeJointSetData (lua_State *L) { PROFILE
03988     dJointSetData(JOINTID(1), GETUDATA(2));
03989     return 0;
03990 }
03991 
03996 // lua : void OdedJointGetData(dJointID) [ from ode ]
03997 static int l_OdedJointGetData (lua_State *L) { PROFILE
03998     PUSHUDATA( dJointGetData(JOINTID(1)) );
03999     return 1;
04000 }
04001 
04016 // lua : int OdeJointGetType(dJointID) [ from ode ]
04017 static int l_OdeJointGetType (lua_State *L) { PROFILE
04018     PUSHNUMBER( dJointGetType(JOINTID(1)) );
04019     return 0;
04020 }
04021 
04032 // lua : dBodyID OdeJointGetBody(dJointID, int index) [ from ode ]
04033 static int l_OdeJointGetBody (lua_State *L) { PROFILE
04034     PUSHUDATA( dJointGetBody(JOINTID(1), GETINT(2)) );
04035     return 1;
04036 }
04037 
04038 // lua : void OdeJointFeedbackCreate(udata)
04039 static int l_OdeJointFeedbackDestroy (lua_State *L) { PROFILE
04040     dJointFeedback *p = JOINTFEEDBACKID(1);
04041     if(p)delete p;  
04042     return 0;
04043 }
04044 
04045 // lua : udata OdeJointFeedbackCreate()
04046 static int l_OdeJointFeedbackCreate (lua_State *L) { PROFILE
04047     PUSHUDATA( new dJointFeedback );
04048     return 1;
04049 }
04050 
04058 // lua : void OdeJointSetFeedback(dJointID, dJointFeedback *) [ from ode ]
04059 static int l_OdeJointSetFeedback (lua_State *L) { PROFILE
04060     dJointSetFeedback(JOINTID(1), JOINTFEEDBACKID(2));
04061     return 0;
04062 }
04063 
04068 // lua : dJointFeedback OdeJointGetFeedback(dJointID) [ from ode ]
04069 static int l_OdeJointGetFeedback (lua_State *L) { PROFILE
04070     PUSHUDATA(dJointGetFeedback(JOINTID(1)));
04071     return 1;
04072 }
04073 
04081 // lua : void OdeJointSetBallAnchor(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04082 static int l_OdeJointSetBallAnchor (lua_State *L) { PROFILE
04083     dJointSetBallAnchor(JOINTID(1), GETVEC(2));
04084     return 0;
04085 }
04086 
04091 // lua : void OdeJointSetBallAnchor2(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04092 static int l_OdeJointSetBallAnchor2 (lua_State *L) { PROFILE
04093     dJointSetBallAnchor2(JOINTID(1), GETVEC(2));
04094     return 0;
04095 }
04096 
04101 // lua : void OdeJointSetHingeAnchor(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04102 static int l_OdeJointSetHingeAnchor (lua_State *L) { PROFILE
04103     dJointSetHingeAnchor(JOINTID(1), GETVEC(2));
04104     return 0;
04105 }
04106 
04107 
04108 // lua : void OdeJointSetHingeAnchorDelta(dJointID, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az) [ from ode ]
04109 static int l_OdeJointSetHingeAnchorDelta (lua_State *L) { PROFILE
04110     dJointSetHingeAnchorDelta(JOINTID(1), GETVEC(2), GETVEC(5));
04111     return 0;
04112 }
04113 
04118 // lua : void OdeJointSetHingeAxis(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04119 static int l_OdeJointSetHingeAxis (lua_State *L) { PROFILE
04120     dJointSetHingeAxis(JOINTID(1), GETVEC(2));
04121     return 0;
04122 }
04123 
04128 // lua : void OdeJointSetHingeParam(dJointID, int parameter, dReal value) [ from ode ]
04129 static int l_OdeJointSetHingeParam (lua_State *L) { PROFILE
04130     dJointSetHingeParam(JOINTID(1), GETINT(2), GETNUMBER(3));
04131     return 0;
04132 }
04133 
04142 // lua : void OdeJointAddHingeTorque(dJointID joint, dReal torque) [ from ode ]
04143 static int l_OdeJointAddHingeTorque (lua_State *L) { PROFILE
04144     dJointAddHingeTorque(JOINTID(1), GETNUMBER(2));
04145     return 0;
04146 }
04147 
04152 // lua : void OdeJointSetSliderAxis(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04153 static int l_OdeJointSetSliderAxis (lua_State *L) { PROFILE
04154     dJointSetSliderAxis(JOINTID(1), GETVEC(2));
04155     return 0;
04156 }
04157 
04161 // lua : void OdeJointSetSliderAxisDelta(dJointID, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az) [ from ode ]
04162 static int l_OdeJointSetSliderAxisDelta (lua_State *L) { PROFILE
04163     dJointSetSliderAxisDelta(JOINTID(1), GETVEC(2), GETVEC(5));
04164     return 0;
04165 }
04166 
04171 // lua : void OdeJointSetSliderParam(dJointID, int parameter, dReal value) [ from ode ]
04172 static int l_OdeJointSetSliderParam (lua_State *L) { PROFILE
04173     dJointSetSliderParam(JOINTID(1), GETINT(2), GETNUMBER(3));
04174     return 0;
04175 }
04176 
04185 // lua : void OdeJointAddSliderForce(dJointID joint, dReal force) [ from ode ]
04186 static int l_OdeJointAddSliderForce (lua_State *L) { PROFILE
04187     dJointAddSliderForce(JOINTID(1), GETNUMBER(2));
04188     return 0;
04189 }
04190 
04195 // lua : void OdeJointSetHinge2Anchor(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04196 static int l_OdeJointSetHinge2Anchor (lua_State *L) { PROFILE
04197     dJointSetHinge2Anchor(JOINTID(1), GETVEC(2));
04198     return 0;
04199 }
04200 
04205 // lua : void OdeJointSetHinge2Axis1(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04206 static int l_OdeJointSetHinge2Axis1 (lua_State *L) { PROFILE
04207     dJointSetHinge2Axis1(JOINTID(1), GETVEC(2));
04208     return 0;
04209 }
04210 
04215 // lua : void OdeJointSetHinge2Axis2(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04216 static int l_OdeJointSetHinge2Axis2 (lua_State *L) { PROFILE
04217     dJointSetHinge2Axis2(JOINTID(1), GETVEC(2));
04218     return 0;
04219 }
04220 
04225 // lua : void OdeJointSetHinge2Param(dJointID, int parameter, dReal value) [ from ode ]
04226 static int l_OdeJointSetHinge2Param (lua_State *L) { PROFILE
04227     dJointSetHinge2Param(JOINTID(1), GETINT(2), GETNUMBER(3));
04228     return 0;
04229 }
04230 
04237 // lua : void OdeJointAddHinge2Torques(dJointID joint, dReal torque1, dReal torque2) [ from ode ]
04238 static int l_OdeJointAddHinge2Torques (lua_State *L) { PROFILE
04239     dJointAddHinge2Torques(JOINTID(1), GETNUMBER(2), GETNUMBER(3));
04240     return 0;
04241 }
04242 
04247 // lua : void OdeJointSetUniversalAnchor(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04248 static int l_OdeJointSetUniversalAnchor (lua_State *L) { PROFILE
04249     dJointSetUniversalAnchor(JOINTID(1), GETVEC(2));
04250     return 0;
04251 }
04252 
04257 // lua : void OdeJointSetUniversalAxis1(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04258 static int l_OdeJointSetUniversalAxis1 (lua_State *L) { PROFILE
04259     dJointSetUniversalAxis1(JOINTID(1), GETVEC(2));
04260     return 0;
04261 }
04262 
04267 // lua : void OdeJointSetUniversalAxis2(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04268 static int l_OdeJointSetUniversalAxis2 (lua_State *L) { PROFILE
04269     dJointSetUniversalAxis2(JOINTID(1), GETVEC(2));
04270     return 0;
04271 }
04272 
04277 // lua : void OdeJointSetUniversalParam(dJointID, int parameter, dReal value) [ from ode ]
04278 static int l_OdeJointSetUniversalParam (lua_State *L) { PROFILE
04279     dJointSetUniversalParam(JOINTID(1), GETINT(2), GETNUMBER(3));
04280     return 0;
04281 }
04282 
04289 // lua : void OdeJointAddUniversalTorques(dJointID joint, dReal torque1, dReal torque2) [ from ode ]
04290 static int l_OdeJointAddUniversalTorques (lua_State *L) { PROFILE
04291     dJointAddUniversalTorques(JOINTID(1), GETNUMBER(2), GETNUMBER(3));
04292     return 0;
04293 }
04294 
04299 // lua : void OdeJointSetPRAnchor(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04300 static int l_OdeJointSetPRAnchor (lua_State *L) { PROFILE
04301     dJointSetPRAnchor(JOINTID(1), GETVEC(2));
04302     return 0;
04303 }
04304 
04309 // lua : void OdeJointSetPRAxis1(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04310 static int l_OdeJointSetPRAxis1 (lua_State *L) { PROFILE
04311     dJointSetPRAxis1(JOINTID(1), GETVEC(2));
04312     return 0;
04313 }
04314 
04319 // lua : void OdeJointSetPRAxis2(dJointID, dReal x, dReal y, dReal z) [ from ode ]
04320 static int l_OdeJointSetPRAxis2 (lua_State *L) { PROFILE
04321     dJointSetPRAxis2(JOINTID(1), GETVEC(2));
04322     return 0;
04323 }
04324 
04331 // lua : void OdeJointSetPRParam(dJointID, int parameter, dReal value) [ from ode ]
04332 static int l_OdeJointSetPRParam (lua_State *L) { PROFILE
04333     dJointSetPRParam(JOINTID(1), GETINT(2), GETNUMBER(3));
04334     return 0;
04335 }
04336 
04345 // lua : void OdeJointAddPRTorque(dJointID j, dReal torque) [ from ode ]
04346 static int l_OdeJointAddPRTorque (lua_State *L) { PROFILE
04347     dJointAddPRTorque(JOINTID(1), GETNUMBER(2));
04348     return 0;
04349 }
04350 
04357 // lua : void OdeJointSetFixed(dJointID) [ from ode ]
04358 static int l_OdeJointSetFixed (lua_State *L) { PROFILE
04359     dJointSetFixed(JOINTID(1));
04360     return 0;
04361 }
04362 
04368 // lua : void OdeJointSetAMotorNumAxes(dJointID, int num) [ from ode ]
04369 static int l_OdeJointSetAMotorNumAxes (lua_State *L) { PROFILE
04370     dJointSetAMotorNumAxes(JOINTID(1), GETINT(2));
04371     return 0;
04372 }
04373 
04378 // lua : void OdeJointSetAMotorAxis(dJointID, int anum, int rel,dReal x, dReal y, dReal z) [ from ode ]
04379 static int l_OdeJointSetAMotorAxis (lua_State *L) { PROFILE
04380     dJointSetAMotorAxis(JOINTID(1), GETINT(2), GETINT(3), GETVEC(4));
04381     return 0;
04382 }
04383 
04393 // lua : void OdeJointSetAMotorAngle(dJointID, int anum, dReal angle) [ from ode ]
04394 static int l_OdeJointSetAMotorAngle (lua_State *L) { PROFILE
04395     dJointSetAMotorAngle(JOINTID(1), GETINT(2), GETNUMBER(3));
04396     return 0;
04397 }
04398 
04403 // lua : void OdeJointSetAMotorParam(dJointID, int parameter, dReal value) [ from ode ]
04404 static int l_OdeJointSetAMotorParam (lua_State *L) { PROFILE
04405     dJointSetAMotorParam(JOINTID(1), GETINT(2), GETNUMBER(3));
04406     return 0;
04407 }
04408 
04413 // lua : void OdeJointSetAMotorMode(dJointID, int mode) [ from ode ]
04414 static int l_OdeJointSetAMotorMode (lua_State *L) { PROFILE
04415     dJointSetAMotorMode(JOINTID(1), GETINT(2));
04416     return 0;
04417 }
04418 
04427 // lua : void OdeJointAddAMotorTorques(dJointID, dReal torque1, dReal torque2, dReal torque3) [ from ode ]
04428 static int l_OdeJointAddAMotorTorques (lua_State *L) { PROFILE
04429     dJointAddAMotorTorques(JOINTID(1), GETNUMBER(2), GETNUMBER(3), GETNUMBER(4));
04430     return 0;
04431 }
04432 
04438 // lua : void OdeJointSetLMotorNumAxes(dJointID, int num) [ from ode ]
04439 static int l_OdeJointSetLMotorNumAxes (lua_State *L) { PROFILE
04440     dJointSetLMotorNumAxes(JOINTID(1), GETINT(2));
04441     return 0;
04442 }
04443 
04455 // lua : void OdeJointSetLMotorAxis(dJointID, int anum, int rel, dReal x, dReal y, dReal z) [ from ode ]
04456 static int l_OdeJointSetLMotorAxis (lua_State *L) { PROFILE
04457     dJointSetLMotorAxis(JOINTID(1), GETINT(2), GETINT(3), GETVEC(4));
04458     return 0;
04459 }
04460 
04465 // lua : void OdeJointSetLMotorParam(dJointID, int parameter, dReal value) [ from ode ]
04466 static int l_OdeJointSetLMotorParam (lua_State *L) { PROFILE
04467     dJointSetLMotorParam(JOINTID(1), GETINT(2), GETNUMBER(3));
04468     return 0;
04469 }
04470 
04474 // lua : void OdeJointSetPlane2DXParam(dJointID, int parameter, dReal value) [ from ode ]
04475 static int l_OdeJointSetPlane2DXParam (lua_State *L) { PROFILE
04476     dJointSetPlane2DXParam(JOINTID(1), GETINT(2), GETNUMBER(3));
04477     return 0;
04478 }
04479 
04483 // lua : void OdeJointSetPlane2DYParam(dJointID, int parameter, dReal value) [ from ode ]
04484 static int l_OdeJointSetPlane2DYParam (lua_State *L) { PROFILE
04485     dJointSetPlane2DYParam(JOINTID(1), GETINT(2), GETNUMBER(3));
04486     return 0;
04487 }
04488 
04492 // lua : void OdeJointSetPlane2DAngleParam(dJointID, int parameter, dReal value) [ from ode ]
04493 static int l_OdeJointSetPlane2DAngleParam (lua_State *L) { PROFILE
04494     dJointSetPlane2DAngleParam(JOINTID(1), GETINT(2), GETNUMBER(3));
04495     return 0;
04496 }
04497 
04504 // lua : void OdeJointGetBallAnchor(dJointID, dVector3 result) [ from ode ]
04505 static int l_OdeJointGetBallAnchor (lua_State *L) { PROFILE
04506     dVector3 result;
04507     dJointGetBallAnchor(JOINTID(1), result);
04508     PUSHVEC(result);
04509     return 3;
04510 }
04511 
04522 // lua : void OdeJointGetBallAnchor2(dJointID, dVector3 result) [ from ode ]
04523 static int l_OdeJointGetBallAnchor2 (lua_State *L) { PROFILE
04524     dVector3 result;
04525     dJointGetBallAnchor2(JOINTID(1), result);
04526     PUSHVEC(result);
04527     return 3;
04528 }
04529 
04537 // lua : void OdeJointGetHingeAnchor(dJointID, dVector3 result) [ from ode ]
04538 static int l_OdeJointGetHingeAnchor (lua_State *L) { PROFILE
04539     dVector3 result;
04540     dJointGetHingeAnchor(JOINTID(1), result);
04541     PUSHVEC(result);
04542     return 3;
04543 }
04544 
04553 // lua : void OdeJointGetHingeAnchor2(dJointID, dVector3 result) [ from ode ]
04554 static int l_OdeJointGetHingeAnchor2 (lua_State *L) { PROFILE
04555     dVector3 result;
04556     dJointGetHingeAnchor2(JOINTID(1), result);
04557     PUSHVEC(result);
04558     return 3;
04559 }
04560 
04565 // lua : void OdeJointGetHingeAxis(dJointID, dVector3 result) [ from ode ]
04566 static int l_OdeJointGetHingeAxis (lua_State *L) { PROFILE
04567     dVector3 result;
04568     dJointGetHingeAxis(JOINTID(1), result);
04569     PUSHVEC(result);
04570     return 3;
04571 }
04572 
04577 // lua : dReal OdeJointGetHingeParam(dJointID, int parameter) [ from ode ]
04578 static int l_OdeJointGetHingeParam (lua_State *L) { PROFILE
04579     PUSHNUMBER( dJointGetHingeParam(JOINTID(1), GETINT(2)) );
04580     return 1;
04581 }
04582 
04593 // lua : dReal OdeJointGetHingeAngle(dJointID) [ from ode ]
04594 static int l_OdeJointGetHingeAngle (lua_State *L) { PROFILE
04595     PUSHNUMBER( dJointGetHingeAngle(JOINTID(1)) );
04596     return 1;
04597 }
04598 
04603 // lua : dReal OdeJointGetHingeAngleRate(dJointID) [ from ode ]
04604 static int l_OdeJointGetHingeAngleRate (lua_State *L) { PROFILE
04605     PUSHNUMBER( dJointGetHingeAngleRate(JOINTID(1)) );
04606     return 1;
04607 }
04608 
04616 // lua : dReal OdeJointGetSliderPosition(dJointID) [ from ode ]
04617 static int l_OdeJointGetSliderPosition (lua_State *L) { PROFILE
04618     PUSHNUMBER( dJointGetSliderPosition(JOINTID(1)) );
04619     return 1;
04620 }
04621 
04626 // lua : dReal OdeJointGetSliderPositionRate(dJointID) [ from ode ]
04627 static int l_OdeJointGetSliderPositionRate (lua_State *L) { PROFILE
04628     PUSHNUMBER( dJointGetSliderPositionRate(JOINTID(1)) );
04629     return 1;
04630 }
04631 
04636 // lua : void OdeJointGetSliderAxis(dJointID, dVector3 result) [ from ode ]
04637 static int l_OdeJointGetSliderAxis (lua_State *L) { PROFILE
04638     dVector3 result;
04639     dJointGetSliderAxis(JOINTID(1), result);
04640     PUSHVEC(result);
04641     return 3;
04642 }
04643 
04648 // lua : dReal OdeJointGetSliderParam(dJointID, int parameter) [ from ode ]
04649 static int l_OdeJointGetSliderParam (lua_State *L) { PROFILE
04650     PUSHNUMBER( dJointGetSliderParam(JOINTID(1), GETINT(2)) );
04651     return 1;
04652 }
04653 
04660 // lua : void OdeJointGetHinge2Anchor(dJointID, dVector3 result) [ from ode ]
04661 static int l_OdeJointGetHinge2Anchor (lua_State *L) { PROFILE
04662     dVector3 result;
04663     dJointGetHinge2Anchor(JOINTID(1), result);
04664     PUSHVEC(result);
04665     return 3;
04666 }
04667 
04676 // lua : void OdeJointGetHinge2Anchor2(dJointID, dVector3 result) [ from ode ]
04677 static int l_OdeJointGetHinge2Anchor2 (lua_State *L) { PROFILE
04678     dVector3 result;
04679     dJointGetHinge2Anchor2(JOINTID(1), result);
04680     PUSHVEC(result);
04681     return 3;
04682 }
04683 
04688 // lua : void OdeJointGetHinge2Axis1(dJointID, dVector3 result) [ from ode ]
04689 static int l_OdeJointGetHinge2Axis1 (lua_State *L) { PROFILE
04690     dVector3 result;
04691     dJointGetHinge2Axis1(JOINTID(1), result);
04692     PUSHVEC(result);
04693     return 3;
04694 }
04695 
04700 // lua : void OdeJointGetHinge2Axis2(dJointID, dVector3 result) [ from ode ]
04701 static int l_OdeJointGetHinge2Axis2 (lua_State *L) { PROFILE
04702     dVector3 result;
04703     dJointGetHinge2Axis2(JOINTID(1), result);
04704     PUSHVEC(result);
04705     return 3;
04706 }
04707 
04712 // lua : dReal OdeJointGetHinge2Param(dJointID, int parameter) [ from ode ]
04713 static int l_OdeJointGetHinge2Param (lua_State *L) { PROFILE
04714     PUSHNUMBER( dJointGetHinge2Param(JOINTID(1), GETINT(2)) );
04715     return 1;
04716 }
04717 
04722 // lua : dReal OdeJointGetHinge2Angle1(dJointID) [ from ode ]
04723 static int l_OdeJointGetHinge2Angle1 (lua_State *L) { PROFILE
04724     PUSHNUMBER( dJointGetHinge2Angle1(JOINTID(1)) );
04725     return 1;
04726 }
04727 
04732 // lua : dReal OdeJointGetHinge2Angle1Rate(dJointID) [ from ode ]
04733 static int l_OdeJointGetHinge2Angle1Rate (lua_State *L) { PROFILE
04734     PUSHNUMBER( dJointGetHinge2Angle1Rate(JOINTID(1)) );
04735     return 1;
04736 }
04737 
04742 // lua : dReal OdeJointGetHinge2Angle2Rate(dJointID) [ from ode ]
04743 static int l_OdeJointGetHinge2Angle2Rate (lua_State *L) { PROFILE
04744     PUSHNUMBER( dJointGetHinge2Angle2Rate(JOINTID(1)) );
04745     return 1;
04746 }
04747 
04754 // lua : void OdeJointGetUniversalAnchor(dJointID, dVector3 result) [ from ode ]
04755 static int l_OdeJointGetUniversalAnchor (lua_State *L) { PROFILE
04756     dVector3 result;
04757     dJointGetUniversalAnchor(JOINTID(1), result);
04758     PUSHVEC(result);
04759     return 3;
04760 }
04761 
04775 // lua : void OdeJointGetUniversalAnchor2(dJointID, dVector3 result) [ from ode ]
04776 static int l_OdeJointGetUniversalAnchor2 (lua_State *L) { PROFILE
04777     dVector3 result;
04778     dJointGetUniversalAnchor2(JOINTID(1), result);
04779     PUSHVEC(result);
04780     return 3;
04781 }
04782 
04787 // lua : void OdeJointGetUniversalAxis1(dJointID, dVector3 result) [ from ode ]
04788 static int l_OdeJointGetUniversalAxis1 (lua_State *L) { PROFILE
04789     dVector3 result;
04790     dJointGetUniversalAxis1(JOINTID(1), result);
04791     PUSHVEC(result);
04792     return 3;
04793 }
04794 
04799 // lua : void OdeJointGetUniversalAxis2(dJointID, dVector3 result) [ from ode ]
04800 static int l_OdeJointGetUniversalAxis2 (lua_State *L) { PROFILE
04801     dVector3 result;
04802     dJointGetUniversalAxis2(JOINTID(1), result);
04803     PUSHVEC(result);
04804     return 3;
04805 }
04806 
04811 // lua : dReal OdeJointGetUniversalParam(dJointID, int parameter) [ from ode ]
04812 static int l_OdeJointGetUniversalParam (lua_State *L) { PROFILE
04813     PUSHNUMBER( dJointGetUniversalParam(JOINTID(1), GETINT(2)) );
04814     return 1;
04815 }
04816 
04828 // lua : angle1,angle2 OdeJointGetUniversalAngles(dJointID, dReal *angle1, dReal *angle2) [ from ode ]
04829 static int l_OdeJointGetUniversalAngles (lua_State *L) { PROFILE
04830     dReal angle1, angle2;
04831     // TODO is this correct with the switched axis
04832     printf("WARNING!!!! dJointGetUniversalAngles probably gives strange results due to axis switch\n");
04833     dJointGetUniversalAngles(JOINTID(1), &angle1, &angle2);
04834     PUSHNUMBER(angle1);
04835     PUSHNUMBER(angle2);
04836     return 2;
04837 }
04838 
04843 // lua : dReal OdeJointGetUniversalAngle1(dJointID) [ from ode ]
04844 static int l_OdeJointGetUniversalAngle1 (lua_State *L) { PROFILE
04845     PUSHNUMBER( dJointGetUniversalAngle1(JOINTID(1)) );
04846     return 1;
04847 }
04848 
04853 // lua : dReal OdeJointGetUniversalAngle2(dJointID) [ from ode ]
04854 static int l_OdeJointGetUniversalAngle2 (lua_State *L) { PROFILE
04855     PUSHNUMBER( dJointGetUniversalAngle2(JOINTID(1)) );
04856     return 1;
04857 }
04858 
04863 // lua : dReal OdeJointGetUniversalAngle1Rate(dJointID) [ from ode ]
04864 static int l_OdeJointGetUniversalAngle1Rate (lua_State *L) { PROFILE
04865     PUSHNUMBER( dJointGetUniversalAngle1Rate(JOINTID(1)) );
04866     return 1;
04867 }
04868 
04873 // lua : dReal OdeJointGetUniversalAngle2Rate(dJointID) [ from ode ]
04874 static int l_OdeJointGetUniversalAngle2Rate (lua_State *L) { PROFILE
04875     PUSHNUMBER( dJointGetUniversalAngle2Rate(JOINTID(1)) );
04876     return 1;
04877 }
04878 
04885 // lua : void OdeJointGetPRAnchor(dJointID, dVector3 result) [ from ode ]
04886 static int l_OdeJointGetPRAnchor (lua_State *L) { PROFILE
04887     dVector3 result;
04888     dJointGetPRAnchor(JOINTID(1), result);
04889     PUSHVEC(result);
04890     return 3;
04891 }
04892 
04904 // lua : dReal OdeJointGetPRPosition(dJointID) [ from ode ]
04905 static int l_OdeJointGetPRPosition (lua_State *L) { PROFILE
04906     PUSHNUMBER( dJointGetPRPosition(JOINTID(1)) );
04907     return 1;
04908 }
04909 
04915 // lua : dReal OdeJointGetPRPositionRate(dJointID) [ from ode ]
04916 static int l_OdeJointGetPRPositionRate (lua_State *L) { PROFILE
04917     PUSHNUMBER( dJointGetPRPositionRate(JOINTID(1)) );
04918     return 1;
04919 }
04920 
04925 // lua : void OdeJointGetPRAxis1(dJointID, dVector3 result) [ from ode ]
04926 static int l_OdeJointGetPRAxis1 (lua_State *L) { PROFILE
04927     dVector3 result;
04928     dJointGetPRAxis1(JOINTID(1), result);
04929     PUSHVEC(result);
04930     return 3;
04931 }
04932 
04937 // lua : void OdeJointGetPRAxis2(dJointID, dVector3 result) [ from ode ]
04938 static int l_OdeJointGetPRAxis2 (lua_State *L) { PROFILE
04939     dVector3 result;
04940     dJointGetPRAxis2(JOINTID(1), result);
04941     PUSHVEC(result);
04942     return 3;
04943 }
04944 
04949 // lua : dReal OdeJointGetPRParam(dJointID, int parameter) [ from ode ]
04950 static int l_OdeJointGetPRParam (lua_State *L) { PROFILE
04951     PUSHNUMBER( dJointGetPRParam(JOINTID(1), GETINT(2)) );
04952     return 1;
04953 }
04954 
04963 // lua : int OdeJointGetAMotorNumAxes(dJointID) [ from ode ]
04964 static int l_OdeJointGetAMotorNumAxes (lua_State *L) { PROFILE
04965     PUSHNUMBER( dJointGetAMotorNumAxes(JOINTID(1)) );
04966     return 1;
04967 }
04968 
04978 // lua : void OdeJointGetAMotorAxis(dJointID, int anum, dVector3 result) [ from ode ]
04979 static int l_OdeJointGetAMotorAxis (lua_State *L) { PROFILE
04980     dVector3 result;
04981     dJointGetAMotorAxis(JOINTID(1), GETINT(2), result);
04982     PUSHVEC(result);
04983     return 3;
04984 }
04985 
05002 // lua : int OdeJointGetAMotorAxisRel(dJointID, int anum) [ from ode ]
05003 static int l_OdeJointGetAMotorAxisRel (lua_State *L) { PROFILE
05004     PUSHNUMBER( dJointGetAMotorAxisRel(JOINTID(1), GETINT(2)) );
05005     return 1;
05006 }
05007 
05016 // lua : dReal OdeJointGetAMotorAngle(dJointID, int anum) [ from ode ]
05017 static int l_OdeJointGetAMotorAngle (lua_State *L) { PROFILE
05018     PUSHNUMBER( dJointGetAMotorAngle(JOINTID(1), GETINT(2)) );
05019     return 1;
05020 }
05021 
05030 // lua : dReal OdeJointGetAMotorAngleRate(dJointID, int anum) [ from ode ]
05031 static int l_OdeJointGetAMotorAngleRate (lua_State *L) { PROFILE
05032     PUSHNUMBER( dJointGetAMotorAngleRate(JOINTID(1), GETINT(2)) );
05033     return 1;
05034 }
05035 
05040 // lua : dReal OdeJointGetAMotorParam(dJointID, int parameter) [ from ode ]
05041 static int l_OdeJointGetAMotorParam (lua_State *L) { PROFILE
05042     PUSHNUMBER( dJointGetAMotorParam(JOINTID(1), GETINT(2)) );
05043     return 1;
05044 }
05045 
05059 // lua : int OdeJointGetAMotorMode(dJointID) [ from ode ]
05060 static int l_OdeJointGetAMotorMode (lua_State *L) { PROFILE
05061     PUSHNUMBER( dJointGetAMotorMode(JOINTID(1)) );
05062     return 1;
05063 }
05064 
05069 // lua : int OdeJointGetLMotorNumAxes(dJointID) [ from ode ]
05070 static int l_OdeJointGetLMotorNumAxes (lua_State *L) { PROFILE
05071     PUSHNUMBER( dJointGetLMotorNumAxes(JOINTID(1)) );
05072     return 1;
05073 }
05074 
05079 // lua : void OdeJointGetLMotorAxis(dJointID, int anum, dVector3 result) [ from ode ]
05080 static int l_OdeJointGetLMotorAxis (lua_State *L) { PROFILE
05081     dVector3 result;
05082     dJointGetLMotorAxis(JOINTID(1), GETINT(2), result);
05083     PUSHVEC(result);
05084     return 3;
05085 }
05086 
05091 // lua : dReal OdeJointGetLMotorParam(dJointID, int parameter) [ from ode ]
05092 static int l_OdeJointGetLMotorParam (lua_State *L) { PROFILE
05093     PUSHNUMBER( dJointGetLMotorParam(JOINTID(1), GETINT(2)) );
05094     return 1;
05095 }
05096 
05100 // lua : dJointID OdeConnectingJoint(dBodyID, dBodyID) [ from ode ]
05101 static int l_OdeConnectingJoint (lua_State *L) { PROFILE
05102     PUSHUDATA( dConnectingJoint(BODYID(1), BODYID(2)) );
05103     return 1;
05104 }
05105 
05109 // lua : int OdeConnectingJointList(dBodyID, dBodyID, dJointID*) [ from ode ]
05110 static int l_OdeConnectingJointList (lua_State *L) { PROFILE
05111     // TODO dConnectingJointList(dBodyID, dBodyID, dJointID*);
05112     return 0;
05113 }
05114 
05121 // lua : int OdeAreConnected(dBodyID, dBodyID) [ from ode ]
05122 static int l_OdeAreConnected (lua_State *L) { PROFILE
05123     PUSHNUMBER( dAreConnected(BODYID(1), BODYID(2)) );
05124     return 1;
05125 }
05126 
05140 // lua : int OdeAreConnectedExcluding(dBodyID body1, dBodyID body2, int joint_type) [ from ode ]
05141 static int l_OdeAreConnectedExcluding (lua_State *L) { PROFILE
05142     PUSHNUMBER( dAreConnectedExcluding(BODYID(1), BODYID(2), GETINT(3)) );
05143     return 1;
05144 }
05145 
05146 
05147 // lua : dStopwatch * l_OdeStopwatchCreate() [ from ode ]
05148 static int l_OdeStopwatchCreate (lua_State *L) { PROFILE
05149     dStopwatch *p = new dStopwatch;
05150     PUSHUDATA(p);
05151     return 1;
05152 }
05153 
05154 // lua : void l_OdeStopwatchDestroy(dStopwatch *) [ from ode ]
05155 static int l_OdeStopwatchDestroy (lua_State *L) { PROFILE
05156     dStopwatch *p = STOPWATCHID(1);
05157     if(p)delete p;
05158     return 0;
05159 }
05160 
05161 // lua : void OdeStopwatchReset(dStopwatch *) [ from ode ]
05162 static int l_OdeStopwatchReset (lua_State *L) { PROFILE
05163     dStopwatchReset(STOPWATCHID(1));
05164     return 0;
05165 }
05166 
05167 
05168 // lua : void OdeStopwatchStart(dStopwatch *) [ from ode ]
05169 static int l_OdeStopwatchStart (lua_State *L) { PROFILE
05170     dStopwatchStart(STOPWATCHID(1));
05171     return 0;
05172 }
05173 
05174 
05175 // lua : void OdeStopwatchStop(dStopwatch *) [ from ode ]
05176 static int l_OdeStopwatchStop (lua_State *L) { PROFILE
05177     dStopwatchStop(STOPWATCHID(1));
05178     return 0;
05179 }
05180 
05181 
05182 // lua : double OdeStopwatchTime(dStopwatch *) [ from ode ]
05183 static int l_OdeStopwatchTime (lua_State *L) { PROFILE
05184     PUSHNUMBER( dStopwatchTime(STOPWATCHID(1)) );
05185     return 1;
05186 }
05187 
05188 /* returns total time in secs */
05189 
05190 
05191 /* code timers */
05192 // lua : void OdeTimerStart(const char *description) [ from ode ]
05193 static int l_OdeTimerStart (lua_State *L) { PROFILE
05194     dTimerStart(GETSTRING(1));
05195     return 0;
05196 }
05197 
05198 /* pass a static string here */
05199 // lua : void OdeTimerNow(const char *description) [ from ode ]
05200 static int l_OdeTimerNow (lua_State *L) { PROFILE
05201     dTimerNow(GETSTRING(1));
05202     return 0;
05203 }
05204 
05205 // lua : void OdeTimerEnd(void) [ from ode ]
05206 static int l_OdeTimerEnd (lua_State *L) { PROFILE
05207     dTimerEnd();
05208     return 0;
05209 }
05210 
05211 
05212 /* resolution */
05213 
05214 /* returns the timer ticks per second implied by the timing hardware or API.
05215  * the actual timer resolution may not be this great.
05216  */
05217 // lua : double OdeTimerTicksPerSecond(void) [ from ode ]
05218 static int l_OdeTimerTicksPerSecond (lua_State *L) { PROFILE
05219     PUSHNUMBER( dTimerTicksPerSecond() );
05220     return 1;
05221 }
05222 
05223 /* returns an estimate of the actual timer resolution, in seconds. this may
05224  * be greater than 1/ticks_per_second.
05225  */
05226 // lua : double OdeTimerResolution(void) [ from ode ]
05227 static int l_OdeTimerResolution (lua_State *L) { PROFILE
05228     PUSHNUMBER( dTimerResolution() );
05229     return 1;
05230 }
05231 
05232 void    RegisterLua_Ode_GlobalFunctions (lua_State* L) {
05233       
05234     cScripting::SetGlobal(L,"OdeInfinity",dInfinity);
05235     
05236     cScripting::SetGlobal(L,"OdeParamLoStop",dParamLoStop);
05237     cScripting::SetGlobal(L,"OdeParamHiStop",dParamHiStop);
05238     cScripting::SetGlobal(L,"OdeParamVel",dParamVel);
05239     cScripting::SetGlobal(L,"OdeParamFMax",dParamFMax);
05240     cScripting::SetGlobal(L,"OdeParamFudgeFactor",dParamFudgeFactor);
05241     cScripting::SetGlobal(L,"OdeParamBounce",dParamBounce);
05242     cScripting::SetGlobal(L,"OdeParamCFM",dParamCFM);
05243     cScripting::SetGlobal(L,"OdeParamStopERP",dParamStopERP);
05244     cScripting::SetGlobal(L,"OdeParamSuspensionERP",dParamSuspensionERP);
05245     cScripting::SetGlobal(L,"OdeParamSuspensionCFM",dParamSuspensionCFM);
05246     
05247     cScripting::SetGlobal(L,"OdeParamLoStop2",dParamLoStop2);
05248     cScripting::SetGlobal(L,"OdeParamHiStop2",dParamHiStop2);
05249     cScripting::SetGlobal(L,"OdeParamVel2",dParamVel2);
05250     cScripting::SetGlobal(L,"OdeParamFMax2",dParamFMax2);
05251     cScripting::SetGlobal(L,"OdeParamFudgeFactor2",dParamFudgeFactor2);
05252     cScripting::SetGlobal(L,"OdeParamBounce2",dParamBounce2);
05253     cScripting::SetGlobal(L,"OdeParamCFM2",dParamCFM2);
05254     cScripting::SetGlobal(L,"OdeParamStopERP2",dParamStopERP2);
05255     cScripting::SetGlobal(L,"OdeParamSuspensionERP2",dParamSuspensionERP2);
05256     cScripting::SetGlobal(L,"OdeParamSuspensionCFM2",dParamSuspensionCFM2);
05257     
05258     cScripting::SetGlobal(L,"OdeParamLoStop3",dParamLoStop3);
05259     cScripting::SetGlobal(L,"OdeParamHiStop3",dParamHiStop3);
05260     cScripting::SetGlobal(L,"OdeParamVel3",dParamVel3);
05261     cScripting::SetGlobal(L,"OdeParamFMax3",dParamFMax3);
05262     cScripting::SetGlobal(L,"OdeParamFudgeFactor3",dParamFudgeFactor3);
05263     cScripting::SetGlobal(L,"OdeParamBounce3",dParamBounce3);
05264     cScripting::SetGlobal(L,"OdeParamCFM3",dParamCFM3);
05265     cScripting::SetGlobal(L,"OdeParamStopERP3",dParamStopERP3);
05266     cScripting::SetGlobal(L,"OdeParamSuspensionERP3",dParamSuspensionERP3);
05267     cScripting::SetGlobal(L,"OdeParamSuspensionCFM3",dParamSuspensionCFM3);
05268     
05269     // surface modes
05270     cScripting::SetGlobal(L,"OdeContactMu2",dContactMu2);
05271     cScripting::SetGlobal(L,"OdeContactFDir1",dContactFDir1);
05272     cScripting::SetGlobal(L,"OdeContactBounce",dContactBounce);
05273     cScripting::SetGlobal(L,"OdeContactSoftERP",dContactSoftERP);
05274     cScripting::SetGlobal(L,"OdeContactSoftCFM",dContactSoftCFM);
05275     cScripting::SetGlobal(L,"OdeContactMotion1",dContactMotion1);
05276     cScripting::SetGlobal(L,"OdeContactMotion2",dContactMotion2);
05277     cScripting::SetGlobal(L,"OdeContactSlip1",dContactSlip1);
05278     cScripting::SetGlobal(L,"OdeContactSlip2",dContactSlip2);
05279     
05280     cScripting::SetGlobal(L,"OdeContactApprox0",dContactApprox0);
05281     cScripting::SetGlobal(L,"OdeContactApprox1_1",dContactApprox1_1);
05282     cScripting::SetGlobal(L,"OdeContactApprox1_1",dContactApprox1_1);
05283     cScripting::SetGlobal(L,"OdeContactApprox1",dContactApprox1);
05284 
05285     // geometry classes
05286     cScripting::SetGlobal(L,"OdeSphereClass",dSphereClass);
05287     cScripting::SetGlobal(L,"OdeBoxClass",dBoxClass);
05288     cScripting::SetGlobal(L,"OdeCapsuleClass",dCapsuleClass);
05289     cScripting::SetGlobal(L,"OdeCylinderClass",dCylinderClass);
05290     cScripting::SetGlobal(L,"OdePlaneClass",dPlaneClass);
05291     cScripting::SetGlobal(L,"OdeRayClass",dRayClass);
05292     cScripting::SetGlobal(L,"OdeConvexClass",dConvexClass);
05293     cScripting::SetGlobal(L,"OdeGeomTransformClass",dGeomTransformClass);
05294     cScripting::SetGlobal(L,"OdeTriMeshClass",dTriMeshClass);
05295     cScripting::SetGlobal(L,"OdeHeightfieldClass",dHeightfieldClass);
05296     cScripting::SetGlobal(L,"OdeFirstSpaceClass",dFirstSpaceClass);
05297     cScripting::SetGlobal(L,"OdeSimpleSpaceClass",dSimpleSpaceClass);
05298     cScripting::SetGlobal(L,"OdeQuadTreeSpaceClass",dQuadTreeSpaceClass);
05299     cScripting::SetGlobal(L,"OdeLastSpaceClass",dLastSpaceClass);
05300     cScripting::SetGlobal(L,"OdeFirstUserClass",dFirstUserClass);
05301     cScripting::SetGlobal(L,"OdeLastUserClass",dLastUserClass);
05302     cScripting::SetGlobal(L,"OdeGeomNumClasses",dGeomNumClasses);
05303 
05304 
05305     // joint types  
05306     cScripting::SetGlobal(L,"OdeJointTypeNone",dJointTypeNone);
05307     cScripting::SetGlobal(L,"OdeJointTypeBall",dJointTypeBall);
05308     cScripting::SetGlobal(L,"OdeJointTypeHinge",dJointTypeHinge);
05309     cScripting::SetGlobal(L,"OdeJointTypeSlider",dJointTypeSlider);
05310     cScripting::SetGlobal(L,"OdeJointTypeContact",dJointTypeContact);
05311     cScripting::SetGlobal(L,"OdeJointTypeUniversal",dJointTypeUniversal);
05312     cScripting::SetGlobal(L,"OdeJointTypeHinge2",dJointTypeHinge2);
05313     cScripting::SetGlobal(L,"OdeJointTypeFixed",dJointTypeFixed);
05314     cScripting::SetGlobal(L,"OdeJointTypeNull",dJointTypeNull);
05315     cScripting::SetGlobal(L,"OdeJointTypeAMotor",dJointTypeAMotor);
05316     cScripting::SetGlobal(L,"OdeJointTypeLMotor",dJointTypeLMotor);
05317     cScripting::SetGlobal(L,"OdeJointTypePlane2D",dJointTypePlane2D);
05318     cScripting::SetGlobal(L,"OdeJointTypePR",dJointTypePR);
05319  
05320 
05321     lua_register(L,"OdeGeomSetData",l_OdeGeomSetData);
05322     lua_register(L,"OdeGeomGetData",l_OdeGeomGetData);
05323     lua_register(L,"OdeGeomSetBody",l_OdeGeomSetBody);
05324     lua_register(L,"OdeGeomGetBody",l_OdeGeomGetBody);
05325     lua_register(L,"OdeGeomSetPosition",l_OdeGeomSetPosition);
05326     lua_register(L,"OdeGeomSetQuaternion",l_OdeGeomSetQuaternion);
05327     lua_register(L,"OdeGeomGetPosition",l_OdeGeomGetPosition);
05328     lua_register(L,"OdeGeomGetQuaternion",l_OdeGeomGetQuaternion);
05329     lua_register(L,"OdeGeomGetAABB",l_OdeGeomGetAABB);
05330     lua_register(L,"OdeGeomIsSpace",l_OdeGeomIsSpace);
05331     lua_register(L,"OdeGeomGetSpace",l_OdeGeomGetSpace);
05332     lua_register(L,"OdeGeomGetClass",l_OdeGeomGetClass);
05333     lua_register(L,"OdeGeomSetCategoryBits",l_OdeGeomSetCategoryBits);
05334     lua_register(L,"OdeGeomSetCollideBits",l_OdeGeomSetCollideBits);
05335     lua_register(L,"OdeGeomGetCategoryBits",l_OdeGeomGetCategoryBits);
05336     lua_register(L,"OdeGeomGetCollideBits",l_OdeGeomGetCollideBits);
05337     lua_register(L,"OdeGeomEnable",l_OdeGeomEnable);
05338     lua_register(L,"OdeGeomDisable",l_OdeGeomDisable);
05339     lua_register(L,"OdeGeomIsEnabled",l_OdeGeomIsEnabled);
05340     lua_register(L,"OdeGeomSetOffsetPosition",l_OdeGeomSetOffsetPosition);
05341     lua_register(L,"OdeGeomSetOffsetQuaternion",l_OdeGeomSetOffsetQuaternion);
05342     lua_register(L,"OdeGeomSetOffsetWorldPosition",l_OdeGeomSetOffsetWorldPosition);
05343     lua_register(L,"OdeGeomSetOffsetWorldQuaternion",l_OdeGeomSetOffsetWorldQuaternion);
05344     lua_register(L,"OdeGeomClearOffset",l_OdeGeomClearOffset);
05345     lua_register(L,"OdeGeomIsOffset",l_OdeGeomIsOffset);
05346     lua_register(L,"OdeGeomGetOffsetPosition",l_OdeGeomGetOffsetPosition);
05347     lua_register(L,"OdeGeomGetOffsetQuaternion",l_OdeGeomGetOffsetQuaternion);
05348     lua_register(L,"OdeCollide",l_OdeCollide);
05349     lua_register(L,"OdeSpaceCollide",l_OdeSpaceCollide);
05350     lua_register(L,"OdeSpaceCollide2",l_OdeSpaceCollide2);
05351     lua_register(L,"OdeCreateSphere",l_OdeCreateSphere);
05352     lua_register(L,"OdeGeomSphereSetRadius",l_OdeGeomSphereSetRadius);
05353     lua_register(L,"OdeGeomSphereGetRadius",l_OdeGeomSphereGetRadius);
05354     lua_register(L,"OdeGeomSpherePointDepth",l_OdeGeomSpherePointDepth);
05355     lua_register(L,"OdeCreateConvex",l_OdeCreateConvex);
05356     lua_register(L,"OdeGeomSetConvex",l_OdeGeomSetConvex);
05357     lua_register(L,"OdeCreateBox",l_OdeCreateBox);
05358     lua_register(L,"OdeGeomBoxSetLengths",l_OdeGeomBoxSetLengths);
05359     lua_register(L,"OdeGeomBoxGetLengths",l_OdeGeomBoxGetLengths);
05360     lua_register(L,"OdeGeomBoxPointDepth",l_OdeGeomBoxPointDepth);
05361     lua_register(L,"OdeCreatePlane",l_OdeCreatePlane);
05362     lua_register(L,"OdeGeomPlaneSetParams",l_OdeGeomPlaneSetParams);
05363     lua_register(L,"OdeGeomPlaneGetParams",l_OdeGeomPlaneGetParams);
05364     lua_register(L,"OdeGeomPlanePointDepth",l_OdeGeomPlanePointDepth);
05365     lua_register(L,"OdeCreateCapsule",l_OdeCreateCapsule);
05366     lua_register(L,"OdeGeomCapsuleSetParams",l_OdeGeomCapsuleSetParams);
05367     lua_register(L,"OdeGeomCapsuleGetParams",l_OdeGeomCapsuleGetParams);
05368     lua_register(L,"OdeGeomCapsulePointDepth",l_OdeGeomCapsulePointDepth);
05369     lua_register(L,"OdeGeomCylinderSetParams",l_OdeGeomCylinderSetParams);
05370     lua_register(L,"OdeGeomCylinderGetParams",l_OdeGeomCylinderGetParams);
05371     lua_register(L,"OdeCreateRay",l_OdeCreateRay);
05372     lua_register(L,"OdeGeomRaySetLength",l_OdeGeomRaySetLength);
05373     lua_register(L,"OdeGeomRayGetLength",l_OdeGeomRayGetLength);
05374     lua_register(L,"OdeGeomRaySet",l_OdeGeomRaySet);
05375     lua_register(L,"OdeGeomRayGet",l_OdeGeomRayGet);
05376     lua_register(L,"OdeGeomRaySetParams",l_OdeGeomRaySetParams);
05377     lua_register(L,"OdeGeomRayGetParams",l_OdeGeomRayGetParams);
05378     lua_register(L,"OdeGeomRaySetClosestHit",l_OdeGeomRaySetClosestHit);
05379     lua_register(L,"OdeGeomRayGetClosestHit",l_OdeGeomRayGetClosestHit);
05380     lua_register(L,"OdeGeomTransformSetGeom",l_OdeGeomTransformSetGeom);
05381     lua_register(L,"OdeGeomTransformGetGeom",l_OdeGeomTransformGetGeom);
05382     lua_register(L,"OdeGeomTransformSetCleanup",l_OdeGeomTransformSetCleanup);
05383     lua_register(L,"OdeGeomTransformGetCleanup",l_OdeGeomTransformGetCleanup);
05384     lua_register(L,"OdeGeomTransformSetInfo",l_OdeGeomTransformSetInfo);
05385     lua_register(L,"OdeGeomTransformGetInfo",l_OdeGeomTransformGetInfo);
05386     lua_register(L,"OdeCreateHeightfield",l_OdeCreateHeightfield);
05387     lua_register(L,"OdeGeomHeightfieldDataDestroy",l_OdeGeomHeightfieldDataDestroy);
05388     lua_register(L,"OdeGeomHeightfieldDataBuildCallback",l_OdeGeomHeightfieldDataBuildCallback);
05389     lua_register(L,"OdeGeomHeightfieldDataBuildByte",l_OdeGeomHeightfieldDataBuildByte);
05390     lua_register(L,"OdeGeomHeightfieldDataBuildShort",l_OdeGeomHeightfieldDataBuildShort);
05391     lua_register(L,"OdeGeomHeightfieldDataBuildSingle",l_OdeGeomHeightfieldDataBuildSingle);
05392     lua_register(L,"OdeGeomHeightfieldDataBuildDouble",l_OdeGeomHeightfieldDataBuildDouble);
05393     lua_register(L,"OdeGeomHeightfieldDataSetBounds",l_OdeGeomHeightfieldDataSetBounds);
05394     lua_register(L,"OdeGeomHeightfieldSetHeightfieldData",l_OdeGeomHeightfieldSetHeightfieldData);
05395     lua_register(L,"OdeGeomHeightfieldGetHeightfieldData",l_OdeGeomHeightfieldGetHeightfieldData);
05396     lua_register(L,"OdeClosestLineSegmentPoints",l_OdeClosestLineSegmentPoints);
05397     lua_register(L,"OdeBoxTouchesBox",l_OdeBoxTouchesBox);
05398     lua_register(L,"OdeInfiniteAABB",l_OdeInfiniteAABB);
05399     lua_register(L,"OdeInitODE",l_OdeInitODE);
05400     lua_register(L,"OdeCloseODE",l_OdeCloseODE);
05401     lua_register(L,"OdeCreateGeomClass",l_OdeCreateGeomClass);
05402     lua_register(L,"OdeGeomGetClassData",l_OdeGeomGetClassData);
05403     lua_register(L,"OdeCreateGeom",l_OdeCreateGeom);
05404     lua_register(L,"OdeSimpleSpaceCreate",l_OdeSimpleSpaceCreate);
05405     lua_register(L,"OdeHashSpaceCreate",l_OdeHashSpaceCreate);
05406     lua_register(L,"OdeQuadTreeSpaceCreate",l_OdeQuadTreeSpaceCreate);
05407     lua_register(L,"OdeSpaceDestroy",l_OdeSpaceDestroy);
05408     lua_register(L,"OdeHashSpaceSetLevels",l_OdeHashSpaceSetLevels);
05409     lua_register(L,"OdeHashSpaceGetLevels",l_OdeHashSpaceGetLevels);
05410     lua_register(L,"OdeSpaceSetCleanup",l_OdeSpaceSetCleanup);
05411     lua_register(L,"OdeSpaceGetCleanup",l_OdeSpaceGetCleanup);
05412     lua_register(L,"OdeSpaceAdd",l_OdeSpaceAdd);
05413     lua_register(L,"OdeSpaceRemove",l_OdeSpaceRemove);
05414     lua_register(L,"OdeSpaceQuery",l_OdeSpaceQuery);
05415     lua_register(L,"OdeSpaceClean",l_OdeSpaceClean);
05416     lua_register(L,"OdeSpaceGetNumGeoms",l_OdeSpaceGetNumGeoms);
05417     lua_register(L,"OdeSpaceGetGeom",l_OdeSpaceGetGeom);
05418     lua_register(L,"OdeGeomTriMeshDataCreate",l_OdeGeomTriMeshDataCreate);
05419     lua_register(L,"OdeGeomTriMeshDataDestroy",l_OdeGeomTriMeshDataDestroy);
05420     lua_register(L,"OdeGeomTriMeshDataSet",l_OdeGeomTriMeshDataSet);
05421     lua_register(L,"OdeGeomTriMeshDataGet",l_OdeGeomTriMeshDataGet);
05422     lua_register(L,"OdeGeomTriMeshSetLastTransform",l_OdeGeomTriMeshSetLastTransform);
05423     lua_register(L,"OdeGeomTriMeshGetLastTransform",l_OdeGeomTriMeshGetLastTransform);
05424     lua_register(L,"OdeGeomTriMeshDataBuildSingle",l_OdeGeomTriMeshDataBuildSingle);
05425     lua_register(L,"OdeGeomTriMeshDataBuildSingle1",l_OdeGeomTriMeshDataBuildSingle1);
05426     lua_register(L,"OdeGeomTriMeshDataBuildDouble",l_OdeGeomTriMeshDataBuildDouble);
05427     lua_register(L,"OdeGeomTriMeshDataBuildDouble1",l_OdeGeomTriMeshDataBuildDouble1);
05428     lua_register(L,"OdeGeomTriMeshDataBuildFromRaw",l_OdeGeomTriMeshDataBuildFromRaw);
05429     lua_register(L,"OdeGeomTriMeshDataBuildSimple1",l_OdeGeomTriMeshDataBuildSimple1);
05430     lua_register(L,"OdeGeomTriMeshDataPreprocess",l_OdeGeomTriMeshDataPreprocess);
05431     lua_register(L,"OdeGeomTriMeshDataGetBuffer",l_OdeGeomTriMeshDataGetBuffer);
05432     lua_register(L,"OdeGeomTriMeshDataSetBuffer",l_OdeGeomTriMeshDataSetBuffer);
05433     lua_register(L,"OdeGeomTriMeshSetCallback",l_OdeGeomTriMeshSetCallback);
05434     lua_register(L,"OdeGeomTriMeshGetCallback",l_OdeGeomTriMeshGetCallback);
05435     lua_register(L,"OdeGeomTriMeshSetArrayCallback",l_OdeGeomTriMeshSetArrayCallback);
05436     lua_register(L,"OdeGeomTriMeshGetArrayCallback",l_OdeGeomTriMeshGetArrayCallback);
05437     lua_register(L,"OdeGeomTriMeshSetRayCallback",l_OdeGeomTriMeshSetRayCallback);
05438     lua_register(L,"OdeGeomTriMeshGetRayCallback",l_OdeGeomTriMeshGetRayCallback);
05439     lua_register(L,"OdeCreateTriMesh",l_OdeCreateTriMesh);
05440     lua_register(L,"OdeGeomTriMeshSetData",l_OdeGeomTriMeshSetData);
05441     lua_register(L,"OdeGeomTriMeshGetData",l_OdeGeomTriMeshGetData);
05442     lua_register(L,"OdeGeomTriMeshEnableTC",l_OdeGeomTriMeshEnableTC);
05443     lua_register(L,"OdeGeomTriMeshIsTCEnabled",l_OdeGeomTriMeshIsTCEnabled);
05444     lua_register(L,"OdeGeomTriMeshClearTCCache",l_OdeGeomTriMeshClearTCCache);
05445     lua_register(L,"OdeGeomTriMeshGetTriMeshDataID",l_OdeGeomTriMeshGetTriMeshDataID);
05446     lua_register(L,"OdeGeomTriMeshGetTriangle",l_OdeGeomTriMeshGetTriangle);
05447     lua_register(L,"OdeGeomTriMeshGetPoint",l_OdeGeomTriMeshGetPoint);
05448     lua_register(L,"OdeGeomTriMeshGetTriangleCount",l_OdeGeomTriMeshGetTriangleCount);
05449     lua_register(L,"OdeGeomTriMeshDataUpdate",l_OdeGeomTriMeshDataUpdate);
05450     lua_register(L,"OdeMassCreate",l_OdeMassCreate);
05451     lua_register(L,"OdeMassDestroy",l_OdeMassDestroy);
05452     lua_register(L,"OdeMassCheck",l_OdeMassCheck);
05453     lua_register(L,"OdeMassSetZero",l_OdeMassSetZero);
05454     lua_register(L,"OdeMassSetParameters",l_OdeMassSetParameters);
05455     lua_register(L,"OdeMassSetSphere",l_OdeMassSetSphere);
05456     lua_register(L,"OdeMassSetSphereTotal",l_OdeMassSetSphereTotal);
05457     lua_register(L,"OdeMassSetCapsule",l_OdeMassSetCapsule);
05458     lua_register(L,"OdeMassSetCapsuleTotal",l_OdeMassSetCapsuleTotal);
05459     lua_register(L,"OdeMassSetCylinder",l_OdeMassSetCylinder);
05460     lua_register(L,"OdeMassSetCylinderTotal",l_OdeMassSetCylinderTotal);
05461     lua_register(L,"OdeMassSetBox",l_OdeMassSetBox);
05462     lua_register(L,"OdeMassSetBoxTotal",l_OdeMassSetBoxTotal);
05463     lua_register(L,"OdeMassSetTrimesh",l_OdeMassSetTrimesh);
05464     lua_register(L,"OdeMassAdjust",l_OdeMassAdjust);
05465     lua_register(L,"OdeMassTranslate",l_OdeMassTranslate);
05466     lua_register(L,"OdeMassAdd",l_OdeMassAdd);
05467     lua_register(L,"OdeWorldDestroy",l_OdeWorldDestroy);
05468     lua_register(L,"OdeWorldCreate",l_OdeWorldCreate);
05469     lua_register(L,"OdeWorldSetGravity",l_OdeWorldSetGravity);
05470     lua_register(L,"OdeWorldGetGravity",l_OdeWorldGetGravity);
05471     lua_register(L,"OdeWorldSetERP",l_OdeWorldSetERP);
05472     lua_register(L,"OdeWorldGetERP",l_OdeWorldGetERP);
05473     lua_register(L,"OdeWorldSetCFM",l_OdeWorldSetCFM);
05474     lua_register(L,"OdeWorldGetCFM",l_OdeWorldGetCFM);
05475     lua_register(L,"OdeWorldStep",l_OdeWorldStep);
05476     lua_register(L,"OdeWorldImpulseToForce",l_OdeWorldImpulseToForce);
05477     lua_register(L,"OdeWorldQuickStep",l_OdeWorldQuickStep);
05478     lua_register(L,"OdeWorldSetQuickStepNumIterations",l_OdeWorldSetQuickStepNumIterations);
05479     lua_register(L,"OdeWorldGetQuickStepNumIterations",l_OdeWorldGetQuickStepNumIterations);
05480     lua_register(L,"OdeWorldSetQuickStepW",l_OdeWorldSetQuickStepW);
05481     lua_register(L,"OdeWorldGetQuickStepW",l_OdeWorldGetQuickStepW);
05482     lua_register(L,"OdeWorldSetContactMaxCorrectingVel",l_OdeWorldSetContactMaxCorrectingVel);
05483     lua_register(L,"OdeWorldGetContactMaxCorrectingVel",l_OdeWorldGetContactMaxCorrectingVel);
05484     lua_register(L,"OdeWorldSetContactSurfaceLayer",l_OdeWorldSetContactSurfaceLayer);
05485     lua_register(L,"OdeWorldGetContactSurfaceLayer",l_OdeWorldGetContactSurfaceLayer);
05486     lua_register(L,"OdeWorldStepFast1",l_OdeWorldStepFast1);
05487     lua_register(L,"OdeWorldSetAutoEnableDepthSF1",l_OdeWorldSetAutoEnableDepthSF1);
05488     lua_register(L,"OdeWorldGetAutoEnableDepthSF1",l_OdeWorldGetAutoEnableDepthSF1);
05489     lua_register(L,"OdeWorldGetAutoDisableLinearThreshold",l_OdeWorldGetAutoDisableLinearThreshold);
05490     lua_register(L,"OdeWorldSetAutoDisableLinearThreshold",l_OdeWorldSetAutoDisableLinearThreshold);
05491     lua_register(L,"OdeWorldGetAutoDisableAngularThreshold",l_OdeWorldGetAutoDisableAngularThreshold);
05492     lua_register(L,"OdeWorldSetAutoDisableAngularThreshold",l_OdeWorldSetAutoDisableAngularThreshold);
05493     lua_register(L,"OdeWorldGetAutoDisableLinearAverageThreshold",l_OdeWorldGetAutoDisableLinearAverageThreshold);
05494     lua_register(L,"OdeWorldSetAutoDisableLinearAverageThreshold",l_OdeWorldSetAutoDisableLinearAverageThreshold);
05495     lua_register(L,"OdeWorldGetAutoDisableAngularAverageThreshold",l_OdeWorldGetAutoDisableAngularAverageThreshold);
05496     lua_register(L,"OdeWorldSetAutoDisableAngularAverageThreshold",l_OdeWorldSetAutoDisableAngularAverageThreshold);
05497     lua_register(L,"OdeWorldGetAutoDisableAverageSamplesCount",l_OdeWorldGetAutoDisableAverageSamplesCount);
05498     lua_register(L,"OdeWorldSetAutoDisableAverageSamplesCount",l_OdeWorldSetAutoDisableAverageSamplesCount);
05499     lua_register(L,"OdeWorldGetAutoDisableSteps",l_OdeWorldGetAutoDisableSteps);
05500     lua_register(L,"OdeWorldSetAutoDisableSteps",l_OdeWorldSetAutoDisableSteps);
05501     lua_register(L,"OdeWorldGetAutoDisableTime",l_OdeWorldGetAutoDisableTime);
05502     lua_register(L,"OdeWorldSetAutoDisableTime",l_OdeWorldSetAutoDisableTime);
05503     lua_register(L,"OdeWorldGetAutoDisableFlag",l_OdeWorldGetAutoDisableFlag);
05504     lua_register(L,"OdeWorldSetAutoDisableFlag",l_OdeWorldSetAutoDisableFlag);
05505     lua_register(L,"OdeBodyGetAutoDisableLinearThreshold",l_OdeBodyGetAutoDisableLinearThreshold);
05506     lua_register(L,"OdeBodySetAutoDisableLinearThreshold",l_OdeBodySetAutoDisableLinearThreshold);
05507     lua_register(L,"OdeBodyGetAutoDisableAngularThreshold",l_OdeBodyGetAutoDisableAngularThreshold);
05508     lua_register(L,"OdeBodySetAutoDisableAngularThreshold",l_OdeBodySetAutoDisableAngularThreshold);
05509     lua_register(L,"OdeBodyGetAutoDisableAverageSamplesCount",l_OdeBodyGetAutoDisableAverageSamplesCount);
05510     lua_register(L,"OdeBodySetAutoDisableAverageSamplesCount",l_OdeBodySetAutoDisableAverageSamplesCount);
05511     lua_register(L,"OdeBodyGetAutoDisableSteps",l_OdeBodyGetAutoDisableSteps);
05512     lua_register(L,"OdeBodySetAutoDisableSteps",l_OdeBodySetAutoDisableSteps);
05513     lua_register(L,"OdeBodyGetAutoDisableTime",l_OdeBodyGetAutoDisableTime);
05514     lua_register(L,"OdeBodySetAutoDisableTime",l_OdeBodySetAutoDisableTime);
05515     lua_register(L,"OdeBodyGetAutoDisableFlag",l_OdeBodyGetAutoDisableFlag);
05516     lua_register(L,"OdeBodySetAutoDisableFlag",l_OdeBodySetAutoDisableFlag);
05517     lua_register(L,"OdeBodySetAutoDisableDefaults",l_OdeBodySetAutoDisableDefaults);
05518     lua_register(L,"OdeBodyGetWorld",l_OdeBodyGetWorld);
05519     lua_register(L,"OdeBodyCreate",l_OdeBodyCreate);
05520     lua_register(L,"OdeBodyDestroy",l_OdeBodyDestroy);
05521     lua_register(L,"OdeBodySetData",l_OdeBodySetData);
05522     lua_register(L,"OdeBodyGetData",l_OdeBodyGetData);
05523     lua_register(L,"OdeBodySetPosition",l_OdeBodySetPosition);
05524     lua_register(L,"OdeBodySetQuaternion",l_OdeBodySetQuaternion);
05525     lua_register(L,"OdeBodySetLinearVel",l_OdeBodySetLinearVel);
05526     lua_register(L,"OdeBodySetAngularVel",l_OdeBodySetAngularVel);
05527     lua_register(L,"OdeBodyGetPosition",l_OdeBodyGetPosition);
05528     lua_register(L,"OdeBodyGetQuaternion",l_OdeBodyGetQuaternion);
05529     lua_register(L,"OdeBodyGetLinearVel",l_OdeBodyGetLinearVel);
05530     lua_register(L,"OdeBodyGetAngularVel",l_OdeBodyGetAngularVel);
05531     lua_register(L,"OdeBodySetMass",l_OdeBodySetMass);
05532     lua_register(L,"OdeBodyGetMass",l_OdeBodyGetMass);
05533     lua_register(L,"OdeBodyAddForce",l_OdeBodyAddForce);
05534     lua_register(L,"OdeBodyAddTorque",l_OdeBodyAddTorque);
05535     lua_register(L,"OdeBodyAddRelForce",l_OdeBodyAddRelForce);
05536     lua_register(L,"OdeBodyAddRelTorque",l_OdeBodyAddRelTorque);
05537     lua_register(L,"OdeBodyAddForceAtPos",l_OdeBodyAddForceAtPos);
05538     lua_register(L,"OdeBodyAddForceAtRelPos",l_OdeBodyAddForceAtRelPos);
05539     lua_register(L,"OdeBodyAddRelForceAtPos",l_OdeBodyAddRelForceAtPos);
05540     lua_register(L,"OdeBodyAddRelForceAtRelPos",l_OdeBodyAddRelForceAtRelPos);
05541     lua_register(L,"OdeBodyGetForce",l_OdeBodyGetForce);
05542     lua_register(L,"OdeBodyGetTorque",l_OdeBodyGetTorque);
05543     lua_register(L,"OdeBodySetForce",l_OdeBodySetForce);
05544     lua_register(L,"OdeBodySetTorque",l_OdeBodySetTorque);
05545     lua_register(L,"OdeBodyGetRelPointPos",l_OdeBodyGetRelPointPos);
05546     lua_register(L,"OdeBodyGetRelPointVel",l_OdeBodyGetRelPointVel);
05547     lua_register(L,"OdeBodyGetPointVel",l_OdeBodyGetPointVel);
05548     lua_register(L,"OdeBodyGetPosRelPoint",l_OdeBodyGetPosRelPoint);
05549     lua_register(L,"OdeBodyVectorToWorld",l_OdeBodyVectorToWorld);
05550     lua_register(L,"OdeBodyVectorFromWorld",l_OdeBodyVectorFromWorld);
05551     lua_register(L,"OdeBodySetFiniteRotationMode",l_OdeBodySetFiniteRotationMode);
05552     lua_register(L,"OdeBodySetFiniteRotationAxis",l_OdeBodySetFiniteRotationAxis);
05553     lua_register(L,"OdeBodyGetFiniteRotationMode",l_OdeBodyGetFiniteRotationMode);
05554     lua_register(L,"OdeBodyGetFiniteRotationAxis",l_OdeBodyGetFiniteRotationAxis);
05555     lua_register(L,"OdeBodyGetNumJoints",l_OdeBodyGetNumJoints);
05556     lua_register(L,"OdeBodyGetJoint",l_OdeBodyGetJoint);
05557     lua_register(L,"OdeBodyEnable",l_OdeBodyEnable);
05558     lua_register(L,"OdeBodyDisable",l_OdeBodyDisable);
05559     lua_register(L,"OdeBodyIsEnabled",l_OdeBodyIsEnabled);
05560     lua_register(L,"OdeBodySetGravityMode",l_OdeBodySetGravityMode);
05561     lua_register(L,"OdeBodyGetGravityMode",l_OdeBodyGetGravityMode);
05562     lua_register(L,"OdeJointCreateBall",l_OdeJointCreateBall);
05563     lua_register(L,"OdeJointCreateHinge",l_OdeJointCreateHinge);
05564     lua_register(L,"OdeJointCreateSlider",l_OdeJointCreateSlider);
05565     lua_register(L,"OdeJointCreateContact",l_OdeJointCreateContact);
05566     lua_register(L,"OdeJointCreateHinge2",l_OdeJointCreateHinge2);
05567     lua_register(L,"OdeJointCreateUniversal",l_OdeJointCreateUniversal);
05568     lua_register(L,"OdeJointCreatePR",l_OdeJointCreatePR);
05569     lua_register(L,"OdeJointCreateFixed",l_OdeJointCreateFixed);
05570     lua_register(L,"OdeJointCreateNull",l_OdeJointCreateNull);
05571     lua_register(L,"OdeJointCreateAMotor",l_OdeJointCreateAMotor);
05572     lua_register(L,"OdeJointCreateLMotor",l_OdeJointCreateLMotor);
05573     lua_register(L,"OdeJointCreatePlane2D",l_OdeJointCreatePlane2D);
05574     lua_register(L,"OdeJointDestroy",l_OdeJointDestroy);
05575     lua_register(L,"OdeJointGroupCreate",l_OdeJointGroupCreate);
05576     lua_register(L,"OdeJointGroupDestroy",l_OdeJointGroupDestroy);
05577     lua_register(L,"OdeJointGroupEmpty",l_OdeJointGroupEmpty);
05578     lua_register(L,"OdeJointAttach",l_OdeJointAttach);
05579     lua_register(L,"OdeJointSetData",l_OdeJointSetData);
05580     lua_register(L,"OdedJointGetData",l_OdedJointGetData);
05581     lua_register(L,"OdeJointGetType",l_OdeJointGetType);
05582     lua_register(L,"OdeJointGetBody",l_OdeJointGetBody);
05583     lua_register(L,"OdeJointSetFeedback",l_OdeJointSetFeedback);
05584     lua_register(L,"OdeJointFeedbackCreate",l_OdeJointFeedbackCreate);
05585     lua_register(L,"OdeJointFeedbackDestroy",l_OdeJointFeedbackDestroy);
05586     lua_register(L,"OdeJointGetFeedback",l_OdeJointGetFeedback);
05587     lua_register(L,"OdeJointSetBallAnchor",l_OdeJointSetBallAnchor);
05588     lua_register(L,"OdeJointSetBallAnchor2",l_OdeJointSetBallAnchor2);
05589     lua_register(L,"OdeJointSetHingeAnchor",l_OdeJointSetHingeAnchor);
05590     lua_register(L,"OdeJointSetHingeAnchorDelta",l_OdeJointSetHingeAnchorDelta);
05591     lua_register(L,"OdeJointSetHingeAxis",l_OdeJointSetHingeAxis);
05592     lua_register(L,"OdeJointSetHingeParam",l_OdeJointSetHingeParam);
05593     lua_register(L,"OdeJointAddHingeTorque",l_OdeJointAddHingeTorque);
05594     lua_register(L,"OdeJointSetSliderAxis",l_OdeJointSetSliderAxis);
05595     lua_register(L,"OdeJointSetSliderAxisDelta",l_OdeJointSetSliderAxisDelta);
05596     lua_register(L,"OdeJointSetSliderParam",l_OdeJointSetSliderParam);
05597     lua_register(L,"OdeJointAddSliderForce",l_OdeJointAddSliderForce);
05598     lua_register(L,"OdeJointSetHinge2Anchor",l_OdeJointSetHinge2Anchor);
05599     lua_register(L,"OdeJointSetHinge2Axis1",l_OdeJointSetHinge2Axis1);
05600     lua_register(L,"OdeJointSetHinge2Axis2",l_OdeJointSetHinge2Axis2);
05601     lua_register(L,"OdeJointSetHinge2Param",l_OdeJointSetHinge2Param);
05602     lua_register(L,"OdeJointAddHinge2Torques",l_OdeJointAddHinge2Torques);
05603     lua_register(L,"OdeJointSetUniversalAnchor",l_OdeJointSetUniversalAnchor);
05604     lua_register(L,"OdeJointSetUniversalAxis1",l_OdeJointSetUniversalAxis1);
05605     lua_register(L,"OdeJointSetUniversalAxis2",l_OdeJointSetUniversalAxis2);
05606     lua_register(L,"OdeJointSetUniversalParam",l_OdeJointSetUniversalParam);
05607     lua_register(L,"OdeJointAddUniversalTorques",l_OdeJointAddUniversalTorques);
05608     lua_register(L,"OdeJointSetPRAnchor",l_OdeJointSetPRAnchor);
05609     lua_register(L,"OdeJointSetPRAxis1",l_OdeJointSetPRAxis1);
05610     lua_register(L,"OdeJointSetPRAxis2",l_OdeJointSetPRAxis2);
05611     lua_register(L,"OdeJointSetPRParam",l_OdeJointSetPRParam);
05612     lua_register(L,"OdeJointAddPRTorque",l_OdeJointAddPRTorque);
05613     lua_register(L,"OdeJointSetFixed",l_OdeJointSetFixed);
05614     lua_register(L,"OdeJointSetAMotorNumAxes",l_OdeJointSetAMotorNumAxes);
05615     lua_register(L,"OdeJointSetAMotorAxis",l_OdeJointSetAMotorAxis);
05616     lua_register(L,"OdeJointSetAMotorAngle",l_OdeJointSetAMotorAngle);
05617     lua_register(L,"OdeJointSetAMotorParam",l_OdeJointSetAMotorParam);
05618     lua_register(L,"OdeJointSetAMotorMode",l_OdeJointSetAMotorMode);
05619     lua_register(L,"OdeJointAddAMotorTorques",l_OdeJointAddAMotorTorques);
05620     lua_register(L,"OdeJointSetLMotorNumAxes",l_OdeJointSetLMotorNumAxes);
05621     lua_register(L,"OdeJointSetLMotorAxis",l_OdeJointSetLMotorAxis);
05622     lua_register(L,"OdeJointSetLMotorParam",l_OdeJointSetLMotorParam);
05623     lua_register(L,"OdeJointSetPlane2DXParam",l_OdeJointSetPlane2DXParam);
05624     lua_register(L,"OdeJointSetPlane2DYParam",l_OdeJointSetPlane2DYParam);
05625     lua_register(L,"OdeJointSetPlane2DAngleParam",l_OdeJointSetPlane2DAngleParam);
05626     lua_register(L,"OdeJointGetBallAnchor",l_OdeJointGetBallAnchor);
05627     lua_register(L,"OdeJointGetBallAnchor2",l_OdeJointGetBallAnchor2);
05628     lua_register(L,"OdeJointGetHingeAnchor",l_OdeJointGetHingeAnchor);
05629     lua_register(L,"OdeJointGetHingeAnchor2",l_OdeJointGetHingeAnchor2);
05630     lua_register(L,"OdeJointGetHingeAxis",l_OdeJointGetHingeAxis);
05631     lua_register(L,"OdeJointGetHingeParam",l_OdeJointGetHingeParam);
05632     lua_register(L,"OdeJointGetHingeAngle",l_OdeJointGetHingeAngle);
05633     lua_register(L,"OdeJointGetHingeAngleRate",l_OdeJointGetHingeAngleRate);
05634     lua_register(L,"OdeJointGetSliderPosition",l_OdeJointGetSliderPosition);
05635     lua_register(L,"OdeJointGetSliderPositionRate",l_OdeJointGetSliderPositionRate);
05636     lua_register(L,"OdeJointGetSliderAxis",l_OdeJointGetSliderAxis);
05637     lua_register(L,"OdeJointGetSliderParam",l_OdeJointGetSliderParam);
05638     lua_register(L,"OdeJointGetHinge2Anchor",l_OdeJointGetHinge2Anchor);
05639     lua_register(L,"OdeJointGetHinge2Anchor2",l_OdeJointGetHinge2Anchor2);
05640     lua_register(L,"OdeJointGetHinge2Axis1",l_OdeJointGetHinge2Axis1);
05641     lua_register(L,"OdeJointGetHinge2Axis2",l_OdeJointGetHinge2Axis2);
05642     lua_register(L,"OdeJointGetHinge2Param",l_OdeJointGetHinge2Param);
05643     lua_register(L,"OdeJointGetHinge2Angle1",l_OdeJointGetHinge2Angle1);
05644     lua_register(L,"OdeJointGetHinge2Angle1Rate",l_OdeJointGetHinge2Angle1Rate);
05645     lua_register(L,"OdeJointGetHinge2Angle2Rate",l_OdeJointGetHinge2Angle2Rate);
05646     lua_register(L,"OdeJointGetUniversalAnchor",l_OdeJointGetUniversalAnchor);
05647     lua_register(L,"OdeJointGetUniversalAnchor2",l_OdeJointGetUniversalAnchor2);
05648     lua_register(L,"OdeJointGetUniversalAxis1",l_OdeJointGetUniversalAxis1);
05649     lua_register(L,"OdeJointGetUniversalAxis2",l_OdeJointGetUniversalAxis2);
05650     lua_register(L,"OdeJointGetUniversalParam",l_OdeJointGetUniversalParam);
05651     lua_register(L,"OdeJointGetUniversalAngles",l_OdeJointGetUniversalAngles);
05652     lua_register(L,"OdeJointGetUniversalAngle1",l_OdeJointGetUniversalAngle1);
05653     lua_register(L,"OdeJointGetUniversalAngle2",l_OdeJointGetUniversalAngle2);
05654     lua_register(L,"OdeJointGetUniversalAngle1Rate",l_OdeJointGetUniversalAngle1Rate);
05655     lua_register(L,"OdeJointGetUniversalAngle2Rate",l_OdeJointGetUniversalAngle2Rate);
05656     lua_register(L,"OdeJointGetPRAnchor",l_OdeJointGetPRAnchor);
05657     lua_register(L,"OdeJointGetPRPosition",l_OdeJointGetPRPosition);
05658     lua_register(L,"OdeJointGetPRPositionRate",l_OdeJointGetPRPositionRate);
05659     lua_register(L,"OdeJointGetPRAxis1",l_OdeJointGetPRAxis1);
05660     lua_register(L,"OdeJointGetPRAxis2",l_OdeJointGetPRAxis2);
05661     lua_register(L,"OdeJointGetPRParam",l_OdeJointGetPRParam);
05662     lua_register(L,"OdeJointGetAMotorNumAxes",l_OdeJointGetAMotorNumAxes);
05663     lua_register(L,"OdeJointGetAMotorAxis",l_OdeJointGetAMotorAxis);
05664     lua_register(L,"OdeJointGetAMotorAxisRel",l_OdeJointGetAMotorAxisRel);
05665     lua_register(L,"OdeJointGetAMotorAngle",l_OdeJointGetAMotorAngle);
05666     lua_register(L,"OdeJointGetAMotorAngleRate",l_OdeJointGetAMotorAngleRate);
05667     lua_register(L,"OdeJointGetAMotorParam",l_OdeJointGetAMotorParam);
05668     lua_register(L,"OdeJointGetAMotorMode",l_OdeJointGetAMotorMode);
05669     lua_register(L,"OdeJointGetLMotorNumAxes",l_OdeJointGetLMotorNumAxes);
05670     lua_register(L,"OdeJointGetLMotorAxis",l_OdeJointGetLMotorAxis);
05671     lua_register(L,"OdeJointGetLMotorParam",l_OdeJointGetLMotorParam);
05672     lua_register(L,"OdeConnectingJoint",l_OdeConnectingJoint);
05673     lua_register(L,"OdeConnectingJointList",l_OdeConnectingJointList);
05674     lua_register(L,"OdeAreConnected",l_OdeAreConnected);
05675     lua_register(L,"OdeAreConnectedExcluding",l_OdeAreConnectedExcluding);
05676     lua_register(L,"OdeStopwatchCreate",l_OdeStopwatchCreate);
05677     lua_register(L,"OdeStopwatchDestroy",l_OdeStopwatchDestroy);
05678     lua_register(L,"OdeStopwatchReset",l_OdeStopwatchReset);
05679     lua_register(L,"OdeStopwatchStart",l_OdeStopwatchStart);
05680     lua_register(L,"OdeStopwatchStop",l_OdeStopwatchStop);
05681     lua_register(L,"OdeStopwatchTime",l_OdeStopwatchTime);
05682     lua_register(L,"OdeTimerStart",l_OdeTimerStart);
05683     lua_register(L,"OdeTimerNow",l_OdeTimerNow);
05684     lua_register(L,"OdeTimerEnd",l_OdeTimerEnd);
05685     lua_register(L,"OdeTimerTicksPerSecond",l_OdeTimerTicksPerSecond);
05686     lua_register(L,"OdeTimerResolution",l_OdeTimerResolution);
05687     lua_register(L,"OdeContactGeomCreate",l_OdeContactGeomCreate);
05688     lua_register(L,"OdeContactGeomDestroy",l_OdeContactGeomDestroy);
05689     lua_register(L,"OdeGeomDestroy",l_OdeGeomDestroy);
05690     lua_register(L,"OdeContactGeomGetParams",l_OdeContactGeomGetParams);
05691     lua_register(L,"OdeTriMeshRawDataCreate",l_OdeTriMeshRawDataCreate);
05692     lua_register(L,"OdeTriMeshRawDataDestroy",l_OdeTriMeshRawDataDestroy);
05693     lua_register(L,"OdeTriMeshRawDataPrint",l_OdeTriMeshRawDataPrint);
05694     lua_register(L,"OdeGeomHeightfieldDataBuildFromFun",l_OdeGeomHeightfieldDataBuildFromFun);
05695     lua_register(L,"OdeGeomHeightfieldDataCreate",l_OdeGeomHeightfieldDataCreate);
05696     lua_register(L,"OdeGetContactSurface",l_OdeGetContactSurface);
05697     lua_register(L,"OdeSetContactSurface",l_OdeSetContactSurface);
05698     lua_register(L,"OdeGetContactGeom",l_OdeGetContactGeom);
05699     lua_register(L,"OdeSetContactGeom",l_OdeSetContactGeom);
05700 }
05701 
05702 #endif

Generated on Wed May 23 06:00:15 2012 for cpp by  doxygen 1.5.6