aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/phys/cbphysmodel.cpp
diff options
context:
space:
mode:
authorAlexander <alex@cogarr.net>2020-06-02 08:54:14 -0400
committerAlexander <alex@cogarr.net>2020-06-02 08:54:14 -0400
commitececf2c8624f4d95d9413686839f7fa6e5bb5044 (patch)
treed276a9b7bec1706113f7a59b721fc3c1495cfcbd /src/client/lua_api/phys/cbphysmodel.cpp
parent355589a9100c7d08fdc4094ad32eb9852c88fcc4 (diff)
downloadbrokengine-ececf2c8624f4d95d9413686839f7fa6e5bb5044.tar.gz
brokengine-ececf2c8624f4d95d9413686839f7fa6e5bb5044.tar.bz2
brokengine-ececf2c8624f4d95d9413686839f7fa6e5bb5044.zip
Add a shape cast
Add a raycast like function, which can cast shapes. phys.shapecast(), along with a shape structure needed to call this function.
Diffstat (limited to 'src/client/lua_api/phys/cbphysmodel.cpp')
-rw-r--r--src/client/lua_api/phys/cbphysmodel.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/lua_api/phys/cbphysmodel.cpp b/src/client/lua_api/phys/cbphysmodel.cpp
index ae2559e..e09c62e 100644
--- a/src/client/lua_api/phys/cbphysmodel.cpp
+++ b/src/client/lua_api/phys/cbphysmodel.cpp
@@ -37,7 +37,7 @@ extern std::list<btRigidBody*> Objects;
//newbphysmodel("graphicfile","physicfile",mass,[,{position}][,{lookat}])
static int newbphysmodel(lua_State* L){
- printf("Creating cbphysmodel\n");
+ //printf("Creating cbphysmodel\n");
int nargs = lua_gettop(L);
double lx,ly,lz;
double x,y,z;
@@ -63,7 +63,7 @@ static int newbphysmodel(lua_State* L){
ISceneManager *smgr = device->getSceneManager();
- printf("bphysnode, creating the scene node\n");
+ //printf("bphysnode, creating the scene node\n");
//Create the scene node
//IMeshBuffer *buf = new CDynamicMeshBuffer(E_VERTEX_TYPE::EVT_STANDARD,E_INDEX_TYPE::EIT_16BIT);
@@ -209,18 +209,18 @@ static int newbphysmodel(lua_State* L){
////gmesh->setDirty();
IMesh *gmesh = smgr->getMesh(gpath);
- printf("Creating client physbox at %f %f %f\n",x,y,z);
+ //printf("Creating client physbox at %f %f %f\n",x,y,z);
ISceneNode *node = smgr->addMeshSceneNode(gmesh,0,-1,vector3df(x,y,z));
- printf("bphysnode, createing the physics body\n");
+ //printf("bphysnode, createing the physics body\n");
//Create the physics body
lua_pushstring(L,ppath);//"physpath"
lua_pushnumber(L,mass);//"physpath",mass
pushvector3d(L,x,y,z);//"physpath",mass,{x,y,z}
pushvector3d(L,lx,ly,lz);//"physpath,mass,{x,y,z},{lx,ly,lz}
- printf("About to makebphysmodel\n");
+ //printf("About to makebphysmodel\n");
makebphysmodel(L);//ud_rigidbody
- printf("done makebphysmodel\n");
+ //printf("done makebphysmodel\n");
btRigidBody *rb = (btRigidBody*)lua_touserdata(L,-1);
rb->setUserPointer(node);
@@ -247,7 +247,7 @@ static int newbphysmodel(lua_State* L){
lua_pushvalue(L,-4);//{rb},{phys},{colliders},ud_rb,{rb}
lua_settable(L,-3);//{rb},{phys},{phys.colliders}
lua_pop(L,2);//{rb}
- printf("finished creating the lua representation\n");
+ //printf("finished creating the lua representation\n");
return 1;
}