diff options
| author | Alexander Pickering <alex@cogarr.net> | 2018-11-07 14:49:35 -0500 |
|---|---|---|
| committer | Alexander Pickering <alex@cogarr.net> | 2018-11-07 14:50:58 -0500 |
| commit | 2009501214f3c2e3f8d8b1a06432afdf39276bd5 (patch) | |
| tree | c6c091a4b6f3f714657930cda4fd485ee1dd3d95 /src/client/main.cpp | |
| parent | 112517494847f0c86f58544cbf4c35c9b7712ab1 (diff) | |
| download | brokengine-2009501214f3c2e3f8d8b1a06432afdf39276bd5.tar.gz brokengine-2009501214f3c2e3f8d8b1a06432afdf39276bd5.tar.bz2 brokengine-2009501214f3c2e3f8d8b1a06432afdf39276bd5.zip | |
Added Kinematic Character Controllers
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"); |
