entity sliding bad above a perfect plane!

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
coimbra79
Posts: 33
Joined: Thu Dec 29, 2011 12:42 am

entity sliding bad above a perfect plane!

Post by coimbra79 »

HI Everybody!
i want try to develope a game for pc, where cars drift on some tracks... It may be a lovely game, but unfortunately i have a strange iussue: when tyres drift in track (perfectly planar), it happen in specifics point, they suddenly 'hopping'.
Why it appen?
How the way to fix this iussue.

//- im sure the car is unstable when across (drifting) the line split of 2 plane triangles.
very thanks!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: entity sliding bad above a perfect plane!

Post by Norbo »

There's two primary explanations:
1) Make sure that the mesh representing the ground has proper connectivity information supplied to it so that the mesh boundary smoother can function. If each triangle in a mesh has 3 unique vertices and indices dedicated to it, the physics system will not know that adjacent triangles are actually connected. To address this, make sure shared edges actually share vertices by pointing to them with the index buffer.

For example, consider a simple two-triangle quad. It could be represented by a vertex buffer of 6 unique vertices, two of which overlap. The index buffer would just be (0,1,2,3,4,5). In this case, there is no known connectivity between the triangles.

If the quad were instead represented as 4 vertices and a vertex buffer like (0,1,2,1,2,3), connectivity is established across the shared edge and it will get smoothed.

2) If the triangles are enormous (say, 100000x100000 each), you might be hitting some precision issues on the edges. In this case, either use smaller triangles or ensure that no objects can come near the edges. One way to do this would be to have one single huge triangle that covers the entire possible play area. The face of each triangle is handled with a special collision detection case is very robust against numerical error, but the edges are not.
coimbra79
Posts: 33
Joined: Thu Dec 29, 2011 12:42 am

Re: entity sliding bad above a perfect plane!

Post by coimbra79 »

Norbo 4 president!
i realised the piano using unjointed faces, so naturally it had the undesired hoppings!

a note to say thanks to NORBO!
http://bepu.nfshost.com/forum/viewtopic.php?f=9&t=1757
Post Reply