World should not be a singleton

praetor

26-08-2006 17:04:30

It kind of assumes you will only ever use 1 scene manager. I think this is not a good idea generally, and I don't see the benefit. It might take a little retooling across the library since some things assume they can always get to the World, but it doesn't seem to hard to make the World not a singleton. What do you guys think? If I told you there was a way to run multiple scenes across the lifetime of your game, and make OgreODE more flexible, would that be something you might be interested in?

tuan kuranes

26-08-2006 19:00:33

would that be something you might be interested in?
Sure.

Perhaps we can have a manager/factor with a singleton that "manages" multiples world ?

Ogre::SceneManagers have their Ogre::Root, OgreOde::World could have a OgreOde::Physic (or whatever name) ?

praetor

26-08-2006 21:19:58

I'm not even sure a manager is necessary, really. The user can probably be trusted to manage a world instance. SceneManagers need their own managers and factories because different implementations exist. With ODE there is only one type of world. I think just constructing a world as a normal object would work, then just change those classes that depend on them to accept it in their constructors.

I'm going to be tinkering with ODE soon, and I'll see how this style approach works. I know you're busy Tuan, so I don't expect you to make the changes.

tuan kuranes

28-08-2006 19:32:02

Manager idea is more of a design idea about who must manages what.

Not that much trade-off against speed there, and can help tracing/debuging, and further improvements would integrate easily.

Note that doesn't necessarly prevent you to bypass the manager and new/delete by your own.

ekt

10-10-2006 21:56:16

for what is worth i'am all for this change. i'm in the exact situation where i'd want to instantiate two ode worlds.