A quick question: OgreOde EntityInformer

SiWi

01-09-2008 14:19:24

Well I've created a little function, which provides similar functionality to the built in EntityInformer.getBoneAlignedBox function.
def getMinMaxofBone(bone,entity):
vertex_count=0
vertices=Vector3()
ei= OgreOde.EntityInformer(entity, entity.getParentNode ()._getFullTransform())
if not ei.getBoneVertices(bone.getName(), vertex_count, vertices): #crash here
return 0
min_vec=Vector3(vertices[0])
max_vec=Vector3(vertices[0])
for i in range(1,vertex_count):
min_vec.x=min([min_vec.x,vertices[i].x])
min_vec.y=min([min_vec.y,vertices[i].y])
min_vec.z=min([min_vec.z,vertices[i].z])
max_vec.x=max([max_vec.x,vertices[i].x])
max_vec.y=max([max_vec.y,vertices[i].y])
max_vec.z=max([max_vec.z,vertices[i].z])
return min_vec,max_vec

The problem:
Arguments not matching C++ signature on the crash line.
As first paramter a EntityInformer_wrapper is expected, Python is passing a EntityInformer class -> should be no problem.
Second Paramter: char expected, string passed -> Shouldn't be a problem either.
Third parameter: unsigned int expected, int passed by Python. -> No problem.
Fourth parameter: Vector3 pointer expected, Vector3 passed. -> Probably the problem, but what to do?

andy

02-09-2008 00:43:35

Can you open a bug report on this one (on Sourceforge) as it will need to be fixed in the wrapper.

Issue is that from the calling signature it looks like a reference to a single Vector3, however it's actual use is as a pointer to a variable array of Vector3's.

Hence it will need to specifically have to hand wrap it to return a python array of Vector3's...

Regards
Andy

SiWi

02-09-2008 09:39:52

Done. :D