I have a 3D *.obj model for the pool table which I'm loading manually since I'm targeting Silverlight 5 and not XNA (unfortunately Silvelight's subset of XNA functionality is missing the content pipeline support).
Apart from geometry the model also consists of considerably simpler collision meshes for various parts of the table, such as pockets, rails or the flat surface the balls roll on. And it's the surface collision mesh I'm having problems with - no matter how I triangulate it, there's always a lot of weird ball movement going on.
Just to illustrate it better I simplified the surface as a plane made of 8 triangles: http://img17.imageshack.us/img17/7367/b ... icsbug.png.
The vertices are marked red and next to them are their indices.
I create a StaticMesh:
Code: Select all
StaticMesh mesh = new StaticMesh( Vertices.ToArray(), Indices.ToArray() );
Code: Select all
[0] {X:-2.1382 Y:1.7576 Z:0.0174}
[1] {X:-2.1382 Y:1.7576 Z:3.7969}
[2] {X:0.0326 Y:1.7576 Z:0.0174}
[3] {X:0.0326 Y:1.7576 Z:3.7969}
[4] {X:2.2033 Y:1.7576 Z:0.0174}
[5] {X:2.2033 Y:1.7576 Z:3.7969}
[6] {X:-2.1382 Y:1.7576 Z:-3.762}
[7] {X:0.0326 Y:1.7576 Z:-3.762}
[8] {X:2.2033 Y:1.7576 Z:-3.762}
Code: Select all
[0] 0
[1] 1
[2] 2
[3] 3
[4] 2
[5] 1
[6] 2
[7] 3
[8] 4
[9] 5
[10] 4
[11] 3
[12] 6
[13] 0
[14] 7
[15] 2
[16] 7
[17] 0
[18] 7
[19] 2
[20] 8
[21] 4
[22] 8
[23] 2
When I set:
Code: Select all
mesh.ImproveBoundaryBehavior = true;
When I set:
Code: Select all
mesh.ImproveBoundaryBehavior = false;
Both the issues seem to happen only when balls are moving slowly, e.g. when coming to stop, but on the other hand when they move faster it may be just harder to notice the same behavior.
Here are some videos that show the issues I'm talking about:
mesh.ImproveBoundaryBehavior = true
mesh.ImproveBoundaryBehavior = false
Using the mouse I apply a linear impulse when button is pressed to shoot a ball in a straight line towards the cursor.
Any help would be appreciated
