How to control HardwareSharedPointer in Python-Ogre 9.0?


21-03-2007 09:10:06

v_offset = v_ptr + (vba.vertexIndex * v_sptr.getVertexSize())

The statement above is from the ogreNewt ragdoll demo. As I understand it, it increments the current vertex buffer pointer by a certain amount in order to get the memory address of the vertex at vba.vertexIndex.

However, python complaints that there's no operand '+' defined for void* and integer.
(v_ptr is of type void *.
vba.vertexIndex*v_sptr.getVertexSize() is of type int.)

My question is how do I perform such operations on a vertex buffer pointer to increment/decrement it in python-ogre?


21-03-2007 12:22:09

You'll have to give me a few days to fix this problem...

Previous demos had modified the vertex buffer (Demo_Grass, Demo_Bezier) so I'd added helper functions in the form of
ogre.setFloat( pointer, buffer )
In the case of the Ragdoll demo we need a ogre.CastInt, and perhaps a more Python friendly way of managing things..

I've created a ticket on the [b]new Python-Ogre[/b] site and appended an updated with my comments in it (it doesn't yet work)