Control Rotation

I don’t understand why subtracting control rotation and actor rotation works. I know control is global rotation and actor is local rotation but something about this doesn’t make sense.

Especially since I’m wondering how did he reach the conclusion that subtraction is needed for it to work.

Does the following help you understand?
image

The blue line is the control rotation, the red line is the actor rotation; it’s always straight forwards and doesn’t pitch.

Code:

FVector Start = GetActorLocation() + FVector(0, 0, 50);
FVector ActorEnd = Start + GetActorRotation().Vector() * 500;
FVector ControlEnd = Start + GetControlRotation().Vector() * 500;

DrawDebugLine(GetWorld(), Start, ActorEnd, FColor::Red, false, 0, 0, 10);
DrawDebugLine(GetWorld(), Start, ControlEnd, FColor::Blue, false, 0, 0, 10);
1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms