diff options
Diffstat (limited to 'src/client/main.cpp')
| -rw-r--r-- | src/client/main.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
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"); |
