On regular flat ground I am getting hops when I traverse over the edges of the triangles, so I set up my welding like so:
hkpMoppCode *moppCode = hkpMoppUtility::buildCode( shape_mesh, mci );
hkpMoppBvTreeShape* moppShape = new hkpMoppBvTreeShape( shape_mesh, moppCode );
shape_mesh->computeWeldingInfo( moppShape, hkpWeldingUtility::WeldingType::WELDING_TYPE_ANTICLOCKWISE );
I have a few problems:
- If I use SIMULATION_TYPE_DISCRETE the welding doesn't seem to work at all, my character pops up and looking at the contact planes in the visual debugger I see that the neighboring triangle is responsible. If I use SIMULATION_TYPE_CONTINUOUS it does work, and is probably preferable to discrete, but I'm curious why it's not working in discrete.
- My second problem is that if I have geometry setup using exact coordinates, where the edge of two convex shapes is shared (not by actual vertices, but in physical location), I get errors in the compute welding information telling me that I cannot use one sided welding. I can imagine the technical challege this presents, since you're only given the triangles as input and you have to decide how they are connected (aparently by location of vertices), but couldn't you just reject welding the edge if the face of the triangles is not facing the same direction? Or just throw a warning instead of bailing out?
- Also even when welding IS working, I have strange strange contact normals even with very small steps. I have my max slope set to 90, so I doubt that is the problem.
info.m_maxSlope = 90 * HK_REAL_DEG_TO_RAD;
I have attached a screenshot from the VDB of the welding not working (right), and the strange extra contact normals (left).