rzel / physaxe

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

Specifying vertices clock-wise results in 'ghost' polygons #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a body.
2. Create a Polygon shape and specify the vertices in clock-wise order.
3. Add the shape to the body, add the body to the world.

What is the expected output? What do you see instead?
The created polygon should react to collisions, but instead completely
ignores them (this includes manually checking if it contains a point that's
obviously inside the polygon).

What version of the product are you using? On what operating system?
Physaxe 1.2, Windows XP.

Please provide any additional information below.

Original issue reported on code.google.com by p.witv...@gmail.com on 2 Nov 2009 at 8:26

GoogleCodeExporter commented 9 years ago
I encountered this as well. It seems to cause the area calculation to result in 
a
negative number, so my workaround was to just test the polygon's area before 
adding
it to the world.

    if (p.area < 0) {
      vertices.reverse();
      p = new phx.Polygon(vertices, origin, myMaterial);
    }

Original comment by michal.w...@gmail.com on 2 Jan 2010 at 8:00