aboutsummaryrefslogtreecommitdiff
path: root/src/shared/lua_api/phys/bphysmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/lua_api/phys/bphysmodel.cpp')
-rw-r--r--src/shared/lua_api/phys/bphysmodel.cpp9
1 files changed, 6 insertions, 3 deletions
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();