Rotating a vector returns incorrect results

I purchased a Geodesic Sphere generator plugin from the marketplace and have spent a few days transferring it to c++ for better performance since Its math heavy and may potentially be used frequently in my project.

The problem I’m having is when generating the initial data, the vectors need to be rotated but I’m getting incorrect results compared to the original Marketplace Asset. I tried moving the RotateVector part to Blueprints because this is where the inconsistency starts. Rotating the vectors returns the expected result in my Blueprint but when assigning these values to variables declared in the header and attempting to access them in c++ results in random numbers being assigned to any axis with a value of 0. See the pictures below to see exactly what I mean.

I declare and set the variables to zero here in the header

This is the blueprint function that rotates the vectors and sets the variables, the values in the red box are what they should be, these are the same values the original Marketplace Asset shows

This is where I attempt to access the Vectors but you can see the values are not what they were when set in the blueprint. The commented lines are the c++ version of this but it also returns the same values as the function above. Also note that this happens directly after the values are set in the function above. There is no other usage of these variables other than these 3 lines and the blueprint above.

I’m not sure if this is just an engine bug or if I’m potentially doing something wrong but any help would be appreciated!

After further research I got to thinking about the precision of the float values for each axis, I found a method to reduce the precision down to 6 decimal places and that seems to solve the issue. For anyone in the future that encounters this issue, try limiting the float precision with this method.

Tomorrow when I’m done cleaning up the c++ files for this I’ll see if I can come up with a c++ solution for this method as well!

More likely is the values are the same as they were in BP. The BP debugger just shows you less precision than VS’s debugger and does not use exponential notation.

I still don’t know what caused this entirely but I know the values were wrong because the IcoSphere my code was generating had all the correct triangles but they were in the wrong locations/orientations compared to the original code