2
\$\begingroup\$

I am attempting to create a Pool of Fixtures, in order to reduce memory consumption. My problem is that when I attempt to return a Fixture to the Pool and re-assign its position on the Parent Body, once it is repositioned the Fixture no longer provides any collision response with other world objects.

It seems that if you want to move a Fixture on a Static body, it needs to be destroyed and re-created. This method doesn't allow me to use my Pool however.

Does anyone know if it is possible to move a Fixture on a Static Body? I do not want to move the Body, but the Fixtures attached to it.

\$\endgroup\$
3
\$\begingroup\$

Farseer is open source.

http://farseerphysics.codeplex.com/SourceControl/changeset/view/94324#1436535

/// Warning: You cannot reuse fixtures.

If you still want to do this, then try to reproduce some of the steps that Fixture.RegisterFixture() private method does.

\$\endgroup\$
  • 1
    \$\begingroup\$ You are right, there is no way around this without re-registering the fixture to the body. I ended up giving each fixture a body, and I am now able to reposition, however, I had to think of a smart way to reduce the number of active bodies on screen. Thanks. \$\endgroup\$ – jgallant Jan 1 '12 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.