ogre.Vector3(None) crashes python.

saladin

05-08-2007 05:47:04

instead of generating a ogre.Vector3.ZERO object or throwing an attributeError.

I know it's a minor thing but it caused me a surprisingly large amount of frustration. Hope you can fix it in coming version. I'm sure it's just few lines of code.

Cheers ta.

andy

05-08-2007 13:54:31

Nasty -- thanks for the bug and I'll see what I can do about it

Andy

andy

05-08-2007 15:34:09

Fix will be in the next binary release (and next SVN update).

Problem was a few constructors in the Vector classes that needed to be excluded.

They take pointers to base variable types (int, real etc) which isn't valid for Python, and it seems we were taking the None type as a valid "float *" and causing the crash..

Cheers
Andy

saladin

06-08-2007 04:27:27

cheers. You da man.

dedesite

18-04-2008 09:40:36

Hi,
I use the 1.1 release and there is still problem with Vector3.ZERO function, but it is much more pernicious!!!

Indeed, the function don't trow an error but we had some very wierd stuff like Vector which "mix" together.
I had those variables :

self.tractionForce = ogre.Vector3.ZERO
self.worldAcceleration = ogre.Vector3.ZERO


And we put some value in tractionForce like this :

self.tractionForce.x = 200


And then some value in worldAcceleration :

self.worldAcceleration.x = 400


When printing tractionForce, it has the same values of worldAcceleration!!!!

The code was a little bit more complicated so the bug should not be seen with this example but I assure you that it was a bug.
If you want the original code I can send it to you ;).

Greetings,
Andreas

P.S : Sorry for my english, I'm french ;)

EDIT : Python-Ogre ROCKS!!!! :D

bharling

18-04-2008 12:46:06

Whoa, you're right, very odd.

You can get around it by constructing your vectors like

v1 = ogre.Vector3(0,0,0)
v2 = ogre.Vector3(0,0,0)
v1.x = 500

print v2.x

>> 0.0


It seems like ogre.Vector3.ZERO is not instanciating a vector.

dedesite

18-04-2008 12:52:35

You can get around it by constructing your vectors like

Code:
v1 = ogre.Vector3(0,0,0)


Yes I've done like that but it was very hard to find what going on, so I post here in order to signal the bug ;).

Greetings,
Andreas