1
0
Fork 0

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

This commit is contained in:
BARANGER Emmanuel 2010-10-13 14:20:04 +02:00
commit b780ade69e
12 changed files with 444 additions and 51 deletions

View file

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<PropertyList>
<sim>
<model>
<formation>
<variant type="string">Echelon Stbd</variant>
<index type="int">2</index>
<position>
<x-offset>-75</x-offset>
<y-offset>75</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-150</x-offset>
<y-offset>150</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-75</x-offset>
<y-offset>75</y-offset>
<z-offset>0</z-offset>
</position>
</formation>
</model>
</sim>
</PropertyList>

View file

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<PropertyList>
<sim>
<model>
<formation>
<variant type="string">Echelon Port</variant>
<index type="int">3</index>
<position>
<x-offset>-75</x-offset>
<y-offset>-75</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-150</x-offset>
<y-offset>-150</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-75</x-offset>
<y-offset>-75</y-offset>
<z-offset>0</z-offset>
</position>
</formation>
</model>
</sim>
</PropertyList>

View file

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<PropertyList>
<sim>
<model>
<formation>
<variant type="string">Diamond</variant>
<index type="int">4</index>
<position>
<x-offset>-75</x-offset>
<y-offset>-75</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-75</x-offset>
<y-offset>75</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-75</x-offset>
<y-offset>-75</y-offset>
<z-offset>0</z-offset>
</position>
</formation>
</model>
</sim>
</PropertyList>

View file

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<PropertyList>
<sim>
<model>
<formation>
<variant type="string">Finger</variant>
<index type="int">5</index>
<position>
<x-offset>-100</x-offset>
<y-offset>-100</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-100</x-offset>
<y-offset>100</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-100</x-offset>
<y-offset>100</y-offset>
<z-offset>0</z-offset>
</position>
</formation>
</model>
</sim>
</PropertyList>

View file

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<PropertyList>
<sim>
<model>
<formation>
<variant type="string">Echelon Stbd Step Up</variant>
<index type="int">6</index>
<position>
<x-offset>-75</x-offset>
<y-offset>75</y-offset>
<z-offset>30</z-offset>
</position>
<position>
<x-offset>-150</x-offset>
<y-offset>150</y-offset>
<z-offset>60</z-offset>
</position>
<position>
<x-offset>-75</x-offset>
<y-offset>75</y-offset>
<z-offset>30</z-offset>
</position>
</formation>
</model>
</sim>
</PropertyList>

View file

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<PropertyList>
<sim>
<model>
<formation>
<variant type="string">Take Off</variant>
<index type="int">7</index>
<position>
<x-offset>-50</x-offset>
<y-offset>-50</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-300</x-offset>
<y-offset>0</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-50</x-offset>
<y-offset>-50</y-offset>
<z-offset>0</z-offset>
</position>
</formation>
</model>
</sim>
</PropertyList>

View file

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<PropertyList>
<sim>
<model>
<formation>
<variant type="string">Carrier Launch</variant>
<index type="int">1</index>
<position>
<x-offset>-15</x-offset>
<y-offset>-65</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-200</x-offset>
<y-offset>0</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-15</x-offset>
<y-offset>-63</y-offset>
<z-offset>0</z-offset>
</position>
</formation>
</model>
</sim>
</PropertyList>

View file

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<PropertyList>
<sim>
<model>
<formation>
<variant type="string">Swan</variant>
<index type="int">6</index>
<position>
<x-offset>-225</x-offset>
<y-offset>-75</y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-150</x-offset>
<y-offset></y-offset>
<z-offset>0</z-offset>
</position>
<position>
<x-offset>-75</x-offset>
<y-offset>75</y-offset>
<z-offset>0</z-offset>
</position>
</formation>
</model>
</sim>
</PropertyList>

View file

