diff options
| author | Alexander <alex@cogarr.net> | 2019-04-24 21:16:08 -0400 |
|---|---|---|
| committer | Alexander <alex@cogarr.net> | 2019-04-24 21:16:08 -0400 |
| commit | 3d60e1432ec43ade4aa61b5a70dd6b8975417e9f (patch) | |
| tree | 954719a0f4a27fe42f9d8113844a21b79ae70f5d /src/shared/lua_api/phys/bphysbox.cpp | |
| parent | 42bedce123739287339a95626675ffda3a1ce8e7 (diff) | |
| download | brokengine-3d60e1432ec43ade4aa61b5a70dd6b8975417e9f.tar.gz brokengine-3d60e1432ec43ade4aa61b5a70dd6b8975417e9f.tar.bz2 brokengine-3d60e1432ec43ade4aa61b5a70dd6b8975417e9f.zip | |
updates
Diffstat (limited to 'src/shared/lua_api/phys/bphysbox.cpp')
| -rw-r--r-- | src/shared/lua_api/phys/bphysbox.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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} |
