public static float distance(GVRTransform obj1, GVRTransform obj2) { Vector3d v1 = new Vector3d(obj1.getPositionX(), obj1.getPositionY(), obj1.getPositionZ()); Vector3d v2 = new Vector3d(obj2.getPositionX(), obj2.getPositionY(), obj2.getPositionZ()); return (float) v1.distance(v2); }
public static float[] direction(GVRTransform origin, GVRTransform dest) { float[] dir = new float[3]; dir[0] = (dest.getPositionX() - origin.getPositionX()); dir[0] = (dest.getPositionY() - origin.getPositionY()); dir[0] = (dest.getPositionZ() - origin.getPositionZ()); return dir; }