SceneManager get/setOptions


08-10-2007 22:46:45

In python-ogre I can show / get the visibility the SceneManager's octree with something like this:

i = ctypes.c_int(1)
b = sceneManager.setOption("ShowOctree", ogre.CastVoidPtr(ctypes.addressof(i)))
#b = sceneManager.getOption("ShowOctree", ctypes.addressof(i))

In C++ I can get the bounding box with:

AxisAlignedBox bBoundingBox;
if (mSceneManager->getOption("Size", &bBoundingBox)) {

How do I go get the bounding box in python-ogre?.


09-10-2007 03:21:03

Good question -- I think this will need a little hand_wrapping..



10-10-2007 03:27:18

This is fixed in the SVN (and will be 1.1.1) -- there is a Test_SceneManagerOptions in the demos/ogre/tests directory to show it working..

You need to tell the 'getOption' what type you want by passing an example of that type to the call and you get a tuple back, first value is true or false based upon the call working, second value is the return value from the SceneManager
ret,size = sceneManager.getOption ( 'Size', ogre.AxisAlignedBox() )
ret,depth = sceneManager.getOption ( 'Depth', 1)
ret,value = sceneManager.getOption ( 'ShowOctree', False )
Setting a value works logically :)
sceneManager.setOption( 'ShowOctree', True)
sceneManager.setOption( 'Depth',depth)