@ -0,0 +1,96 @@
#####################################################################################
# #
# this script runs the foramation selection utility #
# #
#####################################################################################
# ================================ Initalize ======================================
# Make sure all needed properties are present and accounted
# for, and that they have sane default values.
for(var i = 0; i < 3; i = i + 1){
setprop("/sim/model/formation/position[" ~ i ~ "]/x-offset", 0);
setprop("/sim/model/formation/position[" ~ i ~ "]/y-offset", 0);
setprop("/sim/model/formation/position[" ~ i ~ "]/z-offset", 0);
}
formation_variant_Node = props.globals.getNode("sim/formation/variant", 1);
formation_variant_Node.setIntValue(0);
formation_index_Node = props.globals.getNode("sim/formation/index", 1);
formation_index_Node.setIntValue(0);
tgt_x_offset_Node = props.globals.getNode("ai/models/wingman/position/tgt-x-offset",1);
tgt_y_offset_Node = props.globals.getNode("ai/models/wingman/position/tgt-y-offset",1);
tgt_z_offset_Node = props.globals.getNode("ai/models/wingman/position/tgt-z-offset",1);
tgt_x_offset_1_Node = props.globals.getNode("ai/models/wingman[1]/position/tgt-x-offset",1);
tgt_y_offset_1_Node = props.globals.getNode("ai/models/wingman[1]/position/tgt-y-offset",1);
tgt_z_offset_1_Node = props.globals.getNode("ai/models/wingman[1]/position/tgt-z-offset",1);
tgt_x_offset_2_Node = props.globals.getNode("ai/models/wingman[2]/position/tgt-x-offset",1);
tgt_y_offset_2_Node = props.globals.getNode("ai/models/wingman[2]/position/tgt-y-offset",1);
tgt_z_offset_2_Node = props.globals.getNode("ai/models/wingman[2]/position/tgt-z-offset",1);
props.globals.getNode("/sim/model/formation/position/x-offset",1);
var formation_dialog = nil;
initialize = func {
print("Initializing formation ...");
# initialise dialogs
aircraft.data.add("sim/model/formation/variant");
formation_dialog = gui.OverlaySelector.new("Select Formation",
"Aircraft/Generic/Formations",
"sim/model/formation/variant", nil, func(no) {
formation_variant_Node.setIntValue(no);
tgt_x_offset_Node.setDoubleValue(getprop("/sim/model/formation/position/x-offset"));
tgt_y_offset_Node.setDoubleValue(getprop("/sim/model/formation/position/y-offset"));
tgt_z_offset_Node.setDoubleValue(getprop("/sim/model/formation/position/z-offset"));
tgt_x_offset_1_Node.setDoubleValue(getprop("/sim/model/formation/position[1]/x-offset"));
tgt_y_offset_1_Node.setDoubleValue(getprop("/sim/model/formation/position[1]/y-offset"));
tgt_z_offset_1_Node.setDoubleValue(getprop("/sim/model/formation/position[1]/z-offset"));
tgt_x_offset_2_Node.setDoubleValue(getprop("/sim/model/formation/position[2]/x-offset"));
tgt_y_offset_2_Node.setDoubleValue(getprop("/sim/model/formation/position[2]/y-offset"));
tgt_z_offset_2_Node.setDoubleValue(getprop("/sim/model/formation/position[2]/z-offset"));
}
);
#set listeners
setlistener("/sim/model/formation/variant", func {
print("formation listener: ", getprop("/sim/model/formation/position/x-offset"));
if (tgt_x_offset_Node != nil){
print("formation listener getting", getprop("/sim/model/formation/position/x-offset"));
tgt_x_offset_Node.setDoubleValue(getprop("/sim/model/formation/position/x-offset"));
tgt_y_offset_Node.setDoubleValue(getprop("/sim/model/formation/position/y-offset"));
tgt_z_offset_Node.setDoubleValue(getprop("/sim/model/formation/position/z-offset"));
}
if (tgt_x_offset_1_Node != nil){
tgt_x_offset_1_Node.setDoubleValue(getprop("/sim/model/formation/position[1]/x-offset"));
tgt_y_offset_1_Node.setDoubleValue(getprop("/sim/model/formation/position[1]/y-offset"));
tgt_z_offset_1_Node.setDoubleValue(getprop("/sim/model/formation/position[1]/z-offset"));
}
if (tgt_x_offset_2_Node != nil){
tgt_x_offset_2_Node.setDoubleValue(getprop("/sim/model/formation/position[2]/x-offset"));
tgt_y_offset_2_Node.setDoubleValue(getprop("/sim/model/formation/position[2]/y-offset"));
tgt_z_offset_2_Node.setDoubleValue(getprop("/sim/model/formation/position[2]/z-offset"));
}
},
0,
1);
} # end func
###
# ====================== end Initialization ========================================
###
# Fire it up
setlistener("sim/signals/fdm-initialized", initialize);
# end

View file

