mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Added explicit xyz_heading overrides for the 4 distance functions
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user