Still?warui wrote: But it still has some bugs which i'm currently working on with afacelis (thanks man once again).
I looked at the source and I must admit that I'm a bit surprised...
You're interpolating between two rotation states stored in two vectors.
Ok.
But your're treating the vectors as if they were spacial vectors (location or direction or whatever). But the vectors used for rotation are really only a container of three euler angle values. So getLength() and normalize() doesn't really make sense (that's also why you had to "fix" the normalize() function I guess).
I doesn't say it won't work, but as you say it still has bugs...
So my quick idea is:
remove this in the constructor:
Code: Select all
f32 WayLength = (f32)Vector.getLength();
Vector.normalize();
TimeFactor = WayLength / TimeForTurn;
Code: Select all
u32 factor = (timeMs-StartTime) / TimeForTurn;
if (!Loop && factor >= TimeForTurn)
rot = End;
else
rot = Start + (Vector * factor);
The whole reverse thing also makes me a bit nervous but I might look at it later...