On Sunday 12 August 2007 13:48, Anders Gidenstam wrote: > On Wed, 8 Aug 2007, Stuart Buchanan wrote: > > I'd be very grateful if you could help me diagnose the problem, as I did > > quite a lot of testing, but didn't encounter this myself. > > > > One possibility is that my interpolation is "fighting" with something > > else trying to write to the weather properties. > > Hi! > > With Stuart's help I've looked closer at this and I think I've tracked > down the cause of the problem: > At least on my computer the sort() call on line 234 in > Environment/environment_ctrl.cxx sorts the vector entries by memory > address instead of altitude, i.e. the custom comparison predicate is not > used. This causes the tables of environment conditions to be reordered > into a wrong order at some weather updates, depending, basically, > on where the memory allocator places the objects. (Btw. why are they are > freshly allocated for each update?) > > The badly ordered tables cause the interpolation of the local weather to > start from the wrong conditions and, hence, the result is quite different > from the weather before the weather update - a wall of weather. > > How to fix this? The obvious way would be to ensure that the proper > ordering predicate is used by sort(). OTOH I'm not sure the sort is > needed at all - the entries are read from the property three, where I > think they are already sorted. I'm testing with out the sort now, and so > far I have seen no problems. > > Cheers, > > Anders
I wonder if this might be the cause of a bug I used to see where the weather settings i.e. wind speed & direction for different altitudes were not being applied correctly. For example, sitting on the runway I should have seen a wind speed of 3 kts but often I would actually get 6 kts, which was the setting for 500 ft. Then once I'd taken off and got up to 3000ft, instead of seeing the correct 10 kts I'd often get either 20 or 30 kts, which were the settings for 6000ft and 9000ft respectively. Re-applying the weather settings would then just randomly select one of the levels (3000ft, 6000ft or 9000ft). For example, as I re-applied the weather settings (without actually changing anything) I would see the wind speed/direction jump at random between the 3000ft, 6000ft & 9000ft settings. LeeE ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel