Download

How to rotate a Vector in the directior of a Rotator using Matrix

I generally use a FQuat to rotate a vector in the direction of a rotator. But I assume its not the most efficient way to do it.

Here is what I use.


		FRotator SegmentDirectionR = (SegmentStartLoc - SegmentEndLoc).Rotation();
		FQuat SegmentDirectionQ = SegmentDirectionR.Quaternion();
		FVector RotatedStartLocation = SegmentDirectionQ.RotateVector(SegmentStartLoc);

I have seen a lot of times a FRotationMatrix or something similar is used. Can any one tell me how is it works?

I know how TransformVector works.

I want to know how FRotationMatrix MakeFromX, MakeFromXY etc work…