Reduce warning log spam in NaN position.
Try to catch NaN SGGeod position before we pass them to the intersect visitor, so we don’t fill the console/logs with error messages: we catch NaNs in other places.
This commit is contained in:
parent
083d364f9c
commit
c404bb6b37
1 changed files with 19 additions and 13 deletions
|
@ -296,6 +296,9 @@ FGStgTerrain::get_cart_elevation_m(const SGVec3d& pos, double max_altoff,
|
|||
bool ok;
|
||||
|
||||
SGGeod geod = SGGeod::fromCart(pos);
|
||||
if (!geod.isValid())
|
||||
return false;
|
||||
|
||||
geod.setElevationM(geod.getElevationM() + max_altoff);
|
||||
|
||||
ok = get_elevation_m(geod, alt, material, butNotFrom);
|
||||
|
@ -308,6 +311,9 @@ FGStgTerrain::get_elevation_m(const SGGeod& geod, double& alt,
|
|||
const simgear::BVHMaterial** material,
|
||||
const osg::Node* butNotFrom)
|
||||
{
|
||||
if (!geod.isValid())
|
||||
return false;
|
||||
|
||||
SGVec3d start = SGVec3d::fromGeod(geod);
|
||||
|
||||
SGGeod geodEnd = geod;
|
||||
|
|
Loading…
Reference in a new issue