futnuh
25-05-2006 05:49:13
Any ideas why pyOgre does not expose the constituent Reals x,y,z,w of the Quaternion class? For example:
Contrast this with the Vector3() class which does expose its x,y,z:
According to the Ogre header http://www.ogre3d.org/docs/api/html/OgreQuaternion_8h-source.html, these are public ...
My specific need for this is trying to store/restore the orientation of an ogre.SceneNode. Just assigning q=node.orientation or q=copy.copy(node.orientation) doesn't work. These are reference copies of the underlying c++ instance. It seems you need to save the data members instead ...
>>> q = ogre.Quaternion()
>>> q.x
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'Quaternion' object has no attribute 'x'
Contrast this with the Vector3() class which does expose its x,y,z:
>>> v = ogre.Vector3()
>>> v.x
2.6266005677630659e-038
According to the Ogre header http://www.ogre3d.org/docs/api/html/OgreQuaternion_8h-source.html, these are public ...
My specific need for this is trying to store/restore the orientation of an ogre.SceneNode. Just assigning q=node.orientation or q=copy.copy(node.orientation) doesn't work. These are reference copies of the underlying c++ instance. It seems you need to save the data members instead ...