Calling Scene-constructor later

Prophet

04-09-2008 22:13:42

Okay, I'm sketching on our engine and as I have it now, my scene will be inherited from NxOgre::Scene. The problem is, I intend to load the data for the scene depending on filename (which I do in the constructor), but the NxOgre::Scene's constructor must be called first, thus having no info to send to the constructor.
So, basically, my question is: is it possible to set all of the NxOgre::Scene's argument to what ever and then (right after, really) set the to something else? I'll never need to use the NxOgre::Scene in between, so it will be "safe".
Edit: at the moment I pressed Submit, a thought strike me; can you call the constructor once again, inside the Scene (big scene) constructor?

betajaen

04-09-2008 22:23:51

Hmm. It's not possible to run the constructor a second time, even if you could run the function, duplicate classes would be created - causing leaks, but you could set the Scene to the most default/average Scene you can get, then configure it after wards via the functions once you've loaded in your data.

Prophet

05-09-2008 09:16:01

True, it would kinda ruin the thought with a constructor. Thanks!

Prophet

05-09-2008 19:56:20

Hm, this idea wouldn't work to well with the World-class, would it? And if you skipped the World-class (or overrode it, not sure), it would be rather difficult to make successful renders, right? Better to just bunch them together in one larger class?

betajaen

05-09-2008 21:24:47

NxOgre wouldn't work without a World class.

Look, instead of avoiding how Scene works, just embrace it; You can change the parameters of the Scene after you've created it.

Prophet

06-09-2008 22:38:13

Yepp, I forgot... It's a lot to think about. :cry: