Page 2 of 2

Posted: Wed Apr 27, 2005 7:56 pm
by jox
Thanks guys! :)

@keless: I overloaded an actual engine function and disassambled a real situation. Because otherwise you could get totally different result because the compiler might optimize away and falsify many things.

The function I implemented looks like this (ISceneNode.h):

Code: Select all

virtual void setPosition(f32 x, f32 y, f32 z)
{
	RelativeTranslation.set(x, y, z);
}
This sets the values directly to the target vector without the need of turning it into one before.

Posted: Sun May 01, 2005 7:19 am
by niko
Hm, really interesting. So I was wrong. :)
And it is slower. A little bit. But I don't think that this function is a bottleneck, it would not make any difference changing this. I think if you change all setPosition()-calls in the engine to this, it would not make the engine run faster. So I think the speed argument still doesn't count. :)

Posted: Tue May 03, 2005 12:53 am
by Bot_Builder
The speed is just a bonus to the ease added. If you are already using vectors, great it'll be even faster. If you are creating numbers, great you don't have to punch out the vector initializer, and its faster.