aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/lua_api/load_cphys.cpp4
-rw-r--r--src/client/lua_api/load_cphys.hpp2
-rw-r--r--src/client/main.cpp14
3 files changed, 14 insertions, 6 deletions
diff --git a/src/client/lua_api/load_cphys.cpp b/src/client/lua_api/load_cphys.cpp
index b38b84d..ed81408 100644
--- a/src/client/lua_api/load_cphys.cpp
+++ b/src/client/lua_api/load_cphys.cpp
@@ -40,9 +40,7 @@ int raytest(lua_State *L){
return 1;
}
-void load_physfuncs(lua_State* L){
- lua_newtable(L);//{}
- lua_setglobal(L,"phys");//
+void load_cphysfuncs(lua_State* L){
//phys things
cbphysbox_register(L);
diff --git a/src/client/lua_api/load_cphys.hpp b/src/client/lua_api/load_cphys.hpp
index 7ee07fe..5afd102 100644
--- a/src/client/lua_api/load_cphys.hpp
+++ b/src/client/lua_api/load_cphys.hpp
@@ -10,5 +10,5 @@ extern "C" {
}
#include <irrlicht.h>
-void load_physfuncs(lua_State* L);
+void load_cphysfuncs(lua_State* L);
#endif
diff --git a/src/client/main.cpp b/src/client/main.cpp
index bc509c7..e8533d8 100644
--- a/src/client/main.cpp
+++ b/src/client/main.cpp
@@ -10,6 +10,7 @@ extern "C" {
#include <chrono>
#include <btBulletDynamicsCommon.h>
+#include <btBulletCollisionCommon.h>
#include <cstdlib>
#include "initdevice.hpp"
@@ -20,6 +21,7 @@ extern "C" {
#include "lua_api/load_cphys.hpp"
#include "lua_api/load_video.hpp"
#include "lua_api/load_io.hpp"
+#include <shared/lua_api/load_phys.hpp>
#include "callbackhandeler.hpp"
#include <shared/lua_api/common.hpp>
@@ -49,6 +51,7 @@ void loadIrrLibs(lua_State* L, IrrlichtDevice* device){
printf("[OK]\n");
printf("Loading physfuncs...");
load_physfuncs(L);
+ load_cphysfuncs(L);
printf("[OK]\n");
printf("Loading videofuncs...");
load_videofuncs(L);
@@ -56,12 +59,18 @@ void loadIrrLibs(lua_State* L, IrrlichtDevice* device){
load_iofuncs(L);
}
-void RemoveISceneNode(btRigidBody* rb){
+void dropRigidBody(btRigidBody* rb){
ISceneNode *Node = static_cast<ISceneNode*>(rb->getUserPointer());
if(Node)
Node->remove();
}
+void dropChar(btKinematicCharacterController *a){
+ ISceneNode *node = (ISceneNode*)a->getGhostObject()->getUserPointer();
+ if(node)
+ node->remove();
+}
+
// Converts a quaternion to an euler angle
void QuaternionToEuler(const btQuaternion &TQuat, btVector3 &TEuler) {
btScalar W = TQuat.getW();
@@ -202,7 +211,8 @@ int main(int argc, char *argv[]){
lua_pop(state,2);
}
}
- phys_shutdown(RemoveISceneNode);
+ //phys_shutdown(RemoveISceneNode);
+ phys_shutdown();
device->drop();
printf("Goodbye\n");