aboutsummaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-06-22 12:38:38 -0600
committerAlexander Pickering <alexandermpickering@gmail.com>2018-06-22 12:38:38 -0600
commit9fa5dcc9310a8c6ff8c77a47a86303f7b950dcf3 (patch)
treed7956fc8aabef903f354578d69d4d7fdf64ec928 /src/shared
parent06d3e8182d018ca613f177f6ff7a3bbb6494cc79 (diff)
downloadbrokengine-9fa5dcc9310a8c6ff8c77a47a86303f7b950dcf3.tar.gz
brokengine-9fa5dcc9310a8c6ff8c77a47a86303f7b950dcf3.tar.bz2
brokengine-9fa5dcc9310a8c6ff8c77a47a86303f7b950dcf3.zip
Updated core
Updated all core files to prepare for tech demo
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/lua_api/phys/bphysbox.cpp22
-rw-r--r--src/shared/phys/physcommon.cpp12
2 files changed, 17 insertions, 17 deletions
diff --git a/src/shared/lua_api/phys/bphysbox.cpp b/src/shared/lua_api/phys/bphysbox.cpp
index 78f1c45..0fe9f72 100644
--- a/src/shared/lua_api/phys/bphysbox.cpp
+++ b/src/shared/lua_api/phys/bphysbox.cpp
@@ -34,14 +34,14 @@ void makenewbphysbox(lua_State* L){
mass = lua_tonumber(L,-1);//{v3_size},{v3_origin},mass
lua_pop(L,1);//{v3_size},{v3_origin}
- printf("Got mass: %f\n",mass);
+ //printf("Got mass: %f\n",mass);
popvector3d(L,&px,&py,&pz);//{v3_size}
- printf("Got position: (%f,%f,%f)\n",px,py,pz);
+ //printf("Got position: (%f,%f,%f)\n",px,py,pz);
popvector3d(L,&sx,&sy,&sz);//
btVector3 vshape = btVector3(sx * 0.5f, sy * 0.5f, sz * 0.5f);
- printf("Got size: (%f,%f,%f)\n",sx,sy,sz);
+ //printf("Got size: (%f,%f,%f)\n",sx,sy,sz);
btVector3 pos = btVector3(px,py,pz);
// Set the initial position of the object
@@ -52,12 +52,12 @@ void makenewbphysbox(lua_State* L){
// Give it a default MotionState
btDefaultMotionState* motionstate = new btDefaultMotionState(transform);
if(!motionstate){
- printf("No motionstate\n");
+ //printf("No motionstate\n");
}
// Create the shape
btCollisionShape* shape = new btBoxShape(vshape);
if(!shape){
- printf("no shape\n");
+ //printf("no shape\n");
}
// Add mass
@@ -67,12 +67,12 @@ void makenewbphysbox(lua_State* L){
// Create the rigid body object
btRigidBody* rigidbody = new btRigidBody(mass, motionstate, shape, localinertia);
if(!rigidbody){
- printf("No rigidbody\n");
+ //printf("No rigidbody\n");
}
// Add it to the world
World->addRigidBody(rigidbody);
- printf("Added rigid body to world: %p\n",World);
+ //printf("Added rigid body to world: %p\n",World);
Objects.push_back(rigidbody);
lua_pushlightuserdata(L,rigidbody);//ud_rigidbody
@@ -80,7 +80,7 @@ void makenewbphysbox(lua_State* L){
// phys.newphysbox(vector3 size, vector3 origin, double mass)
int newbphysbox(lua_State* L){
- printf("Createing bphysbox!\n");
+ //printf("Createing bphysbox!\n");
//Create it's lua representation
makenewbphysbox(L);//ud_btRigidBody
btRigidBody* r = (btRigidBody*)lua_touserdata(L,-1);
@@ -98,7 +98,7 @@ int newbphysbox(lua_State* L){
//{phys.physbox}:delete()
static int delbphysbox(lua_State* L){//self
- printf("Attempting to delete physbox\n");
+ //printf("Attempting to delete physbox\n");
lua_getfield(L,-1,"rigidbody");//self,ud_rigidbody
btRigidBody* r = (btRigidBody*)lua_touserdata(L,-1);//self,ud_rigidbody
delete r->getCollisionShape();
@@ -130,7 +130,7 @@ static int bphyssetpos(lua_State *L){//self,{v3 pos}
// {v3 pos} :: physbox:getpos()
static int bphysgetpos(lua_State *L){//self
- printf("Physics box set pos called\n");
+ //printf("Physics box set pos called\n");
lua_getfield(L,-1,"rigidbody");//self,ud_rigidbody
btRigidBody* i = (btRigidBody*)lua_touserdata(L,-1);//self,ud_rigidbody
btTransform bt = i->getWorldTransform();
@@ -149,7 +149,7 @@ static const luaL_reg bphysbox_m[] = {
};
void bphysbox_register(lua_State* L){//
- printf("Registered bphysbox\n");
+ //printf("Registered bphysbox\n");
luaL_newmetatable(L, "phys.physbox");//{phys.physbox}
lua_newtable(L);//{phys.physbox},{}
diff --git a/src/shared/phys/physcommon.cpp b/src/shared/phys/physcommon.cpp
index 4f506bb..b1c4c67 100644
--- a/src/shared/phys/physcommon.cpp
+++ b/src/shared/phys/physcommon.cpp
@@ -33,17 +33,17 @@ btSequentialImpulseConstraintSolver* Solver;
void phys_genesis(){
BroadPhase = new btAxisSweep3(btVector3(-1000,-1000,-1000),btVector3(1000,1000,1000));
- printf("Broadphase\n");
+ //printf("Broadphase\n");
CollisionConfiguration = new btDefaultCollisionConfiguration();
- printf("Collision config\n");
+ //printf("Collision config\n");
Dispatcher = new btCollisionDispatcher(CollisionConfiguration);
- printf("Dispatcher\n");
+ //printf("Dispatcher\n");
Solver = new btSequentialImpulseConstraintSolver();
- printf("Solver\n");
+ //printf("Solver\n");
World = new btDiscreteDynamicsWorld(Dispatcher, BroadPhase, Solver, CollisionConfiguration);
- printf("Physics world init ok.\n");
+ //printf("Physics world init ok.\n");
World->setGravity(btVector3(0,-10,0));
- printf("Created physics world: %p\n",World);
+ //printf("Created physics world: %p\n",World);
}
void phys_shutdown(void(*f)(btRigidBody*)){