I've made a simple test setup like this:

If the floor and the box are both simple primitive shapes it works just fine. If I change just the floor to be a StaticMesh or just the box to be a MobileMesh things still work fine. However, if I change both the floor and the box into mesh shapes then everything goes wrong - the box jitters around more and more and eventually jumps right through the floor!
The box is created like this:
Code: Select all
return new MorphableEntity(new MobileMeshShape(vertices, indices, AffineTransform.Identity, MobileMeshSolidity.Solid));
Code: Select all
return new StaticMesh(vertices, indices);
The mobile cube is created from this data, note that there are a lot of duplicated vertices in there, is that likely to be a problem?
Code: Select all
Vertices
0:{X:0.5 Y:0.5 Z:0.5}
1:{X:0.5 Y:0.5 Z:-0.5}
2:{X:-0.5000001 Y:0.5 Z:-0.4999999}
3:{X:-0.4999998 Y:0.5 Z:0.5000002}
4:{X:-0.4999998 Y:-0.5 Z:0.5000002}
5:{X:-0.5000001 Y:-0.5 Z:-0.4999999}
6:{X:0.5 Y:-0.5 Z:-0.5}
7:{X:0.5 Y:-0.5 Z:0.5}
8:{X:0.5 Y:0.5 Z:0.5}
9:{X:0.5 Y:-0.5 Z:0.5}
10:{X:0.5 Y:-0.5 Z:-0.5}
11:{X:0.5 Y:0.5 Z:-0.5}
12:{X:0.5 Y:0.5 Z:-0.5}
13:{X:0.5 Y:-0.5 Z:-0.5}
14:{X:-0.5000001 Y:-0.5 Z:-0.4999999}
15:{X:-0.5000001 Y:0.5 Z:-0.4999999}
16:{X:-0.5000001 Y:0.5 Z:-0.4999999}
17:{X:-0.5000001 Y:-0.5 Z:-0.4999999}
18:{X:-0.4999998 Y:-0.5 Z:0.5000002}
19:{X:-0.4999998 Y:0.5 Z:0.5000002}
20:{X:-0.4999998 Y:0.5 Z:0.5000002}
21:{X:-0.4999998 Y:-0.5 Z:0.5000002}
22:{X:0.5 Y:-0.5 Z:0.5} 23:{X:0.5 Y:0.5 Z:0.5}
Indices:
2 1 0
3 2 0
6 5 4
7 6 4
10 9 8
11 10 8
14 13 12
15 14 12
18 17 16
19 18 16
22 21 20
23 22 20