aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/phys/cbphysbox.cpp
diff options
context:
space:
mode:
authorAlexander Pickering <alex@cogarr.net>2018-11-01 13:53:16 -0400
committerAlexander Pickering <alex@cogarr.net>2018-11-01 13:53:16 -0400
commit112517494847f0c86f58544cbf4c35c9b7712ab1 (patch)
tree115d9ae3da8028e67e498ed8c587d14972b7699b /src/client/lua_api/phys/cbphysbox.cpp
parent77b26fba6e78ac4af2b28b3bbb4646dea5682ed1 (diff)
downloadbrokengine-112517494847f0c86f58544cbf4c35c9b7712ab1.tar.gz
brokengine-112517494847f0c86f58544cbf4c35c9b7712ab1.tar.bz2
brokengine-112517494847f0c86f58544cbf4c35c9b7712ab1.zip
Refactored code and added library
Physics code for models now lives in the shared directory. To get file loading without irrlicht, a single-file header library (lib/tinyobjloader-c) was added. Metatables for generics and physics generics have also been seperated out.
Diffstat (limited to 'src/client/lua_api/phys/cbphysbox.cpp')
-rw-r--r--src/client/lua_api/phys/cbphysbox.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/lua_api/phys/cbphysbox.cpp b/src/client/lua_api/phys/cbphysbox.cpp
index 578fc8d..86deacf 100644
--- a/src/client/lua_api/phys/cbphysbox.cpp
+++ b/src/client/lua_api/phys/cbphysbox.cpp
@@ -16,7 +16,7 @@ extern "C" {
#include "../scene/igeneric.hpp"
#include <shared/lua_api/common.hpp>
-#include "bphysgeneric.hpp"
+#include <shared/lua_api/phys/bphysgeneric.hpp>
using namespace irr;
using namespace scene;
@@ -146,11 +146,11 @@ int cbsetmaterial(lua_State* L){
}
static const luaL_reg cbphysbox_m[] = {
- {"setcpos", cbphyssetpos},//overload
- {"getcpos", cbphysgetpos},
- {"getgravity", cbphysgetgravity},
- {"applygravity",cbphysapplygravity},
- {"setMaterial", cbsetmaterial},
+ {"setpos", cbphyssetpos},//overload
+ {"getpos", cbphysgetpos},
+ //{"getgravity", cbphysgetgravity},
+ //{"applygravity",cbphysapplygravity},
+ //{"setMaterial", cbsetmaterial},
// {"delete", delbphysbox},//client side delete needs to delete the visual representation
{0, 0},
};
@@ -166,6 +166,7 @@ void cbphysbox_register(lua_State* L){
luaL_getmetatable(L,"phys.physbox");//phys.physbox
lua_newtable(L);//phys.physbox,{}
luaL_register(L,NULL,brigidbody_m);
+ luaL_register(L,NULL,igeneric_m);
luaL_register(L,NULL,cbphysbox_m);//phys.physbox,{}
lua_setfield(L,-2,"__index");//phys.physbox