Added explicit xyz_heading overrides for the 4 distance functions

This commit is contained in:
Arthur Ice
2015-01-17 16:08:45 -08:00
parent 77badffa29
commit a135a3d597
4 changed files with 36 additions and 3 deletions
+28
View File
@@ -145,6 +145,13 @@ float ComparativeDistance(const xyz_location& point1, const xyz_location& point2
return diff.m_X * diff.m_X + diff.m_Y * diff.m_Y + diff.m_Z * diff.m_Z;
}
/**
* Produces the non square root'ed distance between the two points.
*/
float ComparativeDistance(const xyz_heading& point1, const xyz_heading& point2) {
ComparativeDistance(static_cast<xyz_location>(point1), static_cast<xyz_location>(point2));
}
/**
* Produces the distance between the two points.
*/
@@ -152,6 +159,13 @@ float Distance(const xyz_location& point1, const xyz_location& point2) {
return sqrt(ComparativeDistance(point1, point2));
}
/**
* Produces the distance between the two points.
*/
float Distance(const xyz_heading& point1, const xyz_heading& point2) {
Distance(static_cast<xyz_location>(point1), static_cast<xyz_location>(point2));
}
/**
* Produces the distance between the two points within the XY plane.
*/
@@ -159,6 +173,13 @@ float DistanceNoZ(const xyz_location& point1, const xyz_location& point2) {
return Distance(static_cast<xy_location>(point1),static_cast<xy_location>(point2));
}
/**
* Produces the distance between the two points within the XY plane.
*/
float DistanceNoZ(const xyz_heading& point1, const xyz_heading& point2) {
return Distance(static_cast<xy_location>(point1),static_cast<xy_location>(point2));
}
/**
* Produces the non square root'ed distance between the two points within the XY plane.
*/
@@ -166,6 +187,13 @@ float ComparativeDistanceNoZ(const xyz_location& point1, const xyz_location& poi
return ComparativeDistance(static_cast<xy_location>(point1),static_cast<xy_location>(point2));
}
/**
* Produces the non square root'ed distance between the two points within the XY plane.
*/
float ComparativeDistanceNoZ(const xyz_heading& point1, const xyz_heading& point2) {
return ComparativeDistance(static_cast<xy_location>(point1),static_cast<xy_location>(point2));
}
/**
* Determines if 'position' is within (inclusive) the axis aligned
* box (3 dimensional) formed from the points minimum and maximum.