Tubez
05-04-2007 09:39:52
Are you tired of not being able to print Vector3s in your application without extracting the x,y,z components? Have no fear!
Just paste this immediately after the "import Ogre" line in you main file:
This gives the Ogre.Vector3 class a "representation" method that turns the x,y,z triples into a parenthesized string of the components.
"print v" will now yield the expected results.
Don't you love python?
Just paste this immediately after the "import Ogre" line in you main file:
def v3repr(self):
return str((self.x, self.y, self.z))
Ogre.Vector3.__repr__ = v3repr
This gives the Ogre.Vector3 class a "representation" method that turns the x,y,z triples into a parenthesized string of the components.
"print v" will now yield the expected results.
Don't you love python?