From b3f11542d202bafced2c0e91dfbc913a695df91b Mon Sep 17 00:00:00 2001 From: Steffen Date: Sat, 17 Jan 2015 13:11:43 +0100 Subject: [PATCH] Removed the lua state from the physics. --- level.cc | 2 +- physics.cc | 11 +---------- physics.hh | 9 +-------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/level.cc b/level.cc index 4a091df..19d5d53 100644 --- a/level.cc +++ b/level.cc @@ -69,7 +69,7 @@ void Level::load() { this->physics = Physics(); - this->physics.init(L); + this->physics.init(); // currently hard coded should later read this stuff out of a file this->camera = Camera(glm::vec2(-0.8f, 0.0f), 3.0f); diff --git a/physics.cc b/physics.cc index d196ea6..7e4d166 100644 --- a/physics.cc +++ b/physics.cc @@ -8,7 +8,7 @@ Physics::Physics() { Physics::~Physics() { } -void Physics::init(lua_State* L) +void Physics::init() { colConfig = new btDefaultCollisionConfiguration(); dispatcher = new btCollisionDispatcher(colConfig); @@ -16,15 +16,6 @@ void Physics::init(lua_State* L) solver = new btSequentialImpulseConstraintSolver(); world = new btDiscreteDynamicsWorld(dispatcher,broadphase,solver,colConfig); world->setGravity(btVector3(0,-10,-0)); - - //Expose the class Physics and its functions - luabridge::getGlobalNamespace(L) - .beginClass("Physics") - //.addFunction("", &Physics::) - .endClass(); - //Push the physics to Lua as a global variable - luabridge::push(L, this); - lua_setglobal(L, "physics"); } void Physics::takeUpdateStep(float timeDiff) diff --git a/physics.hh b/physics.hh index c3eedcd..ec94bdd 100644 --- a/physics.hh +++ b/physics.hh @@ -7,13 +7,6 @@ #include #include -extern "C" { -#include "extern/lua/src/lua.h" -#include "extern/lua/src/lualib.h" -#include "extern/lua/src/lauxlib.h" -} -#include "extern/luabridge/LuaBridge.h" - #include "entity.hh" #include "extern/bullet/src/BulletDynamics/Dynamics/btRigidBody.h" @@ -51,7 +44,7 @@ class Physics { public: Physics(); ~Physics(); - void init(lua_State* L); + void init(); void takeUpdateStep(float timeDiff); //must be used in level.update to proagate the physics void rollForward(glm::vec3 camPos, float strength); //self explainitory void rollLeft(glm::vec3 camPos, float strength);