Creating child nodes in ST_EXTERIOR_CLOSE?

paching

09-11-2005 01:52:13

Hey, a quick question:

I'm using PyOgre 1.0.5, and I seem to get a NotImplemented error if I try to createChildSceneNode() in the ST_EXTERIOR_CLOSE scene manager; is this the correct function to be using or am I mistaken? Alternatively, has this been implemented in CVS, or how can I get around this limitation?

Thanks!
- Paul

Clay

09-11-2005 02:07:36

Could you paste the exact line of code that throws the error, maybe a few preceeding lines, and the error message itself?

paching

09-11-2005 02:57:17

Hey, whoops. Forgot to do that.

Code:

self.player = sceneManager.createEntity('Player', 'ninja.mesh')

player_node = sceneManager.createSceneNode(0,0,0)
sceneManager.rootSceneNode.attachObject(player_node)
player_node.attachObject(self.player)

or

player_node = sceneManager.rootSceneNode.createChildSceneNode(0,0,0)
player_node.attachObject(self.player)

or

player_node = sceneManager.rootSceneNode.createChildSceneNode(ogre.Vector3(0,0,0))
player_node.attachObject(self.player)


all produce something like:

Traceback (most recent call last):
File "...xxx.py", line 41, in -toplevel-
game.go()
...
File "...yyy.py", line 24, in _create_world
self.player_node = sceneManager.createSceneNode(50,360,50)
File "...site-packages\pyogre\ogre.py", line 12428, in createSceneNode
return _ogre.SceneManager_createSceneNode(*args)
NotImplementedError: No matching function for overloaded 'SceneManager_createSceneNode'


However, simply attaching player to the root scene node works fine. What do you think?

Thanks for your help!

Clay

09-11-2005 03:48:21


self.player = sceneManager.createEntity('Player', 'ninja.mesh')

player_node = sceneManager.createSceneNode(0,0,0)
sceneManager.rootSceneNode.attachObject(player_node)
player_node.attachObject(self.player)

The first parameter to createSceneNode is for a location, so the first parameter needs to be a tuple of length three:
player_node = sceneManager.createSceneNode((0,0,0))


Same with the second one, here's corrected code:

player_node = sceneManager.rootSceneNode.createChildSceneNode((0,0,0))
player_node.attachObject(self.player)


The third code snippet works for me.

paching

09-11-2005 04:01:11

Great, using a tuple fixed it. Strange, though, that ogre.Vector3 didn't work before... hmm. Well, I'll figure out the rest. Thanks!