Why does AddActorLocalRotation behave like this?

Hey MrTortoise-

When adding a rotation in two separate axes (X and Z) the forward direction of the third axis (Y) has to rotate as well for the first two to reach the proper rotation. When only rotating in one axis the other two are unaffected, however rotating in two forces the third to update as well.

Cheers

I have an actor with a rotation of say

p,y,0

I call AddActorLocalRotation with a rotator of say a,b,0

I expect a rotation of p+a,b+y,0 - actually this may not be true because in a full implementation roll may be non zero but in my test case roll is most definatley should be 0 - therefor local rotation will effectively be the same as world… Also, (and i haven’t tested this) when i rotate in any 2 of the other dimensions when the 3rd is 0, then i expect the 3rd to stay 0)

What happens is if pitch is non zero then yaw values add to roll.

I am obviously confused, what do i need to call to take an actor and add a rotation about its current orientation?

ok after playing and waving a phone about i am happy that it is behaving properly. if you pitch pi/2 and yaw pi/2 then you end up with a roll … god dammit lol

because its correct as it is.

wave a phone about until your satisfied.

tilt it up … rotate it about its center and it is rolled. for it not to roll you would ahve to rotate it about yourself (world) for yaw (ie dont use AddActorLocalRotation for this)

thanks :wink: yeah. Believe it or not 10 years ago i was pretty fly with ol quaterions and tensors etc. Turns out if you don’t use it you lose it.

Thanks