For those interested in the math, the distance between two points is the magnitude of the vector from point A to point B.
Taking the first example, the distance between obj1 and obj2 would be calculated:
Vector3 pos1, pos2;
pos1 = Commands->Get_Position(obj1);
pos2 = Commands->Get_Position(obj2);
Vector3 gap = pos1 - pos2; //Doesn't matter which order the subtraction is in.
float dist = gap.length(); //Where length() returns the magnitude of the vector (is this in the sdk?)
And the magnitude is calculated by taking the square root of the sum of the square of each element.
class Vector3
{
public:
float x, y, z;
float length()
{
return sqrt(x*x + y*y + z*z);
}
}
So if there is no length() or equivalent function, you can still get the distance if you have access to each element of the vector.