using TreeCollisionSceneParser to parse world geometry

mdc5237

10-01-2008 03:31:21

Hello all,

I'm extremely new to OgreNewt, and in fact Ogre in general. I'm actually using Python-Ogre along with OgreNewt on a project and I am having problems.

I am just throwing together a small scene to test things and see if I can get OgreNewt to interact with my scene. I created that ninja object that everyone seems to use and put him inside of a bsp. Yes, I am using the BSPSceneManager, and yes, I realize that it's not really complete or anything, but it seems as though it should be able to handle what I am trying to do.

I created the world geometry with this line of code:
self.sceneManager.setWorldGeometry( self.quakeLevel )]

Added the ninja to the scene:
ent = self.sceneManager.createEntity( 'Ninja', 'ninja.mesh' )
ent.setCastShadows( True )
self.sceneManager.rootSceneNode.createChildSceneNode("ninjaNode").attachObject( ent )
ninjaNode = self.sceneManager.getSceneNode( "ninjaNode" )
ninjaNode.pitch( ogre.Degree(90))
ninjaNode.setScale( ( .5, .5, .5 ) )


And used this code to attempt to get OgreNewt to detect everything:

sceneParser = OgreNewt.TreeCollisionSceneParser( self.world )
sceneParser.parseScene( self.sceneManager.rootSceneNode, True )
worldBody = OgreNewt.Body( self.world, sceneParser )
worldBody.attachToNode( self.sceneManager.rootSceneNode )
del sceneParser


Doing this and turning on the debug lines results in:



As you can see, the ninja is fine, but my world geometry isn't. My guess is that setWorldGeometry() does not actually attach anything to the root scene node, and that is why it isn't working.

So, is there any way using the BSPSceneManager to attach my world geometry to a scene node so that OgreNewt parses it as part of the scene?

Thanks