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\$

1 Answer 1

3
\$\begingroup\$

Velcro Physics (formerly Farseer Physics) is open source.

/// Warning: You cannot reuse fixtures.

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

\$\endgroup\$
1
  • 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
    Commented Jan 1, 2012 at 15:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .