aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/phys
diff options
context:
space:
mode:
authorAlexander <alex@cogarr.net>2020-05-18 13:41:40 -0400
committerAlexander <alex@cogarr.net>2020-05-18 13:41:40 -0400
commit355589a9100c7d08fdc4094ad32eb9852c88fcc4 (patch)
tree9e2d2ce6b736539907fc06fc3acc2c23daadafac /src/client/lua_api/phys
parent377ca5d31a35009913a795c8542659e4872d7c35 (diff)
downloadbrokengine-355589a9100c7d08fdc4094ad32eb9852c88fcc4.tar.gz
brokengine-355589a9100c7d08fdc4094ad32eb9852c88fcc4.tar.bz2
brokengine-355589a9100c7d08fdc4094ad32eb9852c88fcc4.zip
various updates
Diffstat (limited to 'src/client/lua_api/phys')
-rw-r--r--src/client/lua_api/phys/cbcharactercontroller.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/lua_api/phys/cbcharactercontroller.cpp b/src/client/lua_api/phys/cbcharactercontroller.cpp
index 16ad1ad..f93d01a 100644
--- a/src/client/lua_api/phys/cbcharactercontroller.cpp
+++ b/src/client/lua_api/phys/cbcharactercontroller.cpp
@@ -9,6 +9,7 @@ extern "C" {
#include <btBulletDynamicsCommon.h>
#include <BulletDynamics/Character/btKinematicCharacterController.h>
+#include <BulletCollision/CollisionDispatch/btGhostObject.h>
#include <irrlicht.h>
#include "cbphysbox.hpp"
#include "../scene/imesh.hpp"
@@ -49,6 +50,7 @@ static int newcbcharactercontroller(lua_State* L){//
ISceneNode* n = (ISceneNode*)lua_touserdata(L,-1);//ud_iscenenode
lua_pop(L,1);
+ cc->getGhostObject()->setUserPointer(n);
//cc->setUserPointer(n);//TODO: what does this break?
lua_newtable(L);//{}
@@ -56,6 +58,8 @@ static int newcbcharactercontroller(lua_State* L){//
lua_setfield(L,-2,"character");//{}
lua_pushlightuserdata(L,n);//{},ud_iscenenode
lua_setfield(L,-2,"node");//{}
+ lua_pushstring(L,"character");
+ lua_setfield(L,-2,"type");
luaL_getmetatable(L,"phys.charactercontroller");//{},{phys.charactercontroller}
lua_setmetatable(L,-2);//{}
@@ -102,12 +106,13 @@ void cbcharactercontroller_register(lua_State* L){
lua_setfield(L,-2,"newccharactercontroller");//{}
lua_pop(L,1);//
-
+
luaL_getmetatable(L,"phys.charactercontroller");//phys.physbox
lua_newtable(L);//phys.physbox,{}
- luaL_register(L,NULL,brigidbody_m);
+ //luaL_register(L,NULL,brigidbody_m);
luaL_register(L,NULL,igeneric_m);
luaL_register(L,NULL,cbcharactercontroller_m);//phys.physbox,{}
+ luaL_register(L,NULL,bcharactercontroller_m);
lua_setfield(L,-2,"__index");//phys.physbox
lua_pop(L,1);