I have some body which grows. I added this body to the world.
...
someBody = world->CreateBody(&bodyDef);
someFixture = tapBody->CreateFixture(&someFixtureDef);
...
I think I do not need to paste all code here.
So I added body to the world. The question is how to change position, restitution… of the body which is already in the world? Am I allowed to do that here? (because I am getting errors when I try to change something in the tick method).
-(void) tick: (ccTime) dt
{
world->Step(dt, velocityIterations, positionIterations);
for (b2Body* b = world->GetBodyList(); b; b = b->GetNext())
{
}
}
Maybe instead of destroying and recreating the entire body you could accomplish what you need by destroying and creating a new fixture…
Sorry for any typos… haven’t tested any of this…