Something i have noticed while working with Irrlicht is that many times i find myself moving, scaling and rotating an object using a relative transformation, that is, i take the original value for the transform i want to modify, then i add a vector to it, and later, i set it with the proper method.
Wouldn't it be useful to have something like translate/rotate/Scale(vector3d v) methods where the result would be that the positon/rotation/scale is modified according to the current value of the transformation plus the provided vector?
Relative scene node transformations.
Relative scene node transformations.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Relative scene node transformations.
I always make a dummy parent scene node for any node that's going to be rotating on 3 axis. Also, you can often to setrotation(getrotation + rotationspeed*frametimer). That's how I made variable-speed spinning rotors in my quad game.
Re: Relative scene node transformations.
That is what i mean, couldn't you simply tell the node "rotate(rotationSpeed*frametimer);?
setRotation(getRotation...) is a bit redundant, for me, anyway
setRotation(getRotation...) is a bit redundant, for me, anyway
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Relative scene node transformations.
What you're describing is something like rotation += resultant, which does rotation = rotation + resultant anyway.
There is no way to change a value without reading a value, but I'm under the impression that a function like (getvalue) which reads the memory at a pointer location is EXTREMELY fast.
There is no way to change a value without reading a value, but I'm under the impression that a function like (getvalue) which reads the memory at a pointer location is EXTREMELY fast.
Re: Relative scene node transformations.
it is the diference between 1 and 2 function calls. but for ease of use, it may come in handy.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Relative scene node transformations.
I'm also under the impression that those type of function calls get inlined. If they don't, they should be.
Re: Relative scene node transformations.
They are defined inside a header file, so they are "auto inlined"... Didn't think of that. Clever, very clever XD
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt