extern "C" { #include #include #include } #include #include #include "bcollider.hpp" /*Collider things from lua have the form of: { type = "ghost" | "multi" | "rigidbody" | "softbody" collider = ud_btCollisionObject, node = ud_ISceneNode, --Optional, on client } */ btCollisionObject* popCollider(lua_State *L){ lua_getfield(L,-1,"collider"); btCollisionObject *r = (btCollisionObject*)lua_touserdata(L,-1); lua_pop(L,2); return r; } /*** Activates this object. If this object was sleeping, it will move again. If you are using applyforce or setvelocity, you will need to activate() the rigidbody for it to move. @function collider:activate() */ //collider:activate() int activate(lua_State *L){ btCollisionObject *r = popCollider(L); r->activate(); return 0; } extern const luaL_reg bcollider_m[] = { {"activate", activate}, {NULL, NULL} };