1
0
Fork 0

Ground-cache: throw on NaN inputs

Attempt to provoke FDM NAN issues more directly (eg in Sentry reports),
rather than waiting on SGCardToGeod, etc to blow up inside the
ground cache.

SF-Id: https://sourceforge.net/p/flightgear/codetickets/2743/
This commit is contained in:
James Turner 2022-05-31 16:37:02 +01:00
parent 8ae98ea543
commit 8517eda0c9

View file

@ -702,6 +702,10 @@ FGGroundCache::get_agl(double t, const SGVec3d& pt, SGVec3d& contact,
SGVec3d& normal, SGVec3d& linearVel, SGVec3d& angularVel,
simgear::BVHNode::Id& id, const simgear::BVHMaterial*& material)
{
if (isNaN(pt)) {
throw sg_range_exception("FGGroundCache::get_agl: NaN position input");
}
#ifdef GROUNDCACHE_DEBUG
SGTimeStamp t0 = SGTimeStamp::now();
#endif