On Monday 24 January 2005 20:57, Curtis L. Olson wrote:

> Hi Durk,
> The terrain elevation system could stand to be looked at a bit.  I think
> there is still a lurking bug where the wrong elevation can be returned
> under some circumstances immediately after a tile boundary is crossed.
> There are some optimizations in the current system that assume you are
> reading ground elevation from the same tile or same position stream as
> before.
> Be aware that looking up terrain elevation from a TIN is an expensive
> operation so we don't want to do very many of these lookups per frame.
> Perhaps your AI system could do one lookup per frame and rotate through
> the model list so the entire list is updated ever "n" frames ... or
> prioritize models that are on/near the ground over models that are high
> above the ground where it really doesn't matter so much.
> Does that answer your question?

What I am really looking for is a hint where I can find the code in FlightGear 
that actually does these calculations. I tried tracing back through the 
functions that eventually set the value of 
the /environment/ground-elevation-m property, but couldn't really figure it 

Thanks for your explanation of the costs and pitfalls, I'll certainly take it 
into account. For a start, I would only do this for models that are on -or 
near- the ground, and use the general airport elevation for any other 
situation. Secondly, it would only be required to do this for traffic that is 
within a reasonable distance of the user. 


Flightgear-devel mailing list

Reply via email to