From 3d60e1432ec43ade4aa61b5a70dd6b8975417e9f Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 24 Apr 2019 21:16:08 -0400 Subject: updates --- src/shared/lua_api/phys/bphysbox.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/shared/lua_api/phys/bphysbox.cpp') diff --git a/src/shared/lua_api/phys/bphysbox.cpp b/src/shared/lua_api/phys/bphysbox.cpp index 94b025e..a0ad15a 100644 --- a/src/shared/lua_api/phys/bphysbox.cpp +++ b/src/shared/lua_api/phys/bphysbox.cpp @@ -94,7 +94,15 @@ int newbphysbox(lua_State* L){ lua_pop(L,1); lua_newtable(L);//{} lua_pushlightuserdata(L,r);//ud_btRigidBody - lua_setfield(L,-2,"rigidbody");//{} + lua_setfield(L,-2,"collider");//{} + + //Add it to the global list of colliders + lua_getglobal(L,"phys");//{rb},{phys} + lua_getfield(L,-1,"colliders");//{rb},{phys},{phys.colliders} + lua_pushlightuserdata(L,r);//{rb},{phys},{phys.colliders},ud_collider + lua_pushvalue(L,-4);//{rb},{phys},{phys.colliders},ud_collider,{rb} + lua_settable(L,-3);//{rb},{phys},{phys.colliders} + lua_pop(L,2);//{rb} //Set it's metatable luaL_getmetatable(L, "phys.physbox");//{},{phys.physbox} -- cgit v1.2.3-70-g09d2