skapunch/box2d

Collision glitch with polygon sliding over simple edges with ghost vertices

Opened this issue · 0 comments

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: