#18 failure to create TriangleMeshGeometry

1.6.0
closed-fixed
Andy
5
2008-10-19
2008-09-26
Wildmage
No

I'm thinking this is a wrappings issue. Maybe I'm passing the wrong arguments or maybe this function was never closely looked at when it was wrapped.

Here is my Python call:
Code:

trimesh1 = OgreOde.TriangleMeshGeometry(wall1Points, len(wall1Points), indices1, len(indices1), self._world, self._space)

Here is the C++ prototype:
Code:

TriangleMeshGeometry(const Ogre::Vector3* vertices,
unsigned int vertex_count,
const unsigned int* indices,
unsigned int index_count,
World *world,
Space* space = 0);

Here is the exception message passed to the command-line:
Code:

Traceback (most recent call last):
File "SnakeMotionModel2.py", line 214, in <module>
application.go()
File "C:\Python25\lib\site-packages\ogre\renderer\OGRE\sf_OIS.py", line 66, in go
if not self._setUp():
File "C:\Python25\lib\site-packages\ogre\renderer\OGRE\sf_OIS.py", line 107, in _setUp
self._createScene()
File "SnakeMotionModel2.py", line 182, in _createScene
self.walls = corridor.Corridor(self._world)
File "C:\Documents and Settings\Jacob\Desktop\OpaqueCode\corridor.py", line 43, in __init__
self.setupMyWorld(pnts1, pnts2)
File "C:\Documents and Settings\Jacob\Desktop\OpaqueCode\corridor.py", line 153, in setupMyWorld
trimesh1 = OgreOde.TriangleMeshGeometry(wall1Points, len(wall1Points), indices1, len(indices1), self._world, self._space)
Boost.Python.ArgumentError: Python argument types in
TriangleMeshGeometry.__init__(TriangleMeshGeometry, list, int, list, int, World, HashTableSpace)
did not match C++ signature:
__init__(struct _object *, class Ogre::Vector3 const * vertices, unsigned int vertex_count, int const * indices, unsigned int index_count, class OgreOde::World * world)
__init__(struct _object *, class Ogre::Vector3 const * vertices, unsigned int vertex_count, int const * indices, unsigned int index_count, class OgreOde::World * world, class OgreOde::Space * space=None)

Clearly, the problem is passing the lists and translating to const pointers. Particularly Ogre::Vector3 const *vertices and int const *indices. Both of these I passed as lists of the respective element but to no avail.

Discussion

  • Andy
    Andy
    2008-10-19

    As the is is the constructors in the class that need to be 'wrapped' we had to add a helper function.. so OgreOde.makeTriangleMeshGeometry can now be used and accepts python lits of vectors etc as arguments...

     
  • Andy
    Andy
    2008-10-19

    • milestone: --> 1.6.0
    • assigned_to: nobody --> andy_miller
    • status: open --> closed-fixed