aboutsummaryrefslogtreecommitdiff
path: root/src/shared/lua_api/phys/bphysmodel.cpp
diff options
context:
space:
mode:
authorAlexander <alex@cogarr.net>2020-06-10 20:39:54 -0400
committerAlexander <alex@cogarr.net>2020-06-10 20:39:54 -0400
commit44a1421c393632978d59c0698a93ae22243b97e9 (patch)
treeea5d48412339b0ee6792c01414660639d19cfec6 /src/shared/lua_api/phys/bphysmodel.cpp
parentececf2c8624f4d95d9413686839f7fa6e5bb5044 (diff)
downloadbrokengine-44a1421c393632978d59c0698a93ae22243b97e9.tar.gz
brokengine-44a1421c393632978d59c0698a93ae22243b97e9.tar.bz2
brokengine-44a1421c393632978d59c0698a93ae22243b97e9.zip
Various progress for 1klutz
Added convext shape casts, still a little broken, but it might be just broken bullet side.
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();