|
From: <fli...@li...> - 2025-05-04 23:43:17
|
Revision: 12053
http://sourceforge.net/p/flightgear/fgaddon/12053
Author: helijah
Date: 2025-05-04 23:42:59 +0000 (Sun, 04 May 2025)
Log Message:
-----------
RAF S.E.5 : FDM overhaul. Improved multiplayer rendering. Added AI version. Bombable V5.0 compatibility.
Added Paths:
-----------
branches/release-2024.1/Aircraft/RAF-S-E-5/AI/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/Bump/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/Glass/glassrain.eff
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/Weapons/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/cranking/ALS/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/cranking/Classic/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/cranking/HDR/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/ground/ALS/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/ground/Classic/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/ground/HDR/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/ground/all-ground.xml
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Gun/all-guns.xml
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Interior/Panel/all-panels.xml
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Liveries/2048x2048/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Pilot/all-pilots.xml
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/RAF-S-E-5-bombableinclude.xml
branches/release-2024.1/Aircraft/RAF-S-E-5/Nasal/Electrical.nas
branches/release-2024.1/Aircraft/RAF-S-E-5/Nasal/convert.nas
branches/release-2024.1/Aircraft/RAF-S-E-5/Nasal/hdr.nas
branches/release-2024.1/Aircraft/RAF-S-E-5/Previews/
branches/release-2024.1/Aircraft/RAF-S-E-5/Systems/engines.xml
branches/release-2024.1/Aircraft/RAF-S-E-5/Systems/glass-rain.xml
branches/release-2024.1/Aircraft/RAF-S-E-5/Systems/initialisation.xml
branches/release-2024.1/Aircraft/RAF-S-E-5/Systems/instrumentation.xml
branches/release-2024.1/Aircraft/RAF-S-E-5/Systems/rules.xml
Removed Paths:
-------------
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/cranking/smoke.png
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/ground/smoke.png
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/guns/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Liveries/1024x1024/
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/prop.png
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/shadow.ac
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/shadow.png
branches/release-2024.1/Aircraft/RAF-S-E-5/Models/shadow.xml
branches/release-2024.1/Aircraft/RAF-S-E-5/Nasal/doors.nas
branches/release-2024.1/Aircraft/RAF-S-E-5/Nasal/weapons.nas
Added: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/Glass/glassrain.eff
===================================================================
--- branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/Glass/glassrain.eff (rev 0)
+++ branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/Glass/glassrain.eff 2025-05-04 23:42:59 UTC (rev 12053)
@@ -0,0 +1,529 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<PropertyList>
+
+ <name>glassrain</name>
+ <inherits-from>Effects/model-default</inherits-from>
+
+ <parameters>
+ <texture n="1">
+ <image>Aircraft/Generic/Effects/window_frost.png</image>
+ <type>2d</type>
+ <filter>linear-mipmap-linear</filter>
+ <wrap-s>repeat</wrap-s>
+ <wrap-t>repeat</wrap-t>
+ <internal-format>normalized</internal-format>
+ </texture>
+
+ <!-- placeholder for the function texture used for fogging, wiper area,...-->
+ <texture n="2">
+ <type>white</type>
+ </texture>
+
+ <!-- texture for reflections in the glass -->
+ <texture n="3">
+ <type>cubemap</type>
+ <images>
+ <positive-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_px.png</positive-x>
+ <negative-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nx.png</negative-x>
+ <positive-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_py.png</positive-y>
+ <negative-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_ny.png</negative-y>
+ <positive-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_pz.png</positive-z>
+ <negative-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nz.png</negative-z>
+ </images>
+ </texture>
+
+ <!-- placeholder lightmap texture for reflections in the glass -->
+ <texture n="4">
+ <type>cubemap</type>
+ <images>
+ <positive-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_px.png</positive-x>
+ <negative-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nx.png</negative-x>
+ <positive-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_py.png</positive-y>
+ <negative-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_ny.png</negative-y>
+ <positive-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_pz.png</positive-z>
+ <negative-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nz.png</negative-z>
+ </images>
+ </texture>
+
+ <glass-tint type="vec4d" n="0"> 1.0 1.0 1.0 1.0</glass-tint>
+ <overlay-color type="vec3d" n="0"> 1.0 1.0 1.0</overlay-color>
+ <splash-x><use>/environment/aircraft-effects/splash-vector-x</use></splash-x>
+ <splash-y><use>/environment/aircraft-effects/splash-vector-y</use></splash-y>
+ <splash-z><use>/environment/aircraft-effects/splash-vector-z</use></splash-z>
+ <rnorm><use>/environment/rain-norm</use></rnorm>
+ <gsnorm><use>/environment/aircraft-effects/ground-splash-norm</use></gsnorm>
+ <frost-level><use>/environment/aircraft-effects/frost-level</use></frost-level>
+ <surface-mapping-scheme type="int">0</surface-mapping-scheme>
+ <fog-level><use>/environment/aircraft-effects/fog-level</use></fog-level>
+ <use-wipers><use>/environment/aircraft-effects/use-wipers</use></use-wipers>
+ <use-overlay><use>/environment/aircraft-effects/use-overlay</use></use-overlay>
+ <overlay-alpha><use>/environment/aircraft-effects/overlay-alpha</use></overlay-alpha>
+ <overlay-glare type="float">0.5</overlay-glare>
+ <use-reflection type="int">0</use-reflection>
+ <reflection-strength type="float">1.0</reflection-strength>
+ <use-mask type="int">0</use-mask>
+ <use-reflection-lightmap type="int">0</use-reflection-lightmap>
+ <lightmap-multi type="int">0</lightmap-multi>
+ <lightmap-factor type="float" n="0">1.0</lightmap-factor>
+ <lightmap-color type="vec3d" n="0"> 1.0 1.0 1.0 </lightmap-color>
+ <lightmap-factor type="float" n="1">1.0</lightmap-factor>
+ <lightmap-color type="vec3d" n="1"> 1.0 1.0 1.0 </lightmap-color>
+ <lightmap-factor type="float" n="2">1.0</lightmap-factor>
+ <lightmap-color type="vec3d" n="2"> 1.0 1.0 1.0 </lightmap-color>
+ <lightmap-factor type="float" n="3">1.0</lightmap-factor>
+ <lightmap-color type="vec3d" n="3"> 1.0 1.0 1.0 </lightmap-color>
+ </parameters>
+
+ <technique n="4">
+ <predicate>
+ <and>
+ <property>/sim/rendering/shaders/skydome</property>
+ <or>
+ <less-equal>
+ <value type="float">2.0</value>
+ <glversion/>
+ </less-equal>
+ <and>
+ <extension-supported>GL_ARB_shader_objects</extension-supported>
+ <extension-supported>GL_ARB_shading_language_100</extension-supported>
+ <extension-supported>GL_ARB_vertex_shader</extension-supported>
+ <extension-supported>GL_ARB_fragment_shader</extension-supported>
+ </and>
+ </or>
+ </and>
+ </predicate>
+
+ <pass>
+ <lighting>true</lighting>
+ <depth>
+ <write-mask type="bool">false</write-mask>
+ </depth>
+ <material>
+ <active><use>material/active</use></active>
+ <ambient><use>material/ambient</use></ambient>
+ <diffuse><use>material/diffuse</use></diffuse>
+ <specular><use>material/specular</use></specular>
+ <emissive><use>material/emissive</use></emissive>
+ <shininess><use>material/shininess</use></shininess>
+ <color-mode><use>material/color-mode</use></color-mode>
+ </material>
+ <blend>
+ <active><use>blend/active</use></active>
+ <source><use>blend/source</use></source>
+ <destination><use>blend/destination</use></destination>
+ </blend>
+ <shade-model><use>shade-model</use></shade-model>
+ <cull-face><use>cull-face</use></cull-face>
+ <rendering-hint><use>rendering-hint</use></rendering-hint>
+ <render-bin>
+ <bin-number>111</bin-number>
+ <bin-name>DepthSortedBin</bin-name>
+ </render-bin>
+ <texture-unit>
+ <!-- The texture unit is always active because the shaders expect
+ that. -->
+ <unit>0</unit>
+ <type><use>texture[0]/type</use></type>
+ <image><use>texture[0]/image</use></image>
+ <filter><use>texture[0]/filter</use></filter>
+ <wrap-s><use>texture[0]/wrap-s</use></wrap-s>
+ <wrap-t><use>texture[0]/wrap-t</use></wrap-t>
+ <internal-format> <use>texture[0]/internal-format</use> </internal-format>
+ </texture-unit>
+ <texture-unit>
+ <unit>1</unit>
+ <type><use>texture[1]/type</use></type>
+ <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>
+ <type><use>texture[2]/type</use></type>
+ <image><use>texture[2]/image</use></image>
+ <filter><use>texture[2]/filter</use></filter>
+ <wrap-s><use>texture[2]/wrap-s</use></wrap-s>
+ <wrap-t><use>texture[2]/wrap-t</use></wrap-t>
+ <internal-format><use>texture[2]/internal-format</use></internal-format>
+ </texture-unit>
+ <texture-unit>
+ <unit>3</unit>
+ <type><use>texture[3]/type</use></type>
+ <images><use>texture[3]/images</use></images>
+ </texture-unit>
+ <texture-unit>
+ <unit>4</unit>
+ <type><use>texture[4]/type</use></type>
+ <images><use>texture[4]/images</use></images>
+ </texture-unit>
+ <vertex-program-two-side>
+ <use>vertex-program-two-side</use>
+ </vertex-program-two-side>
+ <program>
+ <vertex-shader>Shaders/glass-ALS.vert</vertex-shader>
+ <fragment-shader>Shaders/glass-ALS.frag</fragment-shader>
+ <fragment-shader>Shaders/noise.frag</fragment-shader>
+ <fragment-shader>Shaders/filters-ALS.frag</fragment-shader>
+ </program>
+
+ <uniform>
+ <name>tint</name>
+ <type>float-vec4</type>
+ <value><use>glass-tint</use></value>
+ </uniform>
+ <uniform>
+ <name>overlay_color</name>
+ <type>float-vec3</type>
+ <value><use>overlay-color</use></value>
+ </uniform>
+ <uniform>
+ <name>lightmap_r_factor</name>
+ <type>float</type>
+ <value><use>lightmap-factor[0]</use></value>
+ </uniform>
+ <uniform>
+ <name>lightmap_r_color</name>
+ <type>float-vec3</type>
+ <value><use>lightmap-color[0]</use></value>
+ </uniform>
+ <uniform>
+ <name>lightmap_g_factor</name>
+ <type>float</type>
+ <value><use>lightmap-factor[1]</use></value>
+ </uniform>
+ <uniform>
+ <name>lightmap_g_color</name>
+ <type>float-vec3</type>
+ <value><use>lightmap-color[1]</use></value>
+ </uniform>
+ <uniform>
+ <name>lightmap_b_factor</name>
+ <type>float</type>
+ <value><use>lightmap-factor[2]</use></value>
+ </uniform>
+ <uniform>
+ <name>lightmap_b_color</name>
+ <type>float-vec3</type>
+ <value><use>lightmap-color[2]</use></value>
+ </uniform>
+ <uniform>
+ <name>lightmap_a_factor</name>
+ <type>float</type>
+ <value><use>lightmap-factor[3]</use></value>
+ </uniform>
+ <uniform>
+ <name>lightmap_a_color</name>
+ <type>float-vec3</type>
+ <value><use>lightmap-color[3]</use></value>
+ </uniform>
+ <uniform>
+ <name>splash_x</name>
+ <type>float</type>
+ <value><use>splash-x</use></value>
+ </uniform>
+ <uniform>
+ <name>splash_y</name>
+ <type>float</type>
+ <value><use>splash-y</use></value>
+ </uniform>
+ <uniform>
+ <name>splash_z</name>
+ <type>float</type>
+ <value><use>splash-z</use></value>
+ </uniform>
+ <uniform>
+ <name>rain_norm</name>
+ <type>float</type>
+ <value><use>rnorm</use></value>
+ </uniform>
+ <uniform>
+ <name>ground_splash_norm</name>
+ <type>float</type>
+ <value><use>gsnorm</use></value>
+ </uniform>
+ <uniform>
+ <name>frost_level</name>
+ <type>float</type>
+ <value><use>frost-level</use></value>
+ </uniform>
+ <uniform>
+ <name>fog_level</name>
+ <type>float</type>
+ <value><use>fog-level</use></value>
+ </uniform>
+ <uniform>
+ <name>scattering</name>
+ <type>float</type>
+ <value><use>scattering</use></value>
+ </uniform>
+ <uniform>
+ <name>terminator</name>
+ <type>float</type>
+ <value><use>terminator</use></value>
+ </uniform>
+ <uniform>
+ <name>ground_scattering</name>
+ <type>float</type>
+ <value><use>ground_scattering</use></value>
+ </uniform>
+ <uniform>
+ <name>terminator</name>
+ <type>float</type>
+ <value><use>terminator</use></value>
+ </uniform>
+ <uniform>
+ <name>overcast</name>
+ <type>float</type>
+ <value><use>overcast</use></value>
+ </uniform>
+ <uniform>
+ <name>hazeLayerAltitude</name>
+ <type>float</type>
+ <value><use>lthickness</use></value>
+ </uniform>
+ <uniform>
+ <name>eye_alt</name>
+ <type>float</type>
+ <value><use>eye_alt</use></value>
+ </uniform>
+ <uniform>
+ <name>cloud_self_shading</name>
+ <type>float</type>
+ <value><use>cloud_self_shading</use></value>
+ </uniform>
+ <uniform>
+ <name>moonlight</name>
+ <type>float</type>
+ <value><use>moonlight</use></value>
+ </uniform>
+ <uniform>
+ <name>air_pollution</name>
+ <type>float</type>
+ <value><use>air_pollution</use></value>
+ </uniform>
+ <uniform>
+ <name>reflection_strength</name>
+ <type>float</type>
+ <value><use>reflection-strength</use></value>
+ </uniform>
+ <uniform>
+ <name>overlay_alpha</name>
+ <type>float</type>
+ <value><use>overlay-alpha</use></value>
+ </uniform>
+ <uniform>
+ <name>overlay_glare</name>
+ <type>float</type>
+ <value><use>overlay-glare</use></value>
+ </uniform>
+ <!-- filtering -->
+ <uniform>
+ <name>gamma</name>
+ <type>float</type>
+ <value><use>gamma</use></value>
+ </uniform>
+ <uniform>
+ <name>brightness</name>
+ <type>float</type>
+ <value><use>brightness</use></value>
+ </uniform>
+ <uniform>
+ <name>use_filtering</name>
+ <type>bool</type>
+ <value><use>use_filtering</use></value>
+ </uniform>
+ <uniform>
+ <name>use_night_vision</name>
+ <type>bool</type>
+ <value><use>use_night_vision</use></value>
+ </uniform>
+ <uniform>
+ <name>use_IR_vision</name>
+ <type>bool</type>
+ <value><use>use_IR_vision</use></value>
+ </uniform>
+ <uniform>
+ <name>delta_T</name>
+ <type>float</type>
+ <value><use>delta_T</use></value>
+ </uniform>
+ <uniform>
+ <name>fact_grey</name>
+ <type>float</type>
+ <value><use>fact_grey</use></value>
+ </uniform>
+ <uniform>
+ <name>fact_black</name>
+ <type>float</type>
+ <value><use>fact_black</use></value>
+ </uniform>
+ <uniform>
+ <name>display_xsize</name>
+ <type>int</type>
+ <value><use>display_xsize</use></value>
+ </uniform>
+ <uniform>
+ <name>display_ysize</name>
+ <type>int</type>
+ <value><use>display_ysize</use></value>
+ </uniform>
+
+ <uniform>
+ <name>texture</name>
+ <type>sampler-2d</type>
+ <value type="int">0</value>
+ </uniform>
+ <uniform>
+ <name>frost_texture</name>
+ <type>sampler-2d</type>
+ <value type="int">1</value>
+ </uniform>
+ <uniform>
+ <name>func_texture</name>
+ <type>sampler-2d</type>
+ <value type="int">2</value>
+ </uniform>
+ <uniform>
+ <name>cube_texture</name>
+ <type>sampler-cube</type>
+ <value type="int">3</value>
+ </uniform>
+ <uniform>
+ <name>cube_light_texture</name>
+ <type>sampler-cube</type>
+ <value type="int">4</value>
+ </uniform>
+ <uniform>
+ <name>use_reflection</name>
+ <type>int</type>
+ <value><use>use-reflection</use></value>
+ </uniform>
+ <uniform>
+ <name>use_mask</name>
+ <type>int</type>
+ <value><use>use-mask</use></value>
+ </uniform>
+ <uniform>
+ <name>use_wipers</name>
+ <type>int</type>
+ <value><use>use-wipers</use></value>
+ </uniform>
+ <uniform>
+ <name>use_overlay</name>
+ <type>int</type>
+ <value><use>use-overlay</use></value>
+ </uniform>
+ <uniform>
+ <name>use_reflection_lightmap</name>
+ <type>int</type>
+ <value><use>use-reflection-lightmap</use></value>
+ </uniform>
+ <uniform>
+ <name>lightmap_multi</name>
+ <type>int</type>
+ <value><use>lightmap-multi</use></value>
+ </uniform>
+ <uniform>
+ <name>adaptive_mapping</name>
+ <type>int</type>
+ <value><use>surface-mapping-scheme</use></value>
+ </uniform>
+ <uniform>
+ <name>colorMode</name>
+ <type>int</type>
+ <value><use>material/color-mode-uniform</use></value>
+ </uniform>
+ </pass>
+
+ </technique>
+
+ <!-- fall back to a fixed pipeline technique equivalent to model-transparent otherwise -->
+ <!-- Rembrandt technique of model-default comes at 10, so we insert before that -->
+ <technique n="9">
+ <pass>
+ <lighting>true</lighting>
+
+ <depth>
+ <write-mask type="bool">false</write-mask>
+ </depth>
+
+ <material>
+ <active>
+ <use>material/active</use>
+ </active>
+ <ambient>
+ <use>material/ambient</use>
+ </ambient>
+ <diffuse>
+ <use>material/diffuse</use>
+ </diffuse>
+ <specular>
+ <use>material/specular</use>
+ </specular>
+ <emissive>
+ <use>material/emissive</use>
+ </emissive>
+ <shininess>
+ <use>material/shininess</use>
+ </shininess>
+ <color-mode>
+ <use>material/color-mode</use>
+ </color-mode>
+ </material>
+
+ <blend>
+ <active>
+ <use>blend/active</use>
+ </active>
+ <source>
+ <use>blend/source</use>
+ </source>
+ <destination>
+ <use>blend/destination</use>
+ </destination>
+ </blend>
+
+ <shade-model>
+ <use>shade-model</use>
+ </shade-model>
+
+ <cull-face>
+ <use>cull-face</use>
+ </cull-face>
+
+ <render-bin>
+ <bin-number>111</bin-number>
+ <bin-name>DepthSortedBin</bin-name>
+ </render-bin>
+
+ <texture-unit>
+ <unit>0</unit>
+ <active>
+ <use>texture[0]/active</use>
+ </active>
+ <type>
+ <use>texture[0]/type</use>
+ </type>
+ <image>
+ <use>texture[0]/image</use>
+ </image>
+ <filter>
+ <use>texture[0]/filter</use>
+ </filter>
+ <wrap-s>
+ <use>texture[0]/wrap-s</use>
+ </wrap-s>
+ <wrap-t>
+ <use>texture[0]/wrap-t</use>
+ </wrap-t>
+ <environment>
+ <mode>modulate</mode>
+ </environment>
+ </texture-unit>
+ </pass>
+ </technique>
+
+</PropertyList>
Deleted: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/cranking/smoke.png
===================================================================
(Binary files differ)
Added: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/ground/all-ground.xml
===================================================================
--- branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/ground/all-ground.xml (rev 0)
+++ branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/ground/all-ground.xml 2025-05-04 23:42:59 UTC (rev 12053)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<PropertyList>
+
+ <!-- Left wheel -->
+ <model>
+ <path>ground0.xml</path>
+ <offsets>
+ <x-m> -1.827 </x-m>
+ <y-m> -0.679 </y-m>
+ <z-m> -1.450 </z-m>
+ </offsets>
+ </model>
+
+ <!-- Right wheel -->
+ <model>
+ <path>ground1.xml</path>
+ <offsets>
+ <x-m> -1.827 </x-m>
+ <y-m> 0.679 </y-m>
+ <z-m> -1.450 </z-m>
+ </offsets>
+ </model>
+
+ <!-- Rear -->
+ <model>
+ <path>ground2.xml</path>
+ <offsets>
+ <x-m> 2.903 </x-m>
+ <y-m> 0.000 </y-m>
+ <z-m> -0.454 </z-m>
+ </offsets>
+ </model>
+
+</PropertyList>
Deleted: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Effects/ground/smoke.png
===================================================================
(Binary files differ)
Added: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Gun/all-guns.xml
===================================================================
--- branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Gun/all-guns.xml (rev 0)
+++ branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Gun/all-guns.xml 2025-05-04 23:42:59 UTC (rev 12053)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<PropertyList>
+
+ <model>
+ <path>gun.xml</path>
+ <offsets>
+ <x-m> -1.08000 </x-m>
+ <y-m> 0.00000 </y-m>
+ <z-m> 1.38455 </z-m>
+ </offsets>
+ </model>
+
+</PropertyList>
Added: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Interior/Panel/all-panels.xml
===================================================================
--- branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Interior/Panel/all-panels.xml (rev 0)
+++ branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Interior/Panel/all-panels.xml 2025-05-04 23:42:59 UTC (rev 12053)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<PropertyList>
+
+ <model>
+ <path>panel.xml</path>
+ <offsets>
+ <x-m> -0.412 </x-m>
+ <y-m> 0.000 </y-m>
+ <z-m> 0.558 </z-m>
+ </offsets>
+ </model>
+
+</PropertyList>
Added: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Pilot/all-pilots.xml
===================================================================
--- branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Pilot/all-pilots.xml (rev 0)
+++ branches/release-2024.1/Aircraft/RAF-S-E-5/Models/Pilot/all-pilots.xml 2025-05-04 23:42:59 UTC (rev 12053)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<PropertyList>
+
+ <model>
+ <name>ThePilot</name>
+ <path>pilot.xml</path>
+ <offsets>
+ <x-m> -0.269 </x-m>
+ <y-m> 0.016 </y-m>
+ <z-m> -0.106 </z-m>
+ </offsets>
+ </model>
+
+ <animation>
+ <type>select</type>
+ <object-name>ThePilot</object-name>
+ <condition>
+ <not-equals>
+ <property>sim/current-view/name</property>
+ <value>Cockpit View</value>
+ </not-equals>
+ </condition>
+ </animation>
+
+</PropertyList>
Added: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/RAF-S-E-5-bombableinclude.xml
===================================================================
--- branches/release-2024.1/Aircraft/RAF-S-E-5/Models/RAF-S-E-5-bombableinclude.xml (rev 0)
+++ branches/release-2024.1/Aircraft/RAF-S-E-5/Models/RAF-S-E-5-bombableinclude.xml 2025-05-04 23:42:59 UTC (rev 12053)
@@ -0,0 +1,406 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<PropertyList>
+
+ <!-- Nasal code -->
+ <nasal>
+
+ <load>
+ <![CDATA[
+ print("Loading RAF S.E.5 ", cmdarg().getPath());
+
+ var nodeName = cmdarg().getPath();
+
+ ##checks whether it has been initialized already; if so, just return
+ if ( bombable.check_overall_initialized (nodeName) ) {
+ return;
+ }
+
+ ############################################
+ # bombable INITIALIZER
+ var object_init = func() {
+ # Datas of this object are under: cmdarg().getPath()
+ var thisNodeName = cmdarg().getPath();
+ var thisNode = props.globals.getNode(thisNodeName);
+ # Add some useful nodes
+
+ ########################################################################
+ ########################################################################
+ # INITIALIZE BOMBABLE
+ #
+ # Initialize constants and main routines for maintaining altitude
+ # relative to ground-level, relocating after file/reset, and
+ # creating bombable/shootable objects.
+ #
+ # These routines are found in FG/nasal/bombable.nas
+ #
+ ########################################################################
+ # INITIALIZE BOMBABLE Object
+ # This object will be slurped in the object's node as a child
+ # node named "bombable".
+ # All distances are specified in meters.
+ # All altitudes are relative to current ground level at the object's
+ # location
+ #
+
+ thisNodeName = cmdarg().getPath();
+
+ var bombableObject = {
+
+ objectNodeName : thisNodeName,
+ objectNode : props.globals.getNode(thisNodeName),
+
+ # time, in seconds, between the updates that
+ # keep the object at its AGL. Tradeoff is high-speed updates look more
+ # realistic but slow down the framerate/cause jerkiness. Faster-moving
+ # objects will need more frequent updates to look realistic.
+ # update time faster than about 1/3 seems to have a noticeable effect
+ # on frame rate
+ updateTime_s : 1/3,
+
+ #########################################
+ # ALTITUDE DEFINITIONS
+ #
+ altitudes : {
+ # altitude correction to add to your aircraft or ship that is needed to
+ # put wheels on ground (or, for a ship, make it float in the water at the
+ # correct level). For most objects this is 0 but some models need a small
+ # correction to place them exactly at ground level
+ wheelsOnGroundAGL_m : 1 ,
+
+ # minimum altitude above ground level this object is allowed to fly
+ minimumAGL_m : 33,
+
+ # maximum altitude AGL this object is allowed to fly, ie, operational ceiling
+ maximumAGL_m : 5000,
+
+ # altitude AGL when crashed. Ships will sink to this level, aircraft or
+ # vehicles will sink into the ground as landing gear collapses or tires
+ # deflate. Should be negative, even just -0.001.
+ crashedAGL_m : -0.85,
+ },
+ #
+ #########################################
+ # VELOCITIES DEFINITIONS
+ #
+ velocities : {
+ # max % to reduce speed, per step, when damaged
+ maxSpeedReduce_percent : 0.5,
+
+ # minimum speed to reduce to when damaged. Ground vehicles and ships might stop completely when damaged but aircraft will need a minimum speed so they keep moving until they hit the ground.
+ minSpeed_kt : 40,
+
+ # cruising speed, typical/optimal cruising speed, V C for aircraft
+ cruiseSpeed_kt : 100,
+
+ # typical/optimal speed when aggressively attacking or evading, in
+ # level flight for aircraft
+ attackSpeed_kt : 110,
+
+ # Maximum possible speed under dive or downhill conditions, V NE for aircraft
+ maxSpeed_kt : 121,
+
+ # max rate to sink or fly downwards when damaged, in meters/second
+ damagedAltitudeChangeMaxRate_meterspersecond : 30,
+
+ # The terminal velocities are calculated by opening the 'real' AC
+ # in FG, level flight, full throttle, then putting
+ # the AC at different angles of attack with the autopilot,
+ # and noting the terminal airspeed & vertical speed velocities.
+ # For best results, do it near sea level, under 5000 feet altitude.
+ # One or two each of climb & dive velocities are probably sufficient.
+ # However if you do more we may be able to use the more precise
+ # data in the future.
+ #
+ # Note that these are intended to be true airspeed whereas FG's
+ # /velocities/airspeed-kt reports indicated airspeed, so some
+ # conversion or reference to groundspeed-kt is needed.
+ #
+ # In FG /velocities/groundspeed-kt is equal (or close
+ # to equal, except for wind . . .) true airspeed when pitch=0
+ # but as pitch increases or decreases that will change.
+ #
+ #Source: FG Spad VII, flown at different pitch levels
+ diveTerminalVelocities: {
+ point1: { airspeed_kt : 122.3, vertical_speed_fps : - 9.8},
+ point2: { airspeed_kt : 130, vertical_speed_fps : - 20.1},
+ point3: { airspeed_kt : 136.5, vertical_speed_fps : - 33.4},
+ point4: { airspeed_kt : 142.6, vertical_speed_fps : - 47.2},
+ point4: { airspeed_kt : 154.2, vertical_speed_fps : - 77.2},
+ point4: { airspeed_kt : 166.1, vertical_speed_fps : - 110.3},
+ point4: { airspeed_kt : 175.8, vertical_speed_fps : - 144.4},
+ point4: { airspeed_kt : 187.4, vertical_speed_fps : - 200.3},
+ point4: { airspeed_kt : 223.4, vertical_speed_fps : - 388},
+ },
+
+ climbTerminalVelocities: {
+ point1: { airspeed_kt : 105.4, vertical_speed_fps : 7.77},
+ point2: { airspeed_kt : 93.7, vertical_speed_fps : 13.4},
+ point3: { airspeed_kt : 82.9, vertical_speed_fps : 17.8},
+ point4: { airspeed_kt : 72.8, vertical_speed_fps : 19.5},
+ point5: { airspeed_kt : 63, vertical_speed_fps : 17.4},
+ },
+ },
+ #
+ #########################################
+ # EVASION DEFINITIONS
+ #
+ # The evasion system makes the AI aircraft dodge when they come under
+ # fire.
+ evasions : {
+ # max time to delay/wait between dodges
+ dodgeDelayMax_sec : 15,
+
+ # minimum time to delay/wait between dodges
+ dodgeDelayMin_sec : 2,
+
+ # Max amount to turn when dodging
+ # 90 degrees = instant turn, unrealistic
+ # up to 80 is usually OK, somewhere in 80-85 starts to be unrealistically fast
+ # >85 is usually very unrealistic. You must test this in your scenario, however.
+ dodgeMax_deg : 75,
+
+ # minimum amount to turn when dodging
+ dodgeMin_deg : 70,
+
+ #you can figure this out by rolling the corresponding FG aircraft and
+ # timing a 180 or 360 deg roll
+ rollRateMax_degpersec : 49,
+
+ # Preference for right turns vs. left when dodging. 90% means 90% right turns, 50% means 50% right turns.
+ dodgeROverLPreference_percent : 80,
+
+ # Aircraft will begin to move up or down
+ dodgeAltMin_m : -150,
+
+ # Max & Min are relative to current alt
+ dodgeAltMax_m : 75,
+
+ # Max speed to climb when evading
+ dodgeVertSpeedClimb_mps : 12,
+
+ # Max speed to dive when evading
+ dodgeVertSpeedDive_mps : 75,
+ },
+ #
+ #########################################
+ # ATTACK DEFINITIONS
+ #
+ # The attack system makes the AI aircraft turn and fly towards
+ # other aircraft
+ attacks : {
+
+ # max distance to turn & attack main aircraft
+ maxDistance_m : 4200,
+
+ # min distance to turn & attack main aircraft, ie, fly away this far before
+ # turning to attack again
+ minDistance_m : 120,
+
+ # when within minDistance_m, the aircraft will continue to turn towards the
+ # main aircraft and attack *if* if the angle is less than this amount from dead ahead
+ continueAttackAngle_deg : 75,
+
+ # will attack the main aircraft unless this amount higher than it or more
+ altitudeHigherCutoff_m : 5200,
+
+ # will attack the main aircraft unless this amount lower than it or more
+ altitudeLowerCutoff_m : 650,
+
+ # How powerful the aircraft is when climbing during an attack; 4000 would
+ # be typical for, say a Zero--scale accordingly for others; higher is stronger
+ climbPower : 1550,
+
+ # How powerful the aircraft is when diving during and attack; 6000 typical of
+ # a Zero--could be much more than climbPower if the aircraft is a weak climber but
+ # a strong diver
+ divePower : 4400,
+
+ # when turning on attack, roll to this angle min
+ rollMin_deg : 69,
+
+ # when turning on attack, roll to this angle max
+ # 90 degrees = instant turn, unrealistic
+ # up to 80 might be OK, depending on aircraft & speed; somewhere in 80-85 starts
+ # to be unrealistically fast >85 is usually very unrealistic.
+ # You must test this in your scenario, however.
+ rollMax_deg : 75,
+
+ # you can figure this out by rolling the corresponding FG aircraft and timing a 180
+ # or 360 deg roll
+ rollRateMax_degpersec : 49,
+
+ # check for need to attack/correct course this often
+ attackCheckTime_sec : 10,
+
+ # once engaged with enemy, check/update course this frequently
+ attackCheckTimeEngaged_sec : 1.1,
+ },
+ #
+ #########################################
+ # WEAPONS DEFINITIONS
+ #
+ # The weapons system makes the AI aircraft fire on the main aircraft
+ # You can define any number of weapons--just enclose each in curly brackets
+ # and separate with commas (,).
+ weapons : {
+
+ # internal name - this can be any name you want; must be a valid nasal variable name
+ cannon : {
+
+ # name presented to users, ie in on-screen messages
+ name : "7.7mm Vickers Machine Gun",
+
+ # maximum percentage damage one hit from the aircraft's main weapon/machine
+ # guns will do to an opponent
+ maxDamage_percent : 5.5,
+
+ # maximum distance at which the aircrafts main weapon/maching guns will be
+ # able to damage an opponent
+ maxDamageDistance_m : 550,
+
+ # direction the aircraft's main weapon is aimed.
+ # 0,0 = straight ahead, 90,0=directly right, 0,90=directly up, 0,180=directly back, etc.
+ weaponAngle_deg : { heading: 0, elevation: 0 },
+
+ # Offset of the weapon from the main aircraft center
+ weaponOffset_m : {x:2, y:0, z:0},
+
+ # Visual size of the weapon's projectile, in meters, at start & end of its path
+ weaponSize_m : {start:.15, end:.15},
+ },
+ },
+ #
+ #########################################
+ # DIMENSION DEFINITIONS
+ #
+ # All dimensions are in meters
+ #
+ #
+ dimensions : {
+
+ # width of your object, ie, for aircraft, wingspan
+ width_m : 8.11,
+
+ # length of your object, ie, for aircraft, distance nose to tail
+ length_m : 6.38,
+
+ # height of your object, ie, for aircraft ground to highest point when sitting on runway
+ height_m : 2.89,
+
+ # typically 1/2 the longest dimension of the object. Hits within this distance of the
+ # center of object have some possibility of damage
+ damageRadius_m : 3.19,
+
+ # typically the radius of the fuselage or cockpit or other most
+ # vital area at the center of the object. Always smaller than damageRadius_m
+ vitalDamageRadius_m : 1.5,
+
+ # It's a crash if the main aircraft hits in this area.
+ crashRadius_m : 6,
+ },
+ #
+ #########################################
+ # VULNERABILITIES DEFINITIONS
+ #
+ vulnerabilities : {
+
+ #Vulnerability to damage from armament, 1=normal M1 tank; higher to make objects
+ # easier to kill and lower to make them more difficult. This is a multiplier,
+ # so 5 means 5X easier to kill than an M1, 1/5 means 5X harder to kill.
+ damageVulnerability : 110,
+
+ # Chance that a small-caliber machine-gun round will damage the engine.
+ engineDamageVulnerability_percent : 3,
+
+ # Vulnerability to catching on fire. 100% means even the slightest impact will
+ # set it on fire; 20% means quite difficult to set on fire; 0% means set on
+ # fire only when completely damaged; -1% means never set on fire.
+ fireVulnerability_percent : 10,
+
+ # Amount of damage to add, per second, when on fire. 100%=completely damaged.
+ # Warthog is relatively damage-resistant.
+ fireDamageRate_percentpersecond : 0.2,
+
+ # Once a fire starts, for this many seconds there is a chance to put out the
+ # fire; fires lasting longer than this won't be put out until the object burns out.
+ fireExtinguishMaxTime_seconds : 100,
+
+ # Chance of the crew putting out the fire within the MaxTime above. Warthoge is
+ # relatively damage-resistant.
+ fireExtinguishSuccess_percentage : 100,
+
+ # mass of the object in KG, but give at least a 2-10X bonus to anything carrying
+ # flammables or high explosives.
+ explosiveMass_kg : 735,
+ },
+ #
+ #########################################
+ # LIVERY DEFINITIONS
+ #
+ # Path to livery files to use at different damage levels.
+ # Path is relative to the AI aircraft's directory.
+ # The object will start with the first livery listed and
+ # change to succeeding liveries as the damage
+ # level increases. The final livery should indicate full damage/
+ # object destroyed.
+ #
+ # If you don't want to specify any special liveries simply set
+ # damageLivery : nil and the object's normal livery will be used.
+ #
+ damageLiveries : {
+ damageLivery : [ ]
+ },
+ };
+ #########################################
+ # INITIALIZE ROUTINES
+ #
+ # OVERALL INITIALIZER: Needed to make all the others work
+ bombable.initialize ( bombableObject );
+
+ # LOCATION: Relocate object to maintain its position after file/reset
+ # (best not used for airplanes)
+ # bombable.location_init ( thisNodeName );
+ #
+ # GROUND: Keep object at altitude relative to ground level
+ bombable.ground_init ( thisNodeName );
+
+ # ATTACK: Make the object attack the main aircraft
+ bombable.attack_init ( thisNodeName );
+
+ # WEAPONS: Make the object shoot the main aircraft
+ bombable.weapons_init ( thisNodeName );
+ #
+ # BOMBABLE: Make the object bombable/damageable
+ bombable.bombable_init ( thisNodeName );
+
+ # SMOKE/CONTRAIL: Start a flare, contrail, smoke trail, or exhaust
+ # trail for the object.
+ # Smoke types available: flare, jetcontrail, pistonexhaust, smoketrail,
+ # damagedengine
+ bombable.startSmoke("jetcontrail", thisNodeName );
+ #
+ # END INITIALIZE BOMBABLE
+ ########################################################################
+ ########################################################################
+ }
+ object_init();
+ ]]>
+ </load>
+ <unload>
+ <![CDATA[
+ print("Unload RAF S.E.5");
+ var nodeName= cmdarg().getPath();
+ bombable.de_overall_initialize( nodeName );
+ bombable.initialize_del( nodeName );
+ bombable.ground_del( nodeName );
+ bombable.location_del (nodeName);
+ bombable.bombable_del( nodeName );
+ bombable.attack_del( nodeName );
+ bombable.weapons_del (nodeName);
+ # </unload>
+ ]]>
+ </unload>
+ </nasal>
+
+</PropertyList>
Deleted: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/prop.png
===================================================================
(Binary files differ)
Deleted: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/shadow.ac
===================================================================
--- branches/release-2024.1/Aircraft/RAF-S-E-5/Models/shadow.ac 2025-05-04 23:40:55 UTC (rev 12052)
+++ branches/release-2024.1/Aircraft/RAF-S-E-5/Models/shadow.ac 2025-05-04 23:42:59 UTC (rev 12053)
@@ -1,26 +0,0 @@
-AC3Db
-MATERIAL "DefaultWhite" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.5 0.5 0.5 shi 64 trans 0
-OBJECT world
-kids 1
-OBJECT poly
-name "shadow"
-loc 0 0 -0
-data 6
-shadow
-texture "shadow.png"
-texrep 1.000000 1.000000
-crease 180.000005
-numvert 4
-3.19 0 -4.054998
-3.19 0 4.055
--3.19 0 4.054999
--3.189999 0 -4.055
-numsurf 1
-SURF 0x00
-mat 0
-refs 4
-0 1 0.999999642372
-3 0.000000298957 1
-2 0 0.000000235185
-1 0.999999940395 0
-kids 0
Deleted: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/shadow.png
===================================================================
(Binary files differ)
Deleted: branches/release-2024.1/Aircraft/RAF-S-E-5/Models/shadow.xml
===================================================================
--- branches/release-2024.1/Aircraft/RAF-S-E-5/Models/shadow.xml 2025-05-04 23:40:55 UTC (rev 12052)
+++ branches/release-2024.1/Aircraft/RAF-S-E-5/Models/shadow.xml 2025-05-04 23:42:59 UTC (rev 12053)
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<PropertyList>
-
- <path>shadow.ac</path>
-
- <animation>
- <!-- opaques objects -->
-
- <!-- transparents objects -->
- <object-name>shadow</object-name>
- </animation>
-
- <animation>
- <type>noshadow</type>
- <object-name>shadow</object-name>
- </animation>
-
- <animation>
- <type>select</type>
- <object-name>shadow</object-name>
- <condition>
- <and>
- <not><property>sim/freeze/replay-state</property></not>
- <not><property>sim/rendering/shadows/enabled</property></not>
- <less-than>
- <property>sim/multiplay/generic/float[2]</property>
- <value>2000</value>
- </less-than>
- <and>
- <greater-than>
- <property>orientation/roll-deg</property>
- <value>-90</value>
- </greater-than>
- <less-than>
- <property>orientation/roll-deg</property>
- <value>90</value>
- </less-than>
- </and>
- </and>
- </condition>
- </animation>
-
- <!-- A shadow for OSG waiting better ;) based on DC3's shadow -->
- <!-- pitch -->
- <animation>
- <type>rotate</type>
- <object-name>shadow</object-name>
- <property>orientation/pitch-deg</property>
- <condition>
- <and>
- <greater-than>
- <property>orientation/roll-deg</property>
- <value>-90</value>
- </greater-than>
- <less-than>
- <property>orientation/roll-deg</property>
- <value>90</value>
- </less-than>
- </and>
- </condition>
- <factor> -1 </factor>
- <axis>
- <x> 0 </x>
- <y> 1 </y>
- <z> 0 </z>
- </axis>
- </animation>
-
- <!-- roll -->
- <animation>
- <type>rotate</type>
- <object-name>shadow</object-name>
- <property>orientation/roll-deg</property>
- <factor> 1 </factor>
- <axis>
- <x> 1 </x>
- <y> 0 </y>
- <z> 0 </z>
- </axis>
- </animation>
-
- <!-- translate to ground level -->
- <animation>
- <type>translate</type>
- <object-name>shadow</object-name>
- <property>sim/multiplay/generic/float[2]</property>
- <factor> -1 </factor>
- <offset-m>0</offset-m>
- <axis>
- <x> 0 </x>
- <y> 0 </y>
- <z> 1 </z>
- </axis>
- </animation>
-
-</PropertyList>
Added: branches/release-2024.1/Aircraft/RAF-S-E-5/Nasal/Electrical.nas
===================================================================
--- branches/release-2024.1/Aircraft/RAF-S-E-5/Nasal/Electrical.nas (rev 0)
+++ branches/release-2024.1/Aircraft/RAF-S-E-5/Nasal/Electrical.nas 2025-05-04 23:42:59 UTC (rev 12053)
@@ -0,0 +1,307 @@
+#### piston engine electrical system ####
+#### Syd Adams ####
+
+var ammeter_ave = 0.0;
+var outPut = "systems/electrical/outputs/";
+var BattVolts = props.globals.getNode("systems/electrical/batt-volts",1);
+var Volts = props.globals.getNode("/systems/electrical/volts",1);
+var Amps = props.globals.getNode("/systems/electrical/amps",1);
+var EXT = props.globals.getNode("/controls/electric/external-power",1);
+var switch_list=[];
+var output_list=[];
+var watt_list=[];
+
+#var battery = Battery.new(switch-prop,volts,amps,amp_hours,charge_percent,charge_amps);
+Battery = {
+ new : func(swtch,vlt,amp,hr,chp,cha) {
+ m = { parents : [Battery] };
+ m.switch = props.globals.getNode(swtch,1);
+ m.switch.setBoolValue(0);
+ m.ideal_volts = vlt;
+ m.ideal_amps = amp;
+ m.amp_hours = hr;
+ m.charge_percent = chp;
+ m.charge_amps = cha;
+ return m;
+ },
+ apply_load : func(load,dt) {
+ if (me.switch.getValue()) {
+ var amphrs_used = load * dt / 3600.0;
+ var percent_used = amphrs_used / me.amp_hours;
+ me.charge_percent -= percent_used;
+ if ( me.charge_percent < 0.0 ) {
+ me.charge_percent = 0.0;
+ } elsif ( me.charge_percent > 1.0 ) {
+ me.charge_percent = 1.0;
+ }
+ var output =me.amp_hours * me.charge_percent;
+ return output;
+ }else {
+ return 0;
+ }
+ },
+
+ get_output_volts : func {
+ if (me.switch.getValue()) {
+ var x = 1.0 - me.charge_percent;
+ var tmp = -(3.0 * x - 1.0);
+ var factor = (tmp*tmp*tmp*tmp*tmp + 32) / 32;
+ var output =me.ideal_volts * factor;
+ return output;
+ } else {
+ return 0;
+ }
+ },
+
+ get_output_amps : func {
+ if (me.switch.getValue()) {
+ var x = 1.0 - me.charge_percent;
+ var tmp = -(3.0 * x - 1.0);
+ var factor = (tmp*tmp*tmp*tmp*tmp + 32) / 32;
+ var output =me.ideal_amps * factor;
+ return output;
+ } else {
+ return 0;
+ }
+ }
+};
+
+# var alternator = Alternator.new(num,switch,rpm_source,rpm_threshold,volts,amps);
+Alternator = {
+ new : func (num,switch,src,thr,vlt,amp){
+ m = { parents : [Alternator] };
+ m.switch = props.globals.getNode(switch,1);
+ m.switch.setBoolValue(0);
+ m.meter = props.globals.getNode("systems/electrical/gen-load["~num~"]",1);
+ m.meter.setDoubleValue(0);
+ m.gen_output = props.globals.getNode("engines/engine["~num~"]/amp-v",1);
+ m.gen_output.setDoubleValue(0);
+ m.meter.setDoubleValue(0);
+ m.rpm_source = props.globals.getNode(src,1);
+ m.rpm_threshold = thr;
+ m.ideal_volts = vlt;
+ m.ideal_amps = amp;
+ return m;
+ },
+
+ apply_load : func(load) {
+ var cur_volt=me.gen_output.getValue();
+ var cur_amp=me.meter.getValue();
+ if (cur_volt >1) {
+ var factor=1/cur_volt;
+ gout = (load * factor);
+ if (gout>1) {
+ gout=1;
+ }
+ } else {
+ gout=0;
+ }
+ if (cur_amp > gout) {
+ me.meter.setValue(cur_amp - 0.01);
+ }
+ if (cur_amp < gout) {
+ me.meter.setValue(cur_amp + 0.01);
+ }
+ },
+
+ get_output_volts : func {
+ var out = 0;
+ if (me.switch.getBoolValue()) {
+ var factor = me.rpm_source.getValue() / me.rpm_threshold;
+ if ( factor > 1.0 ) {
+ factor = 1.0;
+ }
+ var out = (me.ideal_volts * factor);
+ }
+ me.gen_output.setValue(out);
+ return out;
+ },
+
+ get_output_amps : func {
+ var ampout =0;
+ if(me.switch.getBoolValue()) {
+ var factor = me.rpm_source.getValue() / me.rpm_threshold;
+ if ( factor > 1.0 ) {
+ factor = 1.0;
+ }
+ ampout = me.ideal_amps * factor;
+ }
+ return ampout;
+ }
+};
+
+var battery = Battery.new("/controls/electric/battery-switch",24,30,34,1.0,7.0);
+var alternator1 = Alternator.new(0,"controls/electric/engine[0]/generator","/engines/engine[0]/rpm",100.0,28.0,60.0);
+
+#####################################
+setlistener("/sim/signals/fdm-initialized", func {
+ BattVolts.setDoubleValue(0);
+ init_switches();
+ settimer(update_electrical,5);
+ print("Electrical System ... ok");
+});
+
+init_switches = func() {
+ var tprop=props.globals.getNode("controls/electric/ammeter-switch",1);
+ tprop.setBoolValue(1);
+ tprop=props.globals.getNode("controls/lighting/instrument-lights",1);
+ tprop.setBoolValue(0);
+
+ setprop("controls/lighting/instrument-lights-norm",0.8);
+ setprop("controls/lighting/instruments-norm",0.8);
+
+ append(switch_list,"controls/engines/engine/starter");
+ append(output_list,"starter");
+ append(watt_list,10.0);
+
+ append(switch_list,"controls/anti-ice/pitot-heat");
+ append(output_list,"pitot-heat");
+ append(watt_list,0.5);
+
+ append(switch_list,"controls/lighting/landing-lights");
+ append(output_list,"landing-lights");
+ append(watt_list,1.0);
+
+ append(switch_list,"controls/lighting/beacon-state/state");
+ append(output_list,"beacon");
+ append(watt_list,0.5);
+
+ append(switch_list,"controls/lighting/nav-lights");
+ append(output_list,"nav-lights");
+ append(watt_list,0.5);
+
+ append(switch_list,"controls/lighting/strobe-state/state");
+ append(output_list,"strobe");
+ append(watt_list,0.5);
+
+ append(switch_list,"controls/engines/engine/fuel-pump");
+ append(output_list,"fuel-pump");
+ append(watt_list,0.5);
+
+ append(switch_list,"controls/electric/avionics-switch");
+ append(output_list,"adf");
+ append(watt_list,0.2);
+
+ append(switch_list,"controls/electric/avionics-switch");
+ append(output_list,"dme");
+ append(watt_list,0.2);
+
+ append(switch_list,"controls/electric/avionics-switch");
+ append(output_list,"DG");
+ append(watt_list,0.2);
+
+ append(switch_list,"controls/electric/avionics-switch");
+ append(output_list,"transponder");
+ append(watt_list,0.2);
+
+ append(switch_list,"controls/electric/avionics-switch");
+ append(output_list,"turn-coordinator");
+ append(watt_list,0.2);
+
+ append(switch_list,"controls/electric/avionics-switch");
+ append(output_list,"comm[0]");
+ append(watt_list,0.2);
+
+ append(switch_list,"controls/electric/avionics-switch");
+ append(output_list,"comm[1]");
+ append(watt_list,0.2);
+
+ append(switch_list,"controls/electric/avionics-switch");
+ append(output_list,"nav[0]");
+ append(watt_list,0.2);
+
+ append(switch_list,"controls/electric/avionics-switch");
+ append(output_list,"nav[1]");
+ append(watt_list,0.2);
+
+ append(switch_list,"controls/electric/avionics-switch");
+ append(output_list,"autopilot");
+ append(watt_list,0.2);
+
+ append(switch_list,"controls/electric/avionics-switch");
+ append(output_list,"kns80");
+ append(watt_list,0.2);
+
+ for(var i=0; i<size(switch_list); i+=1) {
+ var tmp = props.globals.getNode(switch_list[i],1);
+ tmp.setBoolValue(0);
+ }
+ setprop("controls/electric/avionics-switch",1);
+}
+
+update_virtual_bus = func( dt ) {
+ var PWR = getprop("systems/electrical/serviceable");
+ var battery_volts = battery.get_output_volts();
+ BattVolts.setValue(battery_volts);
+ var alternator1_volts = alternator1.get_output_volts();
+ var external_volts = 24.0;
+
+ load = 0.0;
+ bus_volts = 0.0;
+ power_source = nil;
+
+ bus_volts = battery_volts;
+ power_source = "battery";
+
+ if (alternator1_volts > bus_volts) {
+ bus_volts = alternator1_volts;
+ power_source = "alternator1";
+ }
+
+ if ( EXT.getBoolValue() and ( external_volts > bus_volts) ) {
+ bus_volts = external_volts;
+ }
+
+ bus_volts *=PWR;
+
+ load += electrical_bus(bus_volts);
+
+ ammeter = 0.0;
+
+ if ( power_source == "battery" ) {
+ ammeter = -load;
+ } else {
+ ammeter = battery.charge_amps;
+ }
+
+ if ( power_source == "battery" ) {
+ battery.apply_load( load, dt );
+ } elsif ( bus_volts > battery_volts ) {
+ battery.apply_load( -battery.charge_amps, dt );
+ }
+
+ ammeter_ave = 0.8 * ammeter_ave + 0.2 * ammeter;
+
+ Amps.setValue(ammeter_ave);
+ Volts.setValue(bus_volts);
+ alternator1.apply_load(load);
+
+ return load;
+}
+
+electrical_bus = func(bv) {
+ var bus_volts = bv;
+ var load = 0.0;
+ var srvc = 0.0;
+
+ for(var i=0; i<size(switch_list); i+=1) {
+ var srvc = getprop(switch_list[i]);
+ load = load + srvc * watt_list[i];
+ setprop(outPut~output_list[i],bus_volts * srvc);
+ }
+
+ var DIMMER = bus_volts * getprop("controls/lighting/instrument-lights-norm");
+ var INSTR_SWTCH = getprop("controls/lighting/instrument-lights");
+ DIMMER=DIMMER*INSTR_SWTCH;
+
+ setprop(outPut~"instrument-lights",DIMMER);
+ setprop(outPut~"instrument-lights-norm",DIMMER * 0.0357);
+
+ return load;
+}
+
+update_electrical = func {
+ var scnd = getprop("sim/time/delta-sec");
+ update_virtual_bus( scnd );
+ settimer(update_electrical, 0);
+}
Added: branches/release-2024.1/Aircraft/RAF-S-E-5/Nasal/convert.nas
===================================================================
--- branches/release-2024.1/Aircraft/RAF-S-E-5/Nasal/convert.nas (rev 0)
+++ branches/release-2024.1/Aircraft/RAF-S-E-5/Nasal/convert.nas 2025-05-04 23:42:59 UTC (rev 12053)
@@ -0,0 +1,475 @@
+#############################################################################
+#### Helijah 08-2020 ####
+#### 03-2021 ####
+#### 03-2022 ####
+#### 08-2022 ####
+#### 09-2022 ####
+#### Quelques propriétés utiles ####
+#############################################################################
+
+var convert = func {
+ ###########################################################################
+ var rpm0 = getprop("/engines/engine[0]/rpm");
+ if ( ! rpm0 ) {
+ rpm0 = 0;
+ }
+ var cht0 = getprop("/engines/engine[0]/cht-degC");
+ if ( ! cht0 ) {
+ cht0 = 0;
+ }
+ var mp0 = getprop("/engines/engine[0]/mp-osi");
+ if (! mp0 ) {
+ mp0 = 0;
+ }
+ var run0 = getprop("/engines/engine[0]/running");
+ if (! run0 ) {
+ run0 = 0;
+ }
+ var flow0 = getprop("/engines/engine[0]/fuel-flow-gph");
+ if ( ! flow0 ) {
+ flow0 = 0;
+ }
+ var oilt0 = getprop("/engines/engine[0]/oil-temperature");
+ if ( ! oilt0 ) {
+ oilt0 = 0;
+ }
+ ###########################################################################
+ var rpm1 = getprop("/engines/engine[1]/rpm");
+ if ( ! rpm1 ) {
+ rpm1 = 0;
+ }
+ var cht1 = getprop("/engines/engine[1]/cht-degC");
+ if ( ! cht1 ) {
+ cht1 = 0;
+ }
+ var mp1 = getprop("/engines/engine[1]/mp-osi");
+ if (! mp1 ) {
+ mp1 = 0;
+ }
+ var run1 = getprop("/engines/engine[1]/running");
+ if (! run1 ) {
+ run1 = 0;
+ }
+ var flow1 = getprop("/engines/engine[1]/fuel-flow-gph");
+ if ( ! flow1 ) {
+ flow1 = 0;
+ }
+ var oilt1 = getprop("/engines/engine[1]/oil-temperature");
+ if ( ! oilt1 ) {
+ oilt1 = 0;
+ }
+ ###########################################################################
+ var rpm2 = getprop("/engines/engine[2]/rpm");
+ if ( ! rpm2 ) {
+ rpm2 = 0;
+ }
+ var cht2 = getprop("/engines/engine[2]/cht-degC");
+ if ( ! cht2 ) {
+ cht2 = 0;
+ }
+ var mp2 = getprop("/engines/engine[2]/mp-osi");
+ if (! mp2 ) {
+ mp2 = 0;
+ }
+ var run2 = getprop("/engines/engine[2]/running");
+ if (! run2 ) {
+ run2 = 0;
+ }
+ var flow2 = getprop("/engines/engine[2]/fuel-flow-gph");
+ if ( ! flow2 ) {
+ flow2 = 0;
+ }
+ var oilt2 = getprop("/engines/engine[2]/oil-temperature");
+ if ( ! oilt2 ) {
+ oilt2 = 0;
+ }
+ ###########################################################################
+ var rpm3 = getprop("/engines/engine[3]/rpm");
+ if ( ! rpm3 ) {
+ rpm3 = 0;
+ }
+ var cht3 = getprop("/engines/engine[3]/cht-degC");
+ if ( ! cht3 ) {
+ cht3 = 0;
+ }
+ var mp3 = getprop("/engines/engine[3]/mp-osi");
+ if (! mp3 ) {
+ mp3 = 0;
+ }
+ var run3 = getprop("/engines/engine[3]/running");
+ if (! run3 ) {
+ run3 = 0;
+ }
+ var flow3 = getprop("/engines/engine[3]/fuel-flow-gph");
+ if ( ! flow3 ) {
+ flow3 = 0;
+ }
+ var oilt3 = getprop("/engines/engine[3]/oil-temperature");
+ if ( ! oilt3 ) {
+ oilt3 = 0;
+ }
+ ###########################################################################
+ var rpm4 = getprop("/engines/engine[4]/rpm");
+ if ( ! rpm4 ) {
+ rpm4 = 0;
+ }
+ var cht4 = getprop("/engines/engine[4]/cht-degC");
+ if ( ! cht4 ) {
+ cht4 = 0;
+ }
+ var mp4 = getprop("/engines/engine[4]/mp-osi");
+ if (! mp4 ) {
+ mp4 = 0;
+ }
+ var run4 = getprop("/engines/engine[4]/running");
+ if (! run4 ) {
+ run4 = 0;
+ }
+ var flow4 = getprop("/engines/engine[4]/fuel-flow-gph");
+ if ( ! flow4 ) {
+ flow4 = 0;
+ }
+ var oilt4 = getprop("/engines/engine[4]/oil-temperature");
+ if ( ! oilt4 ) {
+ oilt4 = 0;
+ }
+ ###########################################################################
+ var rpm5 = getprop("/engines/engine[5]/rpm");
+ if ( ! rpm5 ) {
+ rpm5 = 0;
+ }
+ var cht5 = getprop("/engines/engine[5]/cht-degC");
+ if ( ! cht5 ) {
+ cht5 = 0;
+ }
+ var mp5 = getprop("/engines/engine[5]/mp-osi");
+ if (! mp5 ) {
+ mp5 = 0;
+ }
+ var run5 = getprop("/engines/engine[5]/running");
+ if (! run5 ) {
+ run5 = 0;
+ }
+ var flow5 = getprop("/engines/engine[5]/fuel-flow-gph");
+ if ( ! flow5 ) {
+ flow5 = 0;
+ }
+ var oilt5 = getprop("/engines/engine[5]/oil-temperature");
+ if ( ! oilt5 ) {
+ oilt5 = 0;
+ }
+ ###########################################################################
+ var oat = getprop("/environment/temperature-degc");
+ if ( ! oat ) {
+ oat = 0;
+ }
+ var ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt");
+ if ( ! ias ) {
+ ias = 0;
+ }
+
+ var mb0 = getprop("/engine...
[truncated message content] |