aboutsummaryrefslogtreecommitdiff
path: root/src/shared/lua_api/phys/bphysbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/lua_api/phys/bphysbox.cpp')
-rw-r--r--src/shared/lua_api/phys/bphysbox.cpp22
1 files changed, 11 insertions, 11 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},{}