aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/phys/butil.cpp
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-07-15 11:35:44 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2017-07-15 11:35:44 -0400
commitfa49161fe2d7e0a025c9fd8559815d56dfd1f427 (patch)
treecb3a64e2d45ff9f675c256a94f5c1ccb01ec5a09 /src/client/lua_api/phys/butil.cpp
parentb98dbac4ed2f755ce71bd9be17f26a3f86c1e3cc (diff)
downloadbrokengine-fa49161fe2d7e0a025c9fd8559815d56dfd1f427.tar.gz
brokengine-fa49161fe2d7e0a025c9fd8559815d56dfd1f427.tar.bz2
brokengine-fa49161fe2d7e0a025c9fd8559815d56dfd1f427.zip
Added static physics things
Added some phyics stuff! woo! * Added physics models from file * Added physics boxes * Added a maya camera * Added lights * Various refactoring
Diffstat (limited to 'src/client/lua_api/phys/butil.cpp')
-rw-r--r--src/client/lua_api/phys/butil.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/client/lua_api/phys/butil.cpp b/src/client/lua_api/phys/butil.cpp
new file mode 100644
index 0000000..6319688
--- /dev/null
+++ b/src/client/lua_api/phys/butil.cpp
@@ -0,0 +1,26 @@
+#include <stdio.h>
+
+extern "C" {
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <lualib.h>
+}
+
+#include <btBulletDynamicsCommon.h>
+
+#include "butil.hpp"
+
+btVector3 lua_popbtvector(lua_State* L,int pos){
+ f32 p[3];
+
+ for(int i = 0; i < 3; i++){
+ lua_pushnumber(L,i+1);
+ lua_gettable(L,pos);
+ p[i] = (f32) lua_tonumber(L,-1);
+ lua_pop(L,1);
+ }
+
+ printf("Found vector (%f,%f,%f)\n",p[0],p[1],p[2]);
+
+ return btVector3(p[0],p[1],p[2]);
+}