From 44a1421c393632978d59c0698a93ae22243b97e9 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 10 Jun 2020 20:39:54 -0400 Subject: Various progress for 1klutz Added convext shape casts, still a little broken, but it might be just broken bullet side. --- src/shared/lua_api/phys/bphysmodel.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/shared/lua_api/phys/bphysmodel.cpp') diff --git a/src/shared/lua_api/phys/bphysmodel.cpp b/src/shared/lua_api/phys/bphysmodel.cpp index d56adb5..0c8e3bf 100644 --- a/src/shared/lua_api/phys/bphysmodel.cpp +++ b/src/shared/lua_api/phys/bphysmodel.cpp @@ -81,6 +81,7 @@ void makebphysmodel(lua_State *L){ float v2 = vs[1]; float v3 = vs[2]; vertexes[i] = btVector3(v1,v2,v3); + printf("Adding vertex %lld at (%f,%f,%f)\n",i,v1,v2,v3); } //printf("Finished finding or adding vertexes\n"); for(size_t i = 0; i < attrib.num_faces - 1; i+= 3){ //0 - y to num_faces - 1 @@ -92,13 +93,15 @@ void makebphysmodel(lua_State *L){ v1 = vertexes[i1.v_idx]; v2 = vertexes[i2.v_idx]; v3 = vertexes[i3.v_idx]; - trimesh->addTriangle(vertexes[i1.v_idx],vertexes[i2.v_idx],vertexes[i3.v_idx],true);//Some triangles are "the wrong way round", + trimesh->addTriangle(vertexes[i1.v_idx],vertexes[i2.v_idx],vertexes[i3.v_idx],false);//Some triangles are "the wrong way round", + printf("Adding triangle:(%d,%d,%d)\n",i1.v_idx,i2.v_idx,i3.v_idx); //trimesh->addTriangle(vertexes[i3.v_idx],vertexes[i2.v_idx],vertexes[i1.v_idx],true);//double-side all triangles } //printf("Finished adding triangle indicies\n"); //printf("Done building trimesh\n"); - btGImpactShapeInterface *shape = new btGImpactMeshShape(trimesh); - shape->updateBound(); + //btGImpactShapeInterface *shape = new btGImpactMeshShape(trimesh); + btConvexTriangleMeshShape *shape = new btConvexTriangleMeshShape(trimesh); + //shape->updateBound(); //btCollisionShape *shape = new btBvhTriangleMeshShape(trimesh,true); btTransform tr; tr.setIdentity(); -- cgit v1.2.3-70-g09d2