@ -10,13 +10,6 @@
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<texture n="1">
<image>Textures/Water/water-refraction.png</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<texture n="2">
<image>Textures/Water/water-normalmap.png</image>
<filter>linear-mipmap-linear</filter>
@ -84,16 +77,6 @@
<use>texture[0]/internal-format</use>
</internal-format>
</texture-unit>
<texture-unit>
<unit>1</unit>
<image><use>texture[1]/image</use></image>
<filter><use>texture[1]/filter</use></filter>
<wrap-s><use>texture[1]/wrap-s</use></wrap-s>
<wrap-t><use>texture[1]/wrap-t</use></wrap-t>
<internal-format>
<use>texture[1]/internal-format</use>
</internal-format>
</texture-unit>
<texture-unit>
<unit>2</unit>
<image><use>texture[2]/image</use></image>
@ -124,11 +107,6 @@
<value type="int">0</value>
</uniform>
<uniform>
<name>water_refraction</name>
<type>sampler-2d</type>
<value type="int">1</value>
</uniform>
<uniform>
<name>water_normalmap</name>
<type>sampler-2d</type>
<value type="int">2</value>

View file

@ -119,32 +119,32 @@
<halign>left</halign>
<label>-180</label>
</text>
<slider>
<width>75</width>
<height>25</height>
<min>-180</min>
<max>180</max>
<property>/ai/models/wingman/controls/break-deg-rel</property>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>nasal</command>
<script>
var v = getprop("/ai/models/wingman/controls/break-deg-rel");
foreach (var c; props.globals.getNode("/ai/models").getChildren("wingman")){
print("FFF ", v, " ", c.getNode("name").getValue());
c.getNode("controls/break-deg-rel",1).setDoubleValue(v);
}
</script>
</binding>
</slider>
<slider>
<width>75</width>
<height>25</height>
<min>-180</min>
<max>180</max>
<property>/ai/models/wingman/controls/break-deg-rel</property>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>nasal</command>
<script>
var v = getprop("/ai/models/wingman/controls/break-deg-rel");
foreach (var c; props.globals.getNode("/ai/models").getChildren("wingman")){
print("FFF ", v, " ", c.getNode("name").getValue());
c.getNode("controls/break-deg-rel",1).setDoubleValue(v);
}
</script>
</binding>
</slider>
<text>
<halign>left</halign>
<label>180</label>
<label>180</label>
</text>
</text>
</group>
<text>
@ -156,15 +156,8 @@
</group>
</group>
<group>
<layout>hbox</layout>
@ -182,6 +175,26 @@
</text>
</group>
<group>
<layout>hbox</layout>
<text>
<halign>left</halign>
<label>Set Formation</label>
</text>
<button>
<x>40</x>
<y>10</y>
<legend>Open/Close</legend>
<binding>
<command>nasal</command>
<script>formation.formation_dialog.toggle()</script>
</binding>
</button>
</group>
<empty>
<stretch>true</stretch>
</empty>

View file

@ -0,0 +1,90 @@
<?xml version="1.0"?>
<PropertyList>
<name>model-cockpit-view</name>
<x>5</x>
<y>3</y>
<layout>hbox</layout>
<default-padding>0</default-padding>
<color>
<enabled>false</enabled>
<red>0</red>
<green>0</green>
<blue>0</blue>
<alpha>0</alpha>
</color>
<button>
<legend>&lt;</legend>
<pref-width>20</pref-width>
<pref-height>20</pref-height>
<color>
<red>0.5</red>
<green>0.5</green>
<blue>0.5</blue>
<alpha>0.3</alpha>
</color>
<binding>
<command>nasal</command>
<script>model_cockpit_view.model_cockpit_view_handler.next(-1)</script>
</binding>
</button>
<button>
<legend>&gt;</legend>
<pref-width>20</pref-width>
<pref-height>20</pref-height>
<color>
<red>0.5</red>
<green>0.5</green>
<blue>0.5</blue>
<alpha>0.3</alpha>
</color>
<binding>
<command>nasal</command>
<script>model_cockpit_view.model_cockpit_view_handler.next(1)</script>
</binding>
</button>
<whatever>
<pref-width>6</pref-width>
</whatever>
<text>
<pref-width>0</pref-width>
<live>1</live>
<property>/sim/current-view/model-cockpit-view</property>
<color>
<red>1</red>
<green>1</green>
<blue>1</blue>
<alpha>1</alpha>
</color>
<font>
<name>HELVETICA_14</name>
</font>
</text>
<button>
<legend/>
<pref-width>200</pref-width>
<border>0</border>
<color>
<red>1</red>
<green>1</green>
<blue>1</blue>
<alpha>0</alpha>
</color>
<binding>
<command>nasal</command>
<script>
if (size(lsoview.model_cockpit_view_handler.list) &lt;= 1)
return;
var isopen = !!getprop("sim/gui/dialogs/model-cockpit-view/open");
var toggle = isopen ? "dialog-close" : "dialog-show";
fgcommand(toggle, props.Node.new({ "dialog-name": "model-cockpit-view" }));
</script>
</binding>
</button>
</PropertyList>