So I have a TriangleMesh and a Heightmap. I need them to be collidable. Unfortunately, I have not been able to get them to do so. My code works fine for boxes against heightmaps, but the TriangleMesh has no effect. Help?
_body = new Body(); _skin = new CollisionSkin(_body); List<Vector3> vertices = new List<Vector3>(); List<TriangleVertexIndices> indices = new List<TriangleVertexIndices>(); setVerticesAndIndices(obj, vertices, indices); TriangleMesh tri_mesh_primitive = new TriangleMesh(); tri_mesh_primitive.CreateMesh(vertices,indices,100000,1000); Box box_primitive = new Box(-0.5f*_scale+_position, Matrix.Identity, _scale); //No matter what combination of these lines is commented/uncommented, //the collision skin refuses to collide with the heightmap! D: _skin.AddPrimitive(tri_mesh_primitive,_material); _skin.AddPrimitive(box_primitive,_material); _body.CollisionSkin = _skin; Vector3 com = SetMass(1.0f); _body.MoveTo(_position, orientation); _body.EnableBody();