FixtureFactory.CreateRectangle no longer used?

Topics: Developer Forum
Nov 19, 2011 at 4:16 PM

Hey. I'm trying to look around for XNA tutorials but there are quite a lot of tutorials that seem out of date that I'm not sure if I'm missing something. I'm currently using 3.3 and the tutorial I'm using is running 3.2. I don't know how big of a difference there is, but the tutorial says to call "FixtureFactory.CreateRectangle". In my case, I don't have the 'CreateRectangle' method. Instead, I only have 'AttachRectangle'. Has the 'CreateRectangle' method been removed and replaced, or is the original way of doing things changed? The 'AttachRectangle' method has slightly different parameters so I'm not sure if this tutorial will be valid anymore. Also, I remember seeing a list of changes from previous versions, but can't find it anymore. Is there a list of breaking changes from 3.x to 3.3? Thanks

Mar 10, 2012 at 11:26 PM
Edited Mar 11, 2012 at 12:37 AM

I've just picked up Farseer and have come across the same problem. I compared the latest version of the code with the newest version that had CreateRectangle, and it appears that it has mostly just been renamed. As far as I can tell though, you need to create a rectangle/shape yourself and then attach it now rather than the FixtureFactory creating it for you.

If I figure it out I'll repost here.

EDIT:

Looks like FixtureFactory isn't really used very much any more. Instead you create Bodies from BodyFactory and make the changes directly. I'm going to use this example to learn from: http://farseerphysics.codeplex.com/SourceControl/changeset/view/94324#1436586

This would make it behave like it did in 2.x before the Box3D system was integrated. A little confusing. I'll repost if it works.