remove fixtures and other questions

Feb 28, 2011 at 4:29 AM

So does removing a fixture cause a memory leak?

I have a list of fixtures, i force them to remove after a certain amount of time which i call the fixture.body.deleteFixture function as well as removing the object from the list.

After a bit of game time the game starts to lag.

 

Also what's the difference between a fixture and a body.

Feb 28, 2011 at 5:05 AM

i think destoryFixture has a memory leak

But dispose works fine.

What's the difference?

Feb 28, 2011 at 7:36 PM

Regarding your question on the difference between bodies and fixtures, as per the documentation:

Body 
The body keeps track of world position. It is basically a point is space that is affected by forces such as impulses from collisions and gravity.

Fixture 
A fixture attaches (fix) the shape to the body so that the centroid of the shape becomes the body’s position. Whenever you move the body, you also move the shape. Once a collision occur to the shape, the force is calculated and applied to the body.