[Patch?] Don't forget to call _updateBounds()

steven

22-07-2009 03:31:50

Hey

A not intuitive issue that you might encounter is that after you created the first PCZone you must not forget to call
yourCamera->getParentSceneNode()->_updateBounds();

Without it you will segfault in void PCZSceneManager::_findVisibleObjects() because the cameraHomeZone will be zero hence you will segfault at
cameraHomeZone->setLastVisibleFrame(mFrameCount);


Perhaps adding the _updateBounds call in PCZSceneManager::_findVisibleObjects() could work:


// update the camera
((PCZCamera*)cam)->update();
((PCZCamera*)cam)->getParentSceneNode()->_updateBounds(); <--------- add this line


If not at least this would make it easier to debug:

assert( cameraHomeZone && "Did you forget to call yourCamera->getParentSceneNode()->_updateBounds()?");
cameraHomeZone->setLastVisibleFrame(mFrameCount);

Fish

22-07-2009 13:35:35

The process of updating the camera node bounds is shown in the PCZ example application but it is not spelled out clearly in the documentation. You can update the wiki if you like. :)

-Fish

steven

22-07-2009 14:13:45

Its not a problem of documentation but merely that of a segfault that is not self-explanatory.

Also if updating the bounds could be done automatically it would prevent such a problem easily.

Fish

22-07-2009 22:56:40

If further documentation isn't sufficient you can submit a patch to the Ogre Addons Tracker. :)

-Fish

Chaster

14-08-2009 17:55:28

*NOTE: I am forced to leave maintenance of PCZ to Lf3thn4d because I am unable to keep up with the project on a consistent basis*

That said, I think this is a good add on, please submit a patch.

Thanks,

Chaster