aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/phys
diff options
context:
space:
mode:
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);