oSceneLoaderLib : about scenemanager and scene settings

sebarnolds

27-10-2006 15:34:16

Hi.

I just discovered that, when we initialize an OSMScene object with a scenemanager, then the scene settings such as shadows, fog and world geometry of the oScene file are not loaded. This can be seen in the createScene function. The following code can be seen :

if(mSceneMgr == NULL)
{
if(rootElem->FirstChildElement("sceneManager"))
pParent = createSceneManager(rootElem, bHandled);
else
mSceneMgr = Root::getSingleton().createSceneManager(ST_GENERIC);
}


The createSceneManager function load from the oScene file theses parameters but if a scene manager is created and then passed to the oFusion loader then they are ignored.

Is this the behaviour wanted ?

Thanks forward,
Sebastien

Lioric

27-10-2006 16:15:06

The shadows, fog and worldGeometry are SceneManager specific/dependant, their behavior depends on the scene manager loaded and the order of their method calls (i.e. fog on terrain scene manager)

Shadows needs to be supported by the scene manager loaded, and worldGeometry is specific, the user is responsable for this settings if using a custom scene manager

If you are instancing a default scene manager (from the included with ogre) or if you know that your scene manager supports the defined properties, you can move those scene settings to the "setSceneProperties" method, where the ambient, scene color and sky technique are set. You should consider that shadows should be set before adding entities/loding meshes

The "setSceneProperties" method is called for any scene manager after the scene objects are loaded and before the static geometry is created

sebarnolds

31-10-2006 10:09:16

Hi.

Thank you very much for your explainations, that makes a lot of sense.

I corrected easily my problem by letting the loader create the scene manager as I wasn't doing anything with it before loading oFusion.

Thank you,
Sebastien