scriptkid
19-10-2006 22:41:17
Hi there,
bit of a long post, but my problem should be clear more now
I'm trying to the use Ogre's SceneQuery functionality via PyOgre, however i have run into a few problems.
To use the IntersectionSceneQuery i follow these steps:
Works fine; it creates an instance of IntersectionSceneQuery.
Now i tried to get the results through:
in order to query the 'movables2movables' member. However with no luck, since the 'SceneQueryMovableObjectPair' type seems not to be mapped to PyOgre. Am i right?
So i tried the overload of the 'execute' method, which accepts a 'IntersectionSceneQueryListener'. However now i am stuck, because i get a 'No matching function for overloaded 'IntersectionSceneQuery_execute' error. This is my listener class:
I call the execute method like this:
Calling it with the query object itself works fine (because it also inherits from the IntersectionSceneQueryListener):
Pretty useless, but just a test.
To make sure that i pass a correct object, i printed out both class trees:
Tree of <pyogre.ogre.IntersectionSceneQuery; proxy of C++ Ogre::IntersectionSceneQuery instance at _18a22c03_p_Ogre__IntersectionSceneQuery>
... IntersectionSceneQuery
...... SceneQuery
......... object
...... IntersectionSceneQueryListener
......... object
Tree of MyListener
... MyListener
...... IntersectionSceneQueryListener
......... object
As you can see, both derive from IntersectionSceneQueryListener.
Tracing the file doesnt allow me to look very far, because of the call to _ogre.pyd. It does call the 'IntersectionSceneQuery's execute(*args) method.
Does anybody have a clue about what's going on? Thanks a lot and thanks for creating PyOgre!
bit of a long post, but my problem should be clear more now

I'm trying to the use Ogre's SceneQuery functionality via PyOgre, however i have run into a few problems.
To use the IntersectionSceneQuery i follow these steps:
self.query = self.sceneManager.createIntersectionQuery()
Works fine; it creates an instance of IntersectionSceneQuery.
Now i tried to get the results through:
results = self.query.execute()
in order to query the 'movables2movables' member. However with no luck, since the 'SceneQueryMovableObjectPair' type seems not to be mapped to PyOgre. Am i right?
So i tried the overload of the 'execute' method, which accepts a 'IntersectionSceneQueryListener'. However now i am stuck, because i get a 'No matching function for overloaded 'IntersectionSceneQuery_execute' error. This is my listener class:
class MyListener(ogre.IntersectionSceneQueryListener):
def __init__(self):
print "Constructing listener"
def __repr__(self):
return "MyListener"
def queryResult(self, first, second):
print ("Collision between %s and %s" % (first, second))
return True
I call the execute method like this:
self.query.execute(MyListener())
Calling it with the query object itself works fine (because it also inherits from the IntersectionSceneQueryListener):
self.query.execute(self.query)
Pretty useless, but just a test.
To make sure that i pass a correct object, i printed out both class trees:
Tree of <pyogre.ogre.IntersectionSceneQuery; proxy of C++ Ogre::IntersectionSceneQuery instance at _18a22c03_p_Ogre__IntersectionSceneQuery>
... IntersectionSceneQuery
...... SceneQuery
......... object
...... IntersectionSceneQueryListener
......... object
Tree of MyListener
... MyListener
...... IntersectionSceneQueryListener
......... object
As you can see, both derive from IntersectionSceneQueryListener.
Tracing the file doesnt allow me to look very far, because of the call to _ogre.pyd. It does call the 'IntersectionSceneQuery's execute(*args) method.
Does anybody have a clue about what's going on? Thanks a lot and thanks for creating PyOgre!