1
0
Fork 0

Merge branch 'master' of gitorious.org:fg/fgdata

This commit is contained in:
BARANGER Emmanuel 2013-02-25 22:53:57 +01:00
commit 6be4ceb7eb
15 changed files with 887 additions and 258 deletions

View file

@ -19,6 +19,7 @@ var ai_enabled = nil;
var engines = nil;
var tanks = [];
var refuelingN = nil;
var contactN = nil;
var aimodelsN = nil;
var types = {};
@ -47,7 +48,18 @@ var update_loop = func {
}
var refueling = serviceable and size(tankers) > 0;
refuelingN.setBoolValue(refueling);
if (refuelingN.getNode("report-contact", 1).getValue()) {
if (refueling and !contactN.getValue()) {
setprop("/sim/messages/copilot", "Engage");
}
if (!refueling and contactN.getValue()) {
setprop("/sim/messages/copilot", "Disengage");
}
}
contactN.setBoolValue(refueling);
if (fuel_freeze)
return settimer(update_loop, UPDATE_PERIOD);
@ -65,8 +77,12 @@ var update_loop = func {
# calculate fuel received
if (refueling) {
# assume max flow rate is 6000 lbs/min (for KC135)
var received = 100 * UPDATE_PERIOD;
# Flow rate is the minimum of the tanker maxium rate
# and the aircraft maximum rate. Both are expressed
# in lbs/min
var fuel_rate = math.min(tankers[0].getNode("refuel/max-fuel-transfer-lbs-min", 1).getValue() or 6000,
refuelingN.getNode("max-fuel-transfer-lbs-min", 1).getValue());
var received = UPDATE_PERIOD * fuel_rate / 60;
consumed -= received;
}
@ -169,7 +185,8 @@ setlistener("/sim/signals/fdm-initialized", func {
if (contains(globals, "fuel") and typeof(fuel) == "hash")
fuel.loop = func nil; # kill $FG_ROOT/Nasal/fuel.nas' loop
refuelingN = props.globals.initNode("/systems/refuel/contact", 0, "BOOL");
contactN = props.globals.initNode("/systems/refuel/contact", 0, "BOOL");
refuelingN = props.globals.getNode("/systems/refuel", 1);
aimodelsN = props.globals.getNode("ai/models", 1);
engines = props.globals.getNode("engines", 1).getChildren("engine");

View file

@ -74,33 +74,16 @@ var checkGear = func(n) {
setlistener("controls/flight/flaps", checkFlaps);
setlistener("controls/gear/gear-down", checkGear);
# =============================== Pilot G stuff (taken from hurricane.nas) =================================
var pilot_g = props.globals.getNode("fdm/jsbsim/accelerations/a-pilot-z-ft_sec2", 1);
pilot_g.setDoubleValue(0);
var g_damp = 0;
var updatePilotG = func {
var g = pilot_g.getValue() ;
#if (g == nil) { g = 0; }
g_damp = ( g * 0.2) + (g_damp * 0.8);
settimer(updatePilotG, 0.2);
}
updatePilotG();
var checkGandVNE = func {
if (getprop("/sim/freeze/replay-state"))
return;
var g = getprop("/accelerations/pilot-gdamped") or 1;
var max_positive = getprop("limits/max-positive-g");
var max_negative = getprop("limits/max-negative-g");
var msg = "";
# Convert the ft/sec^2 into Gs - allowing for gravity.
var g = (- g_damp) / 32;
if ((max_positive != nil) and (g > max_positive))
{
msg = "Airframe structural positive-g load limit exceeded!";

View file

@ -0,0 +1,116 @@
<?xml version="1.0"?>
<!-- General settings for icebergs in the ocean -->
<PropertyList>
<!-- Define the boxes with given latitude/longitude -->
<condition>
<and>
<equals>
<property>sim/startup/season</property>
<value>summer</value>
</equals>
<or>
<!-- Arctic -->
<and>
<greater-than>
<property>position/longitude-deg</property>
<value>-180.0</value>
</greater-than>
<less-than>
<property>position/longitude-deg</property>
<value>180.0</value>
</less-than>
<greater-than>
<property>position/latitude-deg</property>
<value>68.0</value>
</greater-than>
<less-than>
<property>position/latitude-deg</property>
<value>90.0</value>
</less-than>
</and>
<!-- Greenland -->
<and>
<greater-than>
<property>position/longitude-deg</property>
<value>-60.0</value>
</greater-than>
<less-than>
<property>position/longitude-deg</property>
<value>-30.0</value>
</less-than>
<greater-than>
<property>position/latitude-deg</property>
<value>60.0</value>
</greater-than>
<less-than>
<property>position/latitude-deg</property>
<value>90.0</value>
</less-than>
</and>
<!-- Antarctica -->
<and>
<greater-than>
<property>position/longitude-deg</property>
<value>-180.0</value>
</greater-than>
<less-than>
<property>position/longitude-deg</property>
<value>180.0</value>
</less-than>
<greater-than>
<property>position/latitude-deg</property>
<value>-90.0</value>
</greater-than>
<less-than>
<property>position/latitude-deg</property>
<value>-68.0</value>
</less-than>
</and>
</or>
</and>
</condition>
<xsize>400</xsize>
<ysize>400</ysize>
<object-group>
<range-m>40000</range-m>
<object>
<path>Models/Geometry/container_carrier.ac</path>
<coverage-m2>500000000</coverage-m2>
<heading-type>random</heading-type>
</object>
</object-group>
<object-group>
<range-m>40000</range-m>
<object>
<path>Models/Maritime/Ice/iceberg1.xml</path>
<path>Models/Maritime/Ice/iceberg2.xml</path>
<path>Models/Maritime/Ice/iceberg3.xml</path>
<coverage-m2>5000000</coverage-m2>
<heading-type>random</heading-type>
</object>
</object-group>
<ambient>
<r>0.0</r>
<g>0.0</g>
<b>0.0</b>
<a>1.0</a>
</ambient>
<diffuse>
<r>0.4</r>
<g>0.4</g>
<b>0.4</b>
<a>1.0</a>
</diffuse>
<specular>
<r>0.0</r>
<g>0.0</g>
<b>0.2</b>
<a>1.0</a>
</specular>
<shininess>0</shininess>
<solid>0</solid>
<rolling-friction>2</rolling-friction>
<bumpiness>0.8</bumpiness>
</PropertyList>

View file

@ -1282,6 +1282,385 @@
</material>
<!-- REGIONAL DEFINITIONS - ICELAND -->
<material include="Materials/regions/iceland.xml">
<name>Landmass</name>
<name>SomeSort</name>
<name>Island</name>
<name>Default</name>
<texture-set>
<texture>Terrain/lava1.png</texture>
<texture n="11">Terrain/grass_hires.png</texture>
<texture n="12">Terrain/rocks-lava.png</texture>
<texture n="13">Terrain/rocks-lava.png</texture>
<texture n="15">Terrain/rocks-lava.png</texture>
</texture-set>
<xsize>2000</xsize>
<ysize>2000</ysize>
<light-coverage>10000000.0</light-coverage>
<shininess>2.5</shininess>
<rolling-friction>0.1</rolling-friction>
<friction-factor>0.7</friction-factor>
<bumpiness>0.1</bumpiness>
</material>
<material include="Materials/regions/iceland.xml">
<name>EvergreenBroadCover</name>
<name>DeciduousBroadCover</name>
<name>DeciduousForest</name>
<texture-set>
<texture>Terrain/iceland_grass-autumn.png</texture>
<texture n="11">Terrain/grass_green_hires-autumn.png</texture>
<texture n="12">Terrain/dry_pasture4.png</texture>
<texture n="13">Terrain/rocks-lava.png</texture>
<texture n="15">Terrain/rock.png</texture>
</texture-set>
<parameters>
<dot_density>0.1</dot_density>
</parameters>
<xsize>2000</xsize>
<ysize>2000</ysize>
<light-coverage>10000000.0</light-coverage>
<!--<wood-coverage>800000.0</wood-coverage>
<tree-texture>Trees/deciduous-summer.png</tree-texture>
<tree-varieties>8</tree-varieties>
<tree-range-m alias="/params/forest/tree-range-m"/>
<tree-height-m>25.0</tree-height-m>
<tree-width-m>15.0</tree-width-m>-->
<rolling-friction>1</rolling-friction>
<bumpiness>0.85</bumpiness>
</material>
<material include="Materials/regions/iceland.xml">
<name>Sand</name>
<texture-set>
<texture>Terrain/lava1.png</texture>
<texture n="11">Terrain/lava_hires.png</texture>
<texture n="12">Terrain/rocks-desert.png</texture>
<texture n="13">Terrain/rocks-desert.png</texture>
<texture n="15">Terrain/rocks-lava.png</texture>
</texture-set>
<xsize>2000</xsize>
<ysize>2000</ysize>
<light-coverage>10000000.0</light-coverage>
<shininess>2.5</shininess>
<rolling-friction>0.1</rolling-friction>
<friction-factor>0.7</friction-factor>
<bumpiness>0.1</bumpiness>
</material>
<material include="Materials/regions/iceland.xml">
<name>ShrubCover</name>
<name>ShrubGrassCover</name>
<name>ScrubCover</name>
<name>Scrub</name>
<name>Sclerophyllous</name>
<texture-set>
<texture>Terrain/shrub1-autumn.png</texture>
<texture n="11">Terrain/grass_green_hires-autumn.png</texture>
<texture n="12">Terrain/herbtundra_iceland.png</texture>
<texture n="13">Terrain/rocks-lava.png</texture>
<texture n="15">Terrain/rock.png</texture>
</texture-set>
<parameters>
<dot_density>0.1</dot_density>
<transition_model>0.7</transition_model>
<hires_overlay_bias>-0.05</hires_overlay_bias>
</parameters>
<xsize>2000</xsize>
<ysize>2000</ysize>
<diffuse>
<r>0.86</r>
<g>0.86</g>
<b>0.86</b>
<a>1.0</a>
</diffuse>
<specular>
<r>0.1</r>
<g>0.1</g>
<b>0.1</b>
<a>1.0</a>
</specular>
<shininess>1.2</shininess>
<light-coverage>20000000.0</light-coverage>
<wood-coverage>12000.0</wood-coverage>
<tree-texture>Trees/mixed-shrub.png</tree-texture>
<tree-varieties>8</tree-varieties>
<tree-range-m alias="/params/forest/tree-range-m"/>
<tree-height-m>2.0</tree-height-m>
<tree-width-m>2.0</tree-width-m>
<rolling-friction>0.6</rolling-friction>
<bumpiness>0.4</bumpiness>
</material>
<material include="Materials/regions/iceland.xml">
<name>DryLake</name>
<name>IntermittentReservoir</name>
<name>IntermittentLake</name>
<texture-set>
<texture>Terrain/lava_drylake.png</texture>
<texture n="11">Terrain/lava_drylake.png</texture>
</texture-set>
<xsize>2000</xsize>
<ysize>2000</ysize>
<solid>1</solid>
<friction-factor>0.9</friction-factor>
<rolling-friction>0.04</rolling-friction>
<bumpiness>0.1</bumpiness>
</material>
<material include="Materials/regions/iceland.xml">
<name>Marsh</name>
<name>Littoral</name>
<name>FloodLand</name>
<name>SaltMarsh</name>
<name>HerbWetlandCover</name>
<name>WoodedWetlandCover</name>
<name>Bog</name>
<name>Heath</name>
<texture-set>
<texture>Terrain/marsh4a-autumn.png</texture>
<texture n="12">Terrain/marsh4a-autumn.png</texture>
<texture n="11">Terrain/grass_hires.png</texture>
</texture-set>
<parameters>
<grain_strength>0.9</grain_strength>
<intrinsic_wetness>0.3</intrinsic_wetness>
</parameters>
<xsize>2000</xsize>
<ysize>2000</ysize>
<solid>1</solid>
<light-coverage>40000000.0</light-coverage>
<friction-factor>0.8</friction-factor>
<rolling-friction>0.3</rolling-friction>
<bumpiness>0.2</bumpiness>
<load-resistance>1e30</load-resistance>
</material>
<material include="Materials/regions/iceland.xml">
<name>HerbTundraCover</name>
<name>HerbTundra</name>
<effect>Effects/herbtundra</effect>
<texture-set>
<texture>Terrain/herbtundra_iceland.png</texture>
<texture n="11">Terrain/grass_green_hires-autumn.png</texture>
<texture n="12">Terrain/rocks-lava.png</texture>
<texture n="15">Terrain/grass_hires.png</texture>
</texture-set>
<parameters>
<dot_size>5.0</dot_size>
<grain_strength>0.9</grain_strength>
<hires_overlay_bias>-0.15</hires_overlay_bias>
</parameters>
<xsize>2000</xsize>
<ysize>2000</ysize>
<light-coverage>4000000.0</light-coverage>
<diffuse>
<r>0.93</r>
<g>0.95</g>
<b>0.93</b>
<a>1.0</a>
</diffuse>
<specular>
<r>0.1</r>
<g>0.12</g>
<b>0.1</b>
<a>1.0</a>
</specular>
<shininess>1.2</shininess>
<solid>1</solid>
<friction-factor>0.8</friction-factor>
<rolling-friction>0.1</rolling-friction>
<bumpiness>0.15</bumpiness>
<load-resistance>1e30</load-resistance>
</material>
<!-- REGIONAL DEFINITIONS - NORTH ATLANTIC ISLANDS -->
<material include="Materials/regions/north_atlantic_islands.xml">
<name>GrassCover</name>
<name>HerbTundraCover</name>
<name>HerbTundra</name>
<name>BareTundraCover</name>
<name>MixedTundraCover</name>
<name>Cemetery</name>
<effect>Effects/landmass-nowood</effect>
<texture-set>
<texture>Terrain/tundra2-autumn.png</texture>
<texture n="11">Terrain/grass_green_hires-autumn.png</texture>
<texture n="12">Terrain/rock_dark.png</texture>
</texture-set>
<parameters>
<grain_strength>0.8</grain_strength>
<transition_model>0.8</transition_model>
<hires_overlay_bias>-0.05</hires_overlay_bias>
</parameters>
<xsize>2000</xsize>
<ysize>2000</ysize>
<light-coverage>4000000.0</light-coverage>
<diffuse>
<r>0.93</r>
<g>0.95</g>
<b>0.93</b>
<a>1.0</a>
</diffuse>
<specular>
<r>0.1</r>
<g>0.12</g>
<b>0.1</b>
<a>1.0</a>
</specular>
<shininess>1.2</shininess>
<solid>1</solid>
<friction-factor>0.7</friction-factor>
<rolling-friction>0.1</rolling-friction>
<bumpiness>0.15</bumpiness>
<load-resistance>1e30</load-resistance>
</material>
<material include="Materials/regions/north_atlantic_islands.xml">
<name>DeciduousBroadCover</name>
<name>DeciduousForest</name>
<name>Marsh</name>
<name>Littoral</name>
<name>FloodLand</name>
<name>SaltMarsh</name>
<name>HerbWetlandCover</name>
<name>WoodedWetlandCover</name>
<name>Bog</name>
<name>Heath</name>
<texture-set>
<texture>Terrain/marsh4a-autumn.png</texture>
<texture n="12">Terrain/rock_dark.png</texture>
<texture n="11">Terrain/grass_green_hires-autumn.png</texture>
<texture n="15">Terrain/grass_hires.png</texture>
</texture-set>
<parameters>
<intrinsic_wetness>0.1</intrinsic_wetness>
<hires_overlay_bias>-0.07</hires_overlay_bias>
<grain_strength>0.9</grain_strength>
<transition_model>1.0</transition_model>
</parameters>
<xsize>2000</xsize>
<ysize>2000</ysize>
<solid>1</solid>
<light-coverage>40000000.0</light-coverage>
<friction-factor>0.8</friction-factor>
<rolling-friction>0.3</rolling-friction>
<bumpiness>0.2</bumpiness>
<load-resistance>1e30</load-resistance>
</material>
<material include="Materials/regions/north_atlantic_islands.xml">
<name>DryCropPastureCover</name>
<name>DryCrop</name>
<texture-set>
<texture>Terrain/iceland_grass-autumn.png</texture>
<texture n="11">Terrain/grass_green_hires-autumn.png</texture>
<texture n="12">Terrain/rock_dark.png</texture>
</texture-set>
<parameters>
<transition_model>0.8</transition_model>
<hires_overlay_bias>-0.1</hires_overlay_bias>
</parameters>
<xsize>2000</xsize>
<ysize>2000</ysize>
<solid>1</solid>
<friction-factor>0.9</friction-factor>
<rolling-friction>0.1</rolling-friction>
<bumpiness>0.6</bumpiness>
<load-resistance>1e30</load-resistance>
<light-coverage>2000000.0</light-coverage>
</material>
<material include="Materials/regions/north_atlantic_islands.xml">
<name>MixedCropPastureCover</name>
<name>MixedCrop</name>
<name>IrrCropPastureCover</name>
<name>IrrCrop</name>
<name>Orchard</name>
<name>Olives</name>
<name>Vineyard</name>
<name>Rice</name>
<texture-set>
<texture>Terrain/cropgrass-hires-autumn.png</texture>
<texture n="11">Terrain/grass_green_hires-autumn.png</texture>
</texture-set>
<object-mask>Terrain/cropgrass-hires.mask.png</object-mask>
<parameters>
<hires_overlay_bias>-0.1</hires_overlay_bias>
</parameters>
<xsize>2000</xsize>
<ysize>2000</ysize>
<light-coverage>2000000.0</light-coverage>
<solid>1</solid>
<friction-factor>0.9</friction-factor>
<rolling-friction>0.3</rolling-friction>
<bumpiness>0.6</bumpiness>
<load-resistance>1e30</load-resistance>
<object-group include="Materials/base/farm-buildings.xml"/>
<wood-coverage>5000.0</wood-coverage>
<tree-texture>Trees/mixed-summer.png</tree-texture>
<tree-varieties>8</tree-varieties>
<tree-range-m alias="/params/forest/tree-range-m"/>
<tree-height-m>20.0</tree-height-m>
<tree-width-m>12.0</tree-width-m>
</material>
<material include="Materials/regions/north_atlantic_islands.xml">
<name>Landmass</name>
<name>EvergreenBroadCover</name>
<name>EvergreenForest</name>
<name>MixedForestCover</name>
<name>MixedForest</name>
<name>SomeSort</name>
<name>Island</name>
<name>Default</name>
<name>ShrubCover</name>
<name>ShrubGrassCover</name>
<name>ScrubCover</name>
<name>Scrub</name>
<name>Sclerophyllous</name>
<texture-set>
<texture>Terrain/shrub1-autumn.png</texture>
<texture n="11">Terrain/grass_green_hires-autumn.png</texture>
<texture n="12">Terrain/rock_dark.png</texture>
<texture n="15">Terrain/rock_dark.png</texture>
</texture-set>
<parameters>
<dot_density>0.1</dot_density>
<transition_model>0.7</transition_model>
<hires_overlay_bias>-0.05</hires_overlay_bias>
</parameters>
<xsize>2000</xsize>
<ysize>2000</ysize>
<diffuse>
<r>0.86</r>
<g>0.86</g>
<b>0.86</b>
<a>1.0</a>
</diffuse>
<specular>
<r>0.1</r>
<g>0.1</g>
<b>0.1</b>
<a>1.0</a>
</specular>
<shininess>1.2</shininess>
<light-coverage>20000000.0</light-coverage>
<wood-coverage>12000.0</wood-coverage>
<tree-texture>Trees/mixed-shrub.png</tree-texture>
<tree-varieties>8</tree-varieties>
<tree-range-m alias="/params/forest/tree-range-m"/>
<tree-height-m>2.0</tree-height-m>
<tree-width-m>2.0</tree-width-m>
<rolling-friction>0.6</rolling-friction>
<bumpiness>0.4</bumpiness>
</material>
<!-- REGIONAL DEFINITIONS - MIDDLE EAST -->
@ -2239,169 +2618,12 @@
<load-resistance>1e30</load-resistance>
</material>
<!-- REGIONAL DEFINITIONS - ICELAND -->
<material include="Materials/regions/iceland.xml">
<name>Landmass</name>
<name>SomeSort</name>
<name>Island</name>
<name>Default</name>
<texture-set>
<texture>Terrain/lava1.png</texture>
<texture n="11">Terrain/grass_hires.png</texture>
<texture n="12">Terrain/rocks-lava.png</texture>
</texture-set>
<xsize>2000</xsize>
<ysize>2000</ysize>
<light-coverage>10000000.0</light-coverage>
<shininess>2.5</shininess>
<rolling-friction>0.1</rolling-friction>
<friction-factor>0.7</friction-factor>
<bumpiness>0.1</bumpiness>
</material>
<material include="Materials/regions/iceland.xml">
<name>DeciduousBroadCover</name>
<name>DeciduousForest</name>
<texture-set>
<texture>Terrain/iceland_grass.png</texture>
<texture n="11">Terrain/grass_green_hires.png</texture>
<texture n="12">Terrain/dry_pasture4.png</texture>
</texture-set>
<xsize>2000</xsize>
<ysize>2000</ysize>
<light-coverage>10000000.0</light-coverage>
<wood-coverage>400000.0</wood-coverage>
<tree-texture>Trees/deciduous-summer.png</tree-texture>
<tree-varieties>8</tree-varieties>
<tree-range-m alias="/params/forest/tree-range-m"/>
<tree-height-m>25.0</tree-height-m>
<tree-width-m>15.0</tree-width-m>
<rolling-friction>1</rolling-friction>
<bumpiness>0.85</bumpiness>
</material>
<material include="Materials/regions/iceland.xml">
<name>Sand</name>
<texture-set>
<texture>Terrain/lava1.png</texture>
<texture n="11">Terrain/lava_hires.png</texture>
<texture n="12">Terrain/rocks-desert.png</texture>
</texture-set>
<xsize>2000</xsize>
<ysize>2000</ysize>
<light-coverage>10000000.0</light-coverage>
<shininess>2.5</shininess>
<rolling-friction>0.1</rolling-friction>
<friction-factor>0.7</friction-factor>
<bumpiness>0.1</bumpiness>
</material>
<material include="Materials/regions/iceland.xml">
<name>ShrubCover</name>
<name>ShrubGrassCover</name>
<name>ScrubCover</name>
<name>Scrub</name>
<name>Sclerophyllous</name>
<texture-set>
<texture>Terrain/shrub1-autumn.png</texture>
<texture n="11">Terrain/grass_green_hires.png</texture>
<texture n="12">Terrain/herbtundra_iceland.png</texture>
</texture-set>
<xsize>2000</xsize>
<ysize>2000</ysize>
<diffuse>
<r>0.86</r>
<g>0.86</g>
<b>0.86</b>
<a>1.0</a>
</diffuse>
<specular>
<r>0.1</r>
<g>0.1</g>
<b>0.1</b>
<a>1.0</a>
</specular>
<shininess>1.2</shininess>
<light-coverage>20000000.0</light-coverage>
<wood-coverage>12000.0</wood-coverage>
<tree-texture>Trees/mixed-shrub.png</tree-texture>
<tree-varieties>8</tree-varieties>
<tree-range-m alias="/params/forest/tree-range-m"/>
<tree-height-m>2.0</tree-height-m>
<tree-width-m>2.0</tree-width-m>
<rolling-friction>0.6</rolling-friction>
<bumpiness>0.4</bumpiness>
</material>
<material include="Materials/regions/iceland.xml">
<name>DryLake</name>
<name>IntermittentReservoir</name>
<name>IntermittentLake</name>
<texture-set>
<texture>Terrain/lava_drylake.png</texture>
<texture n="11">Terrain/lava_drylake.png</texture>
</texture-set>
<xsize>2000</xsize>
<ysize>2000</ysize>
<solid>1</solid>
<friction-factor>0.9</friction-factor>
<rolling-friction>0.04</rolling-friction>
<bumpiness>0.1</bumpiness>
</material>
<material include="Materials/regions/iceland.xml">
<name>Marsh</name>
<name>Littoral</name>
<name>FloodLand</name>
<name>SaltMarsh</name>
<name>HerbWetlandCover</name>
<name>WoodedWetlandCover</name>
<texture-set>
<texture>Terrain/marsh2.png</texture>
<texture n="11">Terrain/grass_hires.png</texture>
</texture-set>
<xsize>2000</xsize>
<ysize>2000</ysize>
<solid>1</solid>
<light-coverage>40000000.0</light-coverage>
<friction-factor>0.8</friction-factor>
<rolling-friction>0.3</rolling-friction>
<bumpiness>0.2</bumpiness>
<load-resistance>1e30</load-resistance>
</material>
<material include="Materials/regions/iceland.xml">
<name>HerbTundraCover</name>
<name>HerbTundra</name>
<effect>Effects/herbtundra</effect>
<texture-set>
<texture>Terrain/herbtundra_iceland.png</texture>
<texture n="11">Terrain/lava_hires.png</texture>
<texture n="12">Terrain/rocks-lava.png</texture>
</texture-set>
<xsize>2000</xsize>
<ysize>2000</ysize>
<light-coverage>4000000.0</light-coverage>
<diffuse>
<r>0.93</r>
<g>0.95</g>
<b>0.93</b>
<a>1.0</a>
</diffuse>
<specular>
<r>0.1</r>
<g>0.12</g>
<b>0.1</b>
<a>1.0</a>
</specular>
<shininess>1.2</shininess>
<solid>1</solid>
<friction-factor>0.8</friction-factor>
<rolling-friction>0.1</rolling-friction>
<bumpiness>0.15</bumpiness>
<load-resistance>1e30</load-resistance>
<!-- ICEBERGS IN THE ARCTIC SEA REGIONS -->
<material include="Materials/regions/arctic_sea.xml">
<name>Ocean</name>
<effect>Effects/water</effect>
<texture>Terrain/water.png</texture>
</material>

View file

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<!-- General settings for all North Atlantic (Faroe, Shetland, Greenland,...) materials -->
<PropertyList>
<!-- Define the islands as a box with given latitude/longitude -->
<condition>
<and>
<equals>
<property>sim/startup/season</property>
<value>summer</value>
</equals>
<and>
<greater-than>
<property>position/longitude-deg</property>
<value>-60.0</value>
</greater-than>
<less-than>
<property>position/longitude-deg</property>
<value>0.0</value>
</less-than>
<greater-than>
<property>position/latitude-deg</property>
<value>55.0</value>
</greater-than>
<less-than>
<property>position/latitude-deg</property>
<value>85.0</value>
</less-than>
</and>
</and>
</condition>
</PropertyList>

View file

@ -6,11 +6,6 @@ if (globals["tanker"] != nil) {
}
#--------------------------------------------------------------------------------------------------
var boom_tanker = "Models/Geometry/KC135/KC135.xml";
var probe_tanker = "Models/Geometry/KA6-D/KA6-D.xml";
var oclock = func(bearing) int(0.5 + geo.normdeg(bearing) / 30) or 12;
@ -75,7 +70,7 @@ var identity = {
var Tanker = {
new: func(aiid, callsign, tacan, type, kias, heading, coord) {
new: func(aiid, callsign, tacan, type, model, kias, maxfuel, pattern, heading, coord) {
var m = { parents: [Tanker] };
m.callsign = callsign;
m.tacan = tacan;
@ -83,7 +78,7 @@ var Tanker = {
m.heading = m.course = m.track_course = heading;
m.out_of_range_time = 0;
m.interval = 10;
m.length = (getprop("tanker/pattern-length-nm") or 50) * NM2M;
m.length = pattern;
m.roll = 0;
m.coord = geo.Coord.new(coord);
m.anchor = geo.Coord.new(coord).apply_course_distance(m.track_course, m.length); # ARCP
@ -111,6 +106,7 @@ var Tanker = {
m.ai.getNode("valid", 1).setBoolValue(1);
m.ai.getNode("navaids/tacan/channel-ID", 1).setValue(m.tacan);
m.ai.getNode("refuel/type", 1).setValue(type);
m.ai.getNode("refuel/max-fuel-transfer-lbs-min", 1).setValue(maxfuel);
m.ai.getNode("refuel/contact", 1).setBoolValue(0);
m.ai.getNode("radar/in-range", 1).setBoolValue(1);
@ -130,7 +126,8 @@ var Tanker = {
m.vOffsetN = m.ai.getNode("radar/v-offset", 1);
m.update();
m.model.getNode("path", 1).setValue(type == "boom" ? boom_tanker : probe_tanker);
m.model.getNode("path", 1).setValue(model);
m.model.getNode("latitude-deg-prop", 1).setValue(m.latN.getPath());
m.model.getNode("longitude-deg-prop", 1).setValue(m.lonN.getPath());
m.model.getNode("elevation-ft-prop", 1).setValue(m.altN.getPath());
@ -206,6 +203,7 @@ var Tanker = {
var dalt = alt - me.ac.alt();
var ac_hdg = getprop("/orientation/heading-deg");
var ac_pitch = getprop("/orientation/pitch-deg");
var ac_contact_dist = getprop("/systems/refuel/contact-radius-m");
var elev = math.atan2(dalt, me.distance) * R2D;
me.latN.setDoubleValue(me.coord.lat());
@ -219,11 +217,13 @@ var Tanker = {
me.rangeN.setDoubleValue(me.distance * M2NM);
me.brgN.setDoubleValue(me.bearing);
me.elevN.setDoubleValue(elev);
me.contactN.setBoolValue(me.distance < 76 and dalt > 0 # 250 ft
and abs(view.normdeg(me.bearing - ac_hdg)) < 20);
me.contactN.setBoolValue(me.distance < ac_contact_dist and
dalt > 0 and
abs(view.normdeg(me.bearing - ac_hdg)) < 20);
me.hOffsetN.setDoubleValue(me.bearing - ac_hdg);
me.vOffsetN.setDoubleValue(elev - ac_pitch);
me.hOffsetN.setDoubleValue(me.bearing - ac_hdg);
me.vOffsetN.setDoubleValue(elev - ac_pitch);
var droll = me.roll_target - me.roll;
if (droll > 0) {
@ -268,47 +268,80 @@ var Tanker = {
active: {},
};
# Factory methods
# Create a tanker based on a given /sim/ai/tankers/tanker property node
var create_tanker = func(tanker_node, course) {
var (aiid, callsign, tacanid) =_= identity.get();
var model = tanker_node.getNode("model", 1).getValue();
var type = tanker_node.getNode("type", 1).getValue();
var spd = tanker_node.getNode("speed-kts", 1).getValue() or 250;
var pattern = (tanker_node.getNode("pattern-length-nm", 1).getValue() or 50) * NM2M;
var maxfuel = tanker_node.getNode("max-fuel-transfer-lbs-min", 1).getValue() or 6000;
var request = func {
var alt = int(10 + rand() * 15) * 1000; # FL100--FL250
alt = skip_cloud_layer(alt * FT2M);
var dist = 6000 + rand() * 4000;
var coord = geo.aircraft_position().apply_course_distance(course, dist).set_alt(alt);
Tanker.new(aiid, callsign, tacanid, type, model, spd, maxfuel, pattern, course, coord);
}
# Request a new tanker
var request_new = func(tanker_node=nil) {
var tanker = values(Tanker.active);
if (size(tanker)) tanker[0].del();
request(tanker_node);
}
var request = func(tanker_node=nil) {
var tanker = values(Tanker.active);
if (size(tanker))
return tanker[0].identify();
if (tanker_node == nil) {
var type = props.globals.getNode("systems/refuel", 1).getChildren("type");
if (!size(type))
return;
type = type[rand() * size(type)].getValue();
var tankers = props.globals.getNode("/sim/ai/tankers", 1).getChildren("tanker");
foreach (var tanker; tankers) {
if (tanker.getNode("type", 1).getValue() == type) {
tanker_node = tanker;
break;
}
}
}
var hdg = getprop("orientation/heading-deg");
var course = hdg + (rand() - 0.5) * 60;
create_tanker(tanker_node, course);
}
var request_random = func(tanker_node=nil) {
var tanker = values(Tanker.active);
if (size(tanker))
return tanker[0].identify();
var type = props.globals.getNode("systems/refuel", 1).getChildren("type");
if (!size(type))
return;
type = type[rand() * size(type)].getValue();
if (tanker_node == nil) {
var type = props.globals.getNode("systems/refuel", 1).getChildren("type");
if (!size(type))
return;
type = type[rand() * size(type)].getValue();
var tankers = props.globals.getNode("/sim/ai/tankers", 1).getChildren("tanker");
foreach (var tanker; tankers) {
if (tanker.getNode("type", 1).getValue() == type) {
tanker_node = tanker;
break;
}
}
}
var (aiid, callsign, tacanid) =_= identity.get();
var hdg = getprop("orientation/heading-deg");
var course = hdg + (rand() - 0.5) * 60;
var dist = 6000 + rand() * 4000;
var alt = int(10 + rand() * 15) * 1000; # FL100--FL250
alt = skip_cloud_layer(alt * FT2M);
var coord = geo.aircraft_position().apply_course_distance(course, dist).set_alt(alt);
Tanker.new(aiid, callsign, tacanid, type, 250, hdg, coord);
}
var request_random = func {
var tanker = values(Tanker.active);
if (size(tanker))
return tanker[0].identify();
var type = props.globals.getNode("systems/refuel", 1).getChildren("type");
if (!size(type))
return;
type = type[rand() * size(type)].getValue();
var (aiid, callsign, tacanid) =_= identity.get();
var hdg = rand() * 360;
var course = rand() * 360;
var dist = 6000 + rand() * 4000;
var alt = int(10 + rand() * 15) * 1000; # FL100--FL250
alt = skip_cloud_layer(alt * FT2M);
var coord = geo.aircraft_position().apply_course_distance(course, dist).set_alt(alt);
Tanker.new(aiid, callsign, tacanid, type, 250, hdg, coord);
var course = rand() * 360;
create_tanker(tanker_node, course);
}

View file

@ -324,7 +324,7 @@ if (quality_level > 3)
float delta_z = hazeLayerAltitude - eye_alt;
if (dist > max(40.0, 0.04 * min(visibility,avisibility)))
if (dist > 0.04 * min(visibility,avisibility))
{
alt = eye_alt;

View file

@ -389,7 +389,7 @@ if ((dist < 5000.0)&& (quality_level > 3) && (wetness>0.0))
float delta_z = hazeLayerAltitude - eye_alt;
if (dist > max(40.0, 0.04 * min(visibility,avisibility)))
if (dist > 0.04 * min(visibility,avisibility))
//if ((gl_FragCoord.y > ylimit) || (gl_FragCoord.x < zlimit1) || (gl_FragCoord.x > zlimit2))
//if (dist > 40.0)
{

View file

@ -409,7 +409,7 @@ if ((dist < 5000.0)&& (quality_level > 3) && (wetness>0.0))
float delta_z = hazeLayerAltitude - eye_alt;
if (dist > max(40.0, 0.04 * min(visibility,avisibility)))
if (dist > 0.04 * min(visibility,avisibility))
//if ((gl_FragCoord.y > ylimit) || (gl_FragCoord.x < zlimit1) || (gl_FragCoord.x > zlimit2))
//if (dist > 40.0)
{

View file

@ -508,7 +508,7 @@ if ((dist < 5000.0)&& (quality_level > 3) && (combined_wetness>0.0))
float delta_z = hazeLayerAltitude - eye_alt;
if (dist > max(40.0, 0.04 * min(visibility,avisibility)))
if (dist > 0.04 * min(visibility,avisibility))
//if ((gl_FragCoord.y > ylimit) || (gl_FragCoord.x < zlimit1) || (gl_FragCoord.x > zlimit2))
//if (dist > 40.0)
{

View file

@ -12,7 +12,7 @@ uniform sampler2D texture;
varying float yprime_alt;
varying float mie_angle;
uniform float visibility;
uniform float avisibility;
@ -129,8 +129,7 @@ void main()
float delta_z = hazeLayerAltitude - eye_alt;
float dist = length(relPos);
if (dist > max(40.0, 0.04 * min(visibility,avisibility)))
//if (dist > 40.0)
if (dist > 0.04 * min(visibility,avisibility))
{
alt = eye_alt;

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 KiB

View file

@ -640,9 +640,6 @@
<stretch>true</stretch>
<pref-width>400</pref-width>
<pref-height>400</pref-height>
<view n="0">400</view>
<view n="1">400</view>
<features>
<!-- TODO: use params and aliases to make this shorter -->

View file

@ -5,12 +5,63 @@
<x>-10</x>
<layout>vbox</layout>
<nasal>
<open>
var dlgRoot = cmdarg();
var tankers = props.globals.getNode("/sim/ai/tankers/", 1).getChildren("tanker");
var types = props.globals.getNode("/systems/refuel/", 1).getChildren("type");
var tanker_node = props.globals.getNode("/sim/gui/dialogs/tanker/tanker", 1);
# Force default speed of 250kts
setprop("/sim/gui/dialogs/tanker/tanker/speed-kts", 250.0);
if (size(types) == 0) {
# This really shouldn't happen, as Nasal/tanker.nas disables this menu item
# if no refueling type is available.
gui.popupTip("Air to air refueling unavailable in this aircraft", 5);
fgcommand("dialog-close", props.Node.new({ "dialog-name" : "tanker"}));
}
if (size(tankers) > 0) {
var combo = gui.findElementByName(dlgRoot, "tanker-combo");
var idx = 0;
foreach (var t; tankers) {
foreach(var type; types) {
if (type.getValue() == t.getNode("type", 1).getValue()) {
combo.getChild("value", idx, 1).setValue(t.getNode("name", 1).getValue());
idx += 1;
}
}
}
}
var select_tanker = func() {
var name = getprop("/sim/gui/dialogs/tanker/selected-tanker");
foreach (var t; tankers) {
if (name == t.getNode("name", 1).getValue()) {
props.copy(t, tanker_node);
}
}
}
var generate_tanker = func() {
if (tanker_node.getNode("name", 1).getValue()) {
tanker.request_new(tanker_node);
}
}
</open>
</nasal>
<group>
<layout>hbox</layout>
<empty><stretch>1</stretch></empty>
<text>
<label>Tanker</label>
<label>Air-to-Air Refueling Tanker</label>
</text>
<empty><stretch>1</stretch></empty>
@ -30,21 +81,195 @@
<hrule/>
<button>
<legend>Request</legend>
<equal>true</equal>
<binding>
<command>nasal</command>
<script>tanker.request()</script>
</binding>
</button>
<group>
<layout>table</layout>
<text>
<row>0</row>
<col>0</col>
<halign>right</halign>
<label>Tanker:</label>
</text>
<combo>
<name>tanker-combo</name>
<row>0</row>
<col>1</col>
<colspan>2</colspan>
<halign>left</halign>
<property>/sim/gui/dialogs/tanker/selected-tanker</property>
<editable>false</editable>
<pref-width>200</pref-width>
<halign>fill</halign>
<binding>
<command>dialog-apply</command>
<object-name>tanker-combo</object-name>
</binding>
<binding>
<command>nasal</command>
<script>select_tanker();</script>
</binding>
</combo>
<button>
<legend>Get Position</legend>
<equal>true</equal>
<binding>
<command>nasal</command>
<script>tanker.report()</script>
</binding>
</button>
<text>
<row>1</row>
<col>0</col>
<halign>right</halign>
<label>Type:</label>
</text>
<text>
<row>1</row>
<col>1</col>
<visible>
<equals>
<property>/sim/gui/dialogs/tanker/tanker/type</property>
<value>probe</value>
</equals>
</visible>
<colspan>3</colspan>
<halign>left</halign>
<label>Drogue and Probe</label>
</text>
<text>
<row>1</row>
<col>1</col>
<visible>
<equals>
<property>/sim/gui/dialogs/tanker/tanker/type</property>
<value>boom</value>
</equals>
</visible>
<colspan>3</colspan>
<halign>left</halign>
<label>Boom</label>
</text>
<text>
<row>2</row>
<col>0</col>
<halign>right</halign>
<label>Speed:</label>
</text>
<slider>
<name>tanker-speed</name>
<row>2</row>
<col>1</col>
<halign>fill</halign>
<min>100</min>
<max>350</max>
<live>true</live>
<property>/sim/gui/dialogs/tanker/tanker/speed-kts</property>
<binding>
<command>dialog-apply</command>
<object-name>tanker-speed</object-name>
</binding>
</slider>
<text>
<row>2</row>
<col>2</col>
<halign>left</halign>
<format>%2.0fkts</format>
<label>250</label>
<property>/sim/gui/dialogs/tanker/tanker/speed-kts</property>
<live>true</live>
</text>
<text>
<row>3</row>
<col>0</col>
<halign>right</halign>
<label>Contact radius:</label>
</text>
<slider>
<name>contact-radius</name>
<row>3</row>
<col>1</col>
<halign>fill</halign>
<min>1</min>
<max>100</max>
<property>/systems/refuel/contact-radius-m</property>
<binding>
<command>dialog-apply</command>
<object-name>contact-radius</object-name>
</binding>
</slider>
<text>
<row>3</row>
<col>2</col>
<halign>left</halign>
<format>%2.0fm</format>
<property>/systems/refuel/contact-radius-m</property>
<live>true</live>
</text>
<text>
<row>4</row>
<col>0</col>
<halign>right</halign>
<label>Report refueling:</label>
</text>
<checkbox>
<name>report-contact</name>
<row>4</row>
<col>1</col>
<halign>left</halign>
<property>/systems/refuel/report-contact</property>
<binding>
<command>dialog-apply</command>
<object-name>report-contact</object-name>
</binding>
</checkbox>
</group>
<hrule/>
<group>
<layout>hbox</layout>
<default-padding>5</default-padding>
<empty><stretch>true</stretch></empty>
<button>
<legend>Request</legend>
<equal>true</equal>
<binding>
<command>nasal</command>
<script>generate_tanker();</script>
</binding>
</button>
<empty><stretch>true</stretch></empty>
<button>
<legend>Get Position</legend>
<equal>true</equal>
<binding>
<command>nasal</command>
<script>tanker.report()</script>
</binding>
</button>
<empty><stretch>true</stretch></empty>
<button>
<legend>Close</legend>
<equal>true</equal>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
<empty><stretch>true</stretch></empty>
</group>
</PropertyList>

View file

@ -757,6 +757,7 @@ Started September 2000 by David Megginson, david@megginson.com
<scenarios-enabled type="bool" userarchive="y">true</scenarios-enabled>
<scenario>nimitz_demo</scenario>
<groundnet-cache type="bool">true</groundnet-cache>
<tankers include="AI/tankers.xml"/>
</ai>
<multiplay preserve="y">
@ -1202,6 +1203,9 @@ Started September 2000 by David Megginson, david@megginson.com
</vacuum>
<refuel>
<serviceable type="bool" archive="y">true</serviceable>
<contact-radius-m type="double">76</contact-radius-m>
<report-contact type="bool">false</report-contact>
<max-fuel-transfer-lbs-min type="double">6000</max-fuel-transfer-lbs-min>
</refuel>
</systems>