So you are using the if statement to prevent the calculation from becoming unstable before building a matrix with the X and Z axis.
Using this function:
FMatrix rotation = FRotationMatrix::MakeFromZX(impactNormal, basis);
So you are using the if statement to prevent the calculation from becoming unstable before building a matrix with the X and Z axis.
Using this function:
FMatrix rotation = FRotationMatrix::MakeFromZX(impactNormal, basis);