New Farseer Physics Engine Release (Version 1.0.0.4)

FarseerPhysicsNoBorder430X260

I've just released the latest version of the Farseer Physics Engine. You can download it here.

Here is a list of the changes and bug-fixes for this version.

  • Small change to Vertices.Translate().
    • Given a vector, this method was doing a subtraction for the translation where it should have been adding. If you were using this method you will need to negate the vector you were passing in to this method.
  • Changed Vertices.CalculateMomentOfInertia() to Vertices.GetMomentOfInertia()
    • This was done to match naming convention used by other methods in the class. If using this method you will need to do a global find/replace.
  • Changed Vertices.GetMomentOfInertia to center the verts on its centroid prior to calculating the moment of inertia.
    • It made more sense to do this. The underlying vertice values are not changed permanently by this method only for the calculation.
  • Added BodyFactory.CreatePolygonBody(..., Vertices vertices, ...) overload.
    • This method takes a set of vertices and uses them to calculate the moment of inertia so the user doesn't need to do this themselves.
    • Example: the code below will create a body with it’s MomentOfInertia automatically calculated to be that of the triangle defined by the vertices passed in. In the past you would have had to call verts.CalculateMomentOfInertia, then set that explicitly on the Body after it was created.
verts = new Vertices();
verts.Add(ConvertUnits.ToSimUnits(200, 200));
verts.Add(ConvertUnits.ToSimUnits(100, 200));
verts.Add(ConvertUnits.ToSimUnits(100, 300));
testBody = BodyFactory.Instance.CreatePolygonBody(physicsSimulator, verts, 1);
  • Changed GeomFactory.CreatePolygonBody(..).
    • This method will now automatically align the centroid (center of mass) of the geom with the associated body position unless an offset is provided in which case the geom’s centroid will be offset from the body by the amount of the offset.
    • Previously this method caused a lot of confusion if the vertices were not defined relative to 0,0. With this change, verts can now be defined anywhere and this method will fix up the verts so they act as though they were created relative to 0,0.
  • Changed the way Body rotation, totalRotations, and revolutions are tracked and clamped.
    • This change was suggested by ‘yota’ in the CodePlex Issue Tracker.
    • The rotation of a body is now clamped as follows: 0 <= rotation < 2Pi. (It use to be -2Pi < rotation < 2Pi)
    • In addition, the revolutions are more accuratly tracked if a large rotation value is passed in to the Body.Rotation property. Thanks again to yota for this fix.
    • Finally, Body.revolutions, which was a private internal variable in Body now has a property accesor.
  • Fixed linear drag bug found by michael_brooks11 from the codeplex forums.
  • Finally implemented Vertices.SubDivideEdges(float maxEdgeLength) method
    • Farseer prefers an even spread of vertices even on straight edges. This method makes it to take any set of vertices and sub-divide the edges so that no edge is longer than some given length.
 

Related posts

Comments

February 25. 2008 14:05

Tom

Very nice... hope to see further updates in the future.

Tom

March 6. 2008 08:54

Willie Tilton

I think you forgot to get the new release out on the CodePlex page. I see the announcement, which links me to here, but can't download anything. Thanks for the great engine, I'm also interested in seeing what's changed with SL2.

Willie Tilton

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

September 7. 2008 00:50