1
0
Fork 0

fix for the til matching issue created when converting from SGVec3d to SGGeod for bounding box

This commit is contained in:
Peter Sadrozinski 2012-11-06 19:32:17 -05:00
parent bf7d86732d
commit c6d60ecd5b

View file

@ -431,12 +431,26 @@ inline bool Point3D::HasElevation() const
inline bool Point3D::IsWithin( Point3D min, Point3D max ) const
{
// make sure we take epsilon into account
min.n[PX] -= fgPoint3_Epsilon;
min.n[PY] -= fgPoint3_Epsilon;
max.n[PX] += fgPoint3_Epsilon;
max.n[PY] += fgPoint3_Epsilon;
return ( (min.n[PX] <= n[PX]) && (min.n[PY] <= n[PY]) &&
(max.n[PX] >= n[PX]) && (max.n[PY] >= n[PY]) );
}
inline bool Point3D::IsWithin( double xmin, double xmax, double ymin, double ymax ) const
{
// make sure we take epsilon into account
xmin -= fgPoint3_Epsilon;
ymin -= fgPoint3_Epsilon;
xmax += fgPoint3_Epsilon;
ymax += fgPoint3_Epsilon;
return ( (xmin <= n[PX]) && (ymin <= n[PY]) &&
(xmax >= n[PX]) && (ymax >= n[PY]) );
}