Change of SceneNode::scale() ?

srekel2

22-10-2005 22:39:46

ARGH! I typed a nice long post and POOF! My IE window was closed. I have no idea how it happened :(

Anyways.. didn't the correct way to scale a node be


for index in xrange(0, NUM_ROBOTS):
entity = sceneManager.createEntity('robot%d' % index, 'robot.mesh')
node = sceneManager.rootSceneNode.createChildSceneNode((0, 0, index * 50 - NUM_ROBOTS * 50 / 2.0))
node.attachObject(entity)
node.scale = (0.5, 2, 0.5) ############ this line
self.animationStates.append(entity.getAnimationState('Walk'))
self.animationStates[-1].enabled = True
self.animationSpeeds.append(ogre.Math.RangeRandom(0.5, 1.5))



but it seems to be this now:


for index in xrange(0, NUM_ROBOTS):
entity = sceneManager.createEntity('robot%d' % index, 'robot.mesh')
node = sceneManager.rootSceneNode.createChildSceneNode((0, 0, index * 50 - NUM_ROBOTS * 50 / 2.0))
node.attachObject(entity)
node.scale((0.5, 2, 0.5)) ############ this line
self.animationStates.append(entity.getAnimationState('Walk'))
self.animationStates[-1].enabled = True
self.animationSpeeds.append(ogre.Math.RangeRandom(0.5, 1.5))




May I ask why?

Also, there was a mention of this in the SVN log, "Fixed Node::scale problem." (rev 233). It would be nice if you mentioned API changes in the log as well. "Fixed Node::scale problem. Use node.scale((1,1,1)) instead of node.scale = (1,1,1)." Would have saved me some time today. :)

Clay

23-10-2005 01:55:52

Sorry, the problem is that there is a scale function and there is a setScale, getScale function.

Originally I had this wrapped as:
SceneNode.scale = ()

But this removed the .scale function. Actually I think I'm going to set this back to the way it was. scale will be the attribute (because it makes sense), and I'll rename the function by "scaleBy". I'll work on this a bit tonight.

Clay

23-10-2005 03:43:52

Ok, this is changed again, now we have:

someNode.scale = 1, 2, 3 # sets the scale
someName.scaleBy(1, 2, 3) # same as someNode.scale += 1, 2, 3


The subversion log isn't very detailed, but the ChangeLog is. If you want to know what a specific change is. The svn log is just for a "quick writeup".

Sorry, the API is not quite stable yet.

srekel2

23-10-2005 10:29:37

Great, thanks. That'll make it much easier to work against two different versions of PyOgre. I didn't realize there was a change log, thanks for pointing it out. :)