1
0
Fork 0

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:
James Turner 2021-06-24 15:24:20 +01:00
parent 083d364f9c
commit c404bb6b37

View file

@ -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;