So basically, I have a struct that, along with other members, has x, y and z values to represent a 3D point; I have then a vector of said structs which is built by some functions.
struct myStruct{
char x;
char y;
char z;
// some other members
};
vector<myStruct> myVector = myVectorBuildingFunction(...);
Now, I would like to sort the structs in the vector by the distance between their 3D point (x, y, z members) and another variable point in the space.. is that possible without rebuilding the structs' members one by one (they're relatively many) or remaking entirely my initial vector building function?