
I guess a more specific question is: Why does a Body need to be initialized as either a rectangle or a circle; why can't it be an arbitrary polygon? If I want a triangularshaped object, for example, I understand that I can use GeomFactory.Instance.CreatePolygonGeom()
for collision, but how would I initialize the Body representing this object? As a rectangle? As a circle? What does this rectangle or circle represent?
All of the samples I've seen have been trivial because the objects in question were already circles or rectangles, but what do I do if I have a triangle or another nonrectangular polygon?



Now, I'm pretty new to Farseer, but I believe that a body is really nothing more than a point in space with a rotation, it doesn't actually have a shape.
The two choices you are giving for a Body, Circle and Rectangle, generate the MOI (Moment of Inertia) based on those shapes. If you would like a more abstract shape, you would have to calculate the MOI yourself, and then just call the nonspecific CreateBody()
and pass in your custom MOI.
I'm no physics expert or Farseer expert, so take this with a grain of salt...



Thanks a lot DaJackel, this sounds like a very reasonable answer. :)
I hope that in time we'll see more tutorials / documentation, since Farseer has a lot to offer!



There is also now a helper method in the Vertices object, I think, that will return the MOI of a set of vertices.



crashlander wrote:
There is also now a helper method in the Vertices object, I think, that will return the MOI of a set of vertices.
Thanks !
I was looking into calculating the MOI of a triangle,
Link:
http://lab.polygonal.de/2006/08/17/calculatingthemomentofinertiaofaconvexpolygon/
There is a million ways of doing it ! I hope the helper method will help me accomplish this.



It should help.
And thank BioSlayer... I got the code from him.

