Tree Collisions - OgreNewt


21-04-2007 15:06:29

hi again! :)

This time I'm having a little trouble with getting the treecollision to work. here's what I got:

stat_col = OgreNewt.TreeCollisionSceneParser( )
stat_col.parseScene( self.staticRoot, False )
self.staticCollisionBody = OgreNewt.Body(, stat_col )
self.staticCollisionBody.attachToNode( self.staticRoot )
self.staticCollisionBody.setPositionOrientation( ogre.Vector3(-5,0,-5), ogre.Quaternion.IDENTITY )
## stat_col = self.treeColParser.parseScene(self.staticRoot, False)
## stat_col.attachToNode(self.staticRoot)
self.treeColLoader.exportTreeCollision(stat_col, ky[1])
del stat_col

The staticRoot is a sceneNode, with an xml scene loaded as its children. This works, but my objects just fall through the landscape. The treecollision export works as well, and produces a file.

The body object resulting from the sceneParse should be kept around shouldn't it? or am I going wrong there?


24-04-2007 13:38:37

Some progress -

I've tried manually creating the collision mesh for the landscape, and this now seems to work (tree shows up in ogreNewt with debug lines on). However, none of the other objects in the xml scene seem to have collision geometry.

Does the treeCollisionSceneParser actually work? has anyone else tried this?

from what I've found, treeCollisionSceneParser should create a collision tree from a tree of sceneNodes, is that right?


Looks like the problem was with the dotscene parser. By default it creates nodes as children of the scenemanager root. So I've tried passing a reference to my staticroot into, and it seems to work, although orientations are a bit messed up.