laftworld3141 / box2d

Automatically exported from code.google.com/p/box2d
0 stars 0 forks source link

Collision glitch with polygon sliding over simple edges with ghost vertices #341

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
See the attached testbed demo. A polygon slides over 3 connected edge shapes 
(using ghost vertices), which form a very simple terrain with no harsh angles. 
When passing from the horizontal edge to the first downsloping edge, there in a 
collision which jerks the polygon back.

Treating the terrain as 4 vertices A, B, C, D with edges ()AB(C), (A)BC(D) and 
(B)CD(), where parentheses represent the previous/next vertices of the edge 
shape:

The unwanted collision occurs when the polygon first reaches vertex B.
If either the previous or next vertices of BC are removed, the collision goes 
away and behaviour is as expected.
Bizarrely, with both ghost vertices in place, whether or not the collision 
occurs is dependent upon the coordinates of vertex D - two vertices away from 
the point of collision.

Tested with Box2d v2.3.1

Original issue reported on code.google.com by cjan...@gmail.com on 20 Dec 2014 at 8:35

Attachments: