fix for the til matching issue created when converting from SGVec3d to SGGeod for bounding box
This commit is contained in:
parent
bf7d86732d
commit
c6d60ecd5b
1 changed files with 14 additions and 0 deletions
|
@ -431,12 +431,26 @@ inline bool Point3D::HasElevation() const
|
||||||
|
|
||||||
inline bool Point3D::IsWithin( Point3D min, Point3D max ) 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]) &&
|
return ( (min.n[PX] <= n[PX]) && (min.n[PY] <= n[PY]) &&
|
||||||
(max.n[PX] >= n[PX]) && (max.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
|
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]) &&
|
return ( (xmin <= n[PX]) && (ymin <= n[PY]) &&
|
||||||
(xmax >= n[PX]) && (ymax >= n[PY]) );
|
(xmax >= n[PX]) && (ymax >= n[PY]) );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue