Norman Vine wrote:
> 
> Curtis L.Olson writes:
> >
> >Norman Vine writes:
> >> another problem is in simgear / sky / cloud.cxx
> >>
> >> bool SGCloudLayer::reposition( sgVec3 p, sgVec3 up, double
> >lon, double lat,
> >>                             double alt )
> >> {
> >> ....
> >>     // now calculate update texture coordinates
> >>     if ( last_lon < -900 ) {
> >>              cout << "last_lon < -900" << endl;
> >>              last_lon = lon;
> >>              last_lat = lat;
> >>     }
> >>     // change  if( lon - lat_lon != 0 || lat-last_lat != 0 )  to
> >>     if ( fabs(lon-last_lon) > FLT_EPSILON || fabs(lat-last_lat) >
> >> FLT_EPSILON ) {
> >> ...
> >> }
> >
> >Norman, can you provide any further information as to how this change
> >eliminates problems on the windows side?
> 
> when there is no change there is a floating point exception in
> calc_gc_course_dist().  I tied this with both the original and the
> optimized versions.
> 
> >I understand that in general with floating point compares you want to
> >test if the absolute value of the difference is < some epsilon,
> >however, in this case I think I'm justified with my code.  The current
> >code is actually:
> >
> >        if ( lon != last_lon || lat != last_lat ) {
> >
> 

Great! After applying that fix I'm able to run FGFS with LaRCsim again!!


> Better yet enable FPE exception reporting
> 
> // I think this is correct for Linux
> [...]

I haven't tried how that affects MSVC, but if it enables floating point
error checking it's a very important addition that should be enabled
during every debug build.
I strongly vote for including that, too.

CU,
Christian


--
The idea is to die young as late as possible.        -- Ashley Montague

Whoever that is/was; (c) by Douglas Adams would have been better...

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to