How can I move a vector along with camera?

I’m building the line trace for a weapon in c++.
My line trace starts at my camera position and ends further away.

I store a vector of where the first shot landed (the origin of the burst), because the location where the other shots will land will depend on that origin.

However, if I move the camera, I need the origin to move along with it, how can I do that?


Get the impact point and subtract the camera location from it. You’ll get the relative location of the impact point to the camera. Save it to a variable and add it to the camera location when you need it.

yes, thank you Tuerer, that did the trick