How can I Rotate a Vector in C++?

Hi;
In C++ , I need a function that takes a Vector , and a Rotation , and it returns a new vector that is rotated to direction of input rotation.

Thanks.
MSD.

1 Like

Hi MSD,

Try to use it

const FRotator rot(10, 10, 10);
FVector result = rot.RotateVector(FVector(1, 0, 0));

In addition, there are many other ways to transform vector with help of matrices or quaternions.

Best regards,

5 Likes

Thanks .