#include <simgear/sg_inlines.h>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/structure/exception.hxx>
-#include <simgear/scene/util/OsgMath.hxx>
using std::auto_ptr;
using std::string;
double lon = _lon->getDoubleValue(),
lat = _lat->getDoubleValue();
- if (osg::isNaN(lon) || osg::isNaN(lat)) {
+ if (SGMisc<double>::isNaN(lon) || SGMisc<double>::isNaN(lat)) {
SG_LOG(SG_INSTR, SG_WARN, "read NaN for lon/lat:" << _lon->getPath()
<< ", " << _lat->getPath());
return SGGeod();
#include <vector>
#include <cstring>
-#include <osg/Math>
-
#include <simgear/scene/model/placement.hxx>
#include <simgear/scene/model/modellib.hxx>
#include <simgear/structure/exception.hxx>
{
double testNan(double val) throw (sg_range_exception)
{
- if (osg::isNaN(val))
+ if (SGMisc<double>::isNaN(val))
throw sg_range_exception("value is nan");
return val;
}
#include <algorithm>
#include <cstring>
#include <errno.h>
-#include <osg/Math> // isNaN
#include <simgear/misc/stdint.hxx>
#include <simgear/timing/timestamp.hxx>
case props::DOUBLE:
{
float val = XDR_decode_float(*xdr);
- if (osg::isNaN(val))
+ if (SGMisc<float>::isNaN(val))
return false;
xdr++;
break;
{
// check for corrupted data (NaNs)
bool isCorrupted = false;
- isCorrupted |= ((osg::isNaN(motionInfo.time )) ||
- (osg::isNaN(motionInfo.lag )) ||
+ isCorrupted |= ((SGMisc<double>::isNaN(motionInfo.time )) ||
+ (SGMisc<double>::isNaN(motionInfo.lag )) ||
(osg::isNaN(motionInfo.orientation(3) )));
for (unsigned i = 0; (i < 3)&&(!isCorrupted); ++i)
{
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/predicate.hpp>
-#include <osg/Math> // for osg::isNaN
-
#include <simgear/timing/timestamp.hxx>
#include <simgear/debug/logstream.hxx>
#include <simgear/structure/exception.hxx>
static void validateSGGeod(const SGGeod& geod)
{
- if (osg::isNaN(geod.getLatitudeDeg()) ||
- osg::isNaN(geod.getLongitudeDeg()))
+ if (SGMisc<double>::isNaN(geod.getLatitudeDeg()) ||
+ SGMisc<double>::isNaN(geod.getLongitudeDeg()))
{
throw sg_range_exception("position is invalid, NaNs");
}
case props::DOUBLE:
{
double dv = p->getDoubleValue();
- if (osg::isNaN(dv)) {
+ if (SGMisc<double>::isNaN(dv)) {
SG_LOG(SG_NASAL, SG_ALERT, "Nasal getprop: property " << p->getPath() << " is NaN");
return naNil();
}
if(naIsNil(n))
naRuntimeError(c, "setprop() value is not string or number");
- if (osg::isNaN(n.num)) {
+ if (SGMisc<double>::isNaN(n.num)) {
naRuntimeError(c, "setprop() passed a NaN");
}
case props::DOUBLE:
{
double dv = (*node)->getDoubleValue();
- if (osg::isNaN(dv)) {
+ if (SGMisc<double>::isNaN(dv)) {
SG_LOG(SG_NASAL, SG_ALERT, "Nasal getValue: property " << (*node)->getPath() << " is NaN");
return naNil();
}
naRuntimeError(c, "props.setValue() with non-number");
double d = naNumValue(val).num;
- if (osg::isNaN(d)) {
+ if (SGMisc<double>::isNaN(d)) {
naRuntimeError(c, "props.setValue() passed a NaN");
}
if (naIsNil(r))
naRuntimeError(c, "props.setDoubleValue() with non-number");
- if (osg::isNaN(r.num)) {
+ if (SGMisc<double>::isNaN(r.num)) {
naRuntimeError(c, "props.setDoubleValue() passed a NaN");
}