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?

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 ) {

I think what I have is more likely to do what I intend than what you
indicate above to be the original code.  If the position has changed
at all, we want to adjust the cloud texture coordinates.  In this case
I do want to test for any inequality no matter how tiny.  (i.e. I'm
*not* testing if some algorithm converges by seeing if last_value !=
value, nor am I testing if two vertices are identical in a
triangulator.)

But, if your change actually fixes a problem, I don't want to simply
ignore it because I don't understand it.  But if that is the case I
really do not understand how or why or what was breaking.  Could you
point me to the actual statement that was failing and indicate what
the relevant values were?  I could just be missing something obvious.

Thanks,

Curt.
-- 
Curtis Olson   Intelligent Vehicles Lab         FlightGear Project
Twin Cities    [EMAIL PROTECTED]                  [EMAIL PROTECTED]
Minnesota      http://www.menet.umn.edu/~curt   http://www.flightgear.org

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

Reply via email to