FTrasform::TransformVector vs FRotator::RotateVector
Hi, I'm trying to understand the fps tutorial code and recently I'm struggling to understand transforms, vectors and rotators.
At one point of the tutorial I arrive that I have a GunOffset, an offset to the point where to fire my projectile.
I want to fire in front of me so I can start taking the world location of the attached camera or of the eyes of my character:
I don't understand what is the difference doing one way or the other. The vector SpawnLocation is found adding CameraLocation (world) + GunOffset (once world).
FTransform::TransformVector and FRotator::RotateVector seem doing the same thing taking the vector GunOffset and making him world, but meanwhile the FRotator::RotateVector is clear to me (It rotates the vector GunOffset according to the rotator SpawnRotation), the other one isn't.
asked Mar 10 '15 at 03:16 PM in C++ Programming
An FRotationMatrix is just an FTransform where you only change the rotation components. When you RotateVector you are transforming the Vector about a RotationMatrix. An FTransform with only the Rotation set is the same thing as a FRotationMatrix, so anyway, they're all the same, RotateVector is just a nice wrapper I suppose.
answered Mar 10 '15 at 09:51 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here