Even with IanM's update, I have not had a lot of luck with mesh-to-mesh collision. It seems to be very dependent on erp/cfm settings. Has anyone else made any progress with it?
IanM, since you seem to understand the ODE code, could you give me some insight as to whether mesh-to-mesh will actually work, or is it bugged? FPSC doesn't even use mesh-to-mesh, so I doubt it actually works.
EDIT:
I was searching through the ode dll source, and came across this comment regarding mesh to mesh:
Quote: "// ALAS ODE CANNOT CHECK COLLISION OF CYLINDER AGAINST TRI-MESH (NOR TRIMESH vs TRIMESH)
"
Yet, in the ODE documentation, it is clearly stated that ode can do mesh to mesh!
Quote: "Trimesh/Trimesh collisions, perform quite well, but there are three minor caveats"
However this is stated in the ode documentation:
Quote: "In order to efficiently resolve collisions, dCollideTTL needs the positions of the colliding trimeshes in the previous timestep. This is used to calculate an estimated velocity of each colliding triangle, which is used to find the direction of impact, contact normals, etc. This requires the user to update these variables at every timestep. This update is performed outside of ODE, so it is not included in ODE itself. The code to do this looks something like this:
const double *DoubleArrayPtr =
Bodies[BodyIndex].TransformationMatrix->GetArray();
dGeomTriMeshDataSet( TriMeshData,
TRIMESH_LAST_TRANSFORMATION,
(void *) DoubleArrayPtr );"
I searched the ode dll code for "dGeomTriMeshDataSet" and the search came up dry. This must mean that Lee (or whoever wrote the ode plugin) must not have included the code for updating trimeshes, therefore meaning no dynamic trimeshes!
My only hope is that someone knowledgable would update ode to allow mesh to mesh collision, or tell me I must not be feeling well, and it already works.
Otherwise, mesh to mesh is broken
formerly xMik