From 0d2de2ba9c616862d7881f089382db772d034f89 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 27 Oct 2019 17:25:16 -0400 Subject: Various updates --- src/client/lua_api/load_cphys.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/client/lua_api/load_cphys.cpp') diff --git a/src/client/lua_api/load_cphys.cpp b/src/client/lua_api/load_cphys.cpp index 92eaff0..2e2d18a 100644 --- a/src/client/lua_api/load_cphys.cpp +++ b/src/client/lua_api/load_cphys.cpp @@ -2,6 +2,7 @@ #include #include #include +#include extern "C" { #include #include @@ -31,8 +32,8 @@ extern btBroadphaseInterface *BroadPhase; int raytest(lua_State *L){ double fx,fy,fz; double tx,ty,tz; - popvector3d(L, &fx, &fy, &fz); popvector3d(L, &tx, &ty, &tz); + popvector3d(L, &fx, &fy, &fz); btVector3 from(fx, fy, fz); btVector3 to(tx, ty, tz); @@ -44,15 +45,23 @@ int raytest(lua_State *L){ } void load_cphysfuncs(lua_State* L){ - + assert(lua_gettop(L) == 0); + printf("Registering cphysbox\n"); //phys things + assert(lua_gettop(L) == 0); cbphysbox_register(L); + assert(lua_gettop(L) == 0); cbcharactercontroller_register(L); + assert(lua_gettop(L) == 0); cbphysmodel_register(L); + assert(lua_gettop(L) == 0); bghostobject_register(L); + assert(lua_gettop(L) == 0); + assert(lua_gettop(L) == 0); lua_getglobal(L,"phys");//{} lua_pushcfunction(L,raytest);//{},raytest() lua_setfield(L,-2,"raytest");//{} lua_pop(L,1); + assert(lua_gettop(L) == 0); } -- cgit v1.2.3-70-g09d2