Skip to content

Use built-in terrain presampler if available #4

Open

Description

@HoorayFGFS

bombable has only two places where geodinfo() is called, most calls happen through the elev() wrapper.

The advanced weather system uses the dedicated terrain presampler available since 2.6, which is built on top of the property tree and which can be used to directly sample a whole area, without the Nasal-space overhead:

http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg35525.html
"The property /environment/terrain/area[0]/enabled is set to a boolean
value of false on startup. This ensures the sampler is instantiated but
not running. You should set it to true when you enable local weather and
reset it to false when you disable local weather. Also, make sure to set
/environment/terrain/area[0]/input/use-aircraft-position to true if want
to sample the area around the aircraft's position.
So, No: the --prop switch will no longer be needed at startup, the
sampler is there but disabled, you can assume the system will be available."

The local weather system uses a separate compat_layer.nas module to handle the differences among different FG versions, so that there is a consistent backend for the remaining code, differences among FG versions are abstracted away using a single place, all of the remaining code uses an "ideal API", without having to know which method is used:

http://mapserver.flightgear.org/git/?p=fgdata;a=blob;f=Nasal/local_weather/local_weather.nas;h=6f600315a6dd7cc4e79e3b3a0d71f318391b052e;hb=3176ea035213842191241796525848740bc359af#l2666

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions