How does one reseat a variable?


I have a World class that adds a global b2World variable like so:

void World::setup_chai() {

When I’m trying to call World::setup_chai more than once, I obviously get a name_conflict_error exception. Is it possible to just change what "g_box2d_world" is pointing to if the variable already exists?


The develop branch now has a set_global function that will set or reset the global value. I believe it does what you want.

I’m working on tagging a new release, it should be out in a few days.


Thanks. That’s exactly what I wanted.