CreatePolygonGeom not working?

Topics: Developer Forum, User Forum
Jan 14, 2009 at 9:16 AM
Edited Jan 14, 2009 at 9:21 AM
I've just upgraded from the older farseer to the brand new 2.01 version, and have come across some 'fun' issues.


If I create a set of vertices that is symmetrical around 0 (say, -1-1, 1,-1 0,1 0,-1), the GetArea function returns 0. Looking at the code, it appears that :

area +=

this[i].X*this[j].Y;


area -=
this[i].Y*this[j].X;

should read:

area +=
this[i].X*this[j].Y;

area +=
this[i].Y*this[j].X;


Secondly, if I generate a bunch of boxes using CreateRectangleBody, it's all fine and dandy. If I generate 4 points in the same place, then Subdivide them so they are sensibly apart (I've seen people use 10), then the object stacks/collides correctly until it rotates. Then it starts falling through the boxes created above.Creating the Body of the size of the expected limits using CreateRectangleBody and then creating the Geometry using CreatePolygonGeom doesn't seem to afffect this at all.

Help welcome! :)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Coordinator
Jan 14, 2009 at 9:23 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.