Callbacks of PCZSM

NoodlesOnMyBack

11-03-2009 18:24:50

Im trying to get callbacks when my objects are set to be visible or hiden, i dont know how to do this, and i did something that didnt worked:
My idea was to use the virtual function _alertVisibleObjects(), and for that i have a singleton class wich inherits from Ogre::PCZSceneManager like this:


class ZoneManager : public Ogre::Singleton<ZoneManager>, public Ogre::PCZSceneManager
{
public:
ZoneManager(const Ogre::String& name);
~ZoneManager();
...



ZoneManager::ZoneManager(const Ogre::String& name) : Ogre::PCZSceneManager(name)
{
String zoneTypeName = "ZoneType_Default";
String zoneFilename = "none";
this->init(zoneTypeName);
this->enableSky(true);
}


Then, when i create the scene manager, i do:

mRoot->createSceneManager("PCZSceneManager", "PCZSceneManager");
new ZoneManager("PCZSceneManager");
mSceneMgr = (Ogre::SceneManager*)(ZoneManager::getSingleton().getSingletonPtr());


But then, if i create SceneNodes and try to get them back, it says "Cant find xxxx scene node..."
I have a flag in my project to switch between PCZSM and the default SM, and works fine whithout PCZSM.
Basically i need to operate on each SceneNode when they are hided.

Chaster

17-03-2009 23:48:33

Hmmm, I don't know why the PCZSM is saying it can't find the scene nodes. It just inherits the scene node stuff from the regular ogre scenemanager...