aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/load_cphys.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/lua_api/load_cphys.cpp')
-rw-r--r--src/client/lua_api/load_cphys.cpp13
1 files changed, 11 insertions, 2 deletions
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 <stdlib.h>
#include <vector>
#include <map>
+#include <assert.h>
extern "C" {
#include <lua.h>
#include <lauxlib.h>
@@ -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);
}