
文字ばかりでは味気ないので。
映画「ザ・デイ・アフター」のICBMを思い出させるSAMの発射。
映画「ザ・デイ・アフター」のICBMを思い出させるSAMの発射。
(続)打ち上げ花火2では、submodels.xmlを記述するのにsim/ai/aircraf/impact/droptankを利用し、Nasalでいわば無理やり花火を表示させましたが、ダミーを ぶつけるんであれば、ai/models/model-impactが使えてもおかしくないはず。試してみました。
A10の機体で見つけたもので、ホームページ 「仮想飛行」で紹介しましたが、銃撃などによる爆発、煙を再現することができるもの。結果は予想通り花火を大空に開かせることができました。こちらの方がスマートですね。
しかも、submodels.xml中で別なsubmodel.xmlを使用することができると言っていいんでしょうか、<submodel-path>を使うことで花火の画像表示用xmlファイル(hanabi.xml)を機能させる時間を<life>で与えることができるもう一つのsubmodels.xml(hanabi-subomodels.xml)が指定できて、開いた花火を一定時間後に消すこともできるようになりました。
なお、問題としてはダミーとミサイル本体がぶつかった時に、そこでダミーは消滅するのですがミサイル本体はそのまま消えずに飛行を続けることです。とりあえずは<life>に適当な値を与えてしのぐよりありません。
以下に、ミサイルとダミーをぶつけて花火を爆発させるためのsubmodels.xmlの実例を示します。
<?xml version="1.0"?> <PropertyList> <submodel> <name>dummy</name> <model>Aircraft/SAM-launcher/Models/dummy.xml</model> <trigger>controls/armament/station[2]/missiles</trigger> <speed>202</speed> <repeat>false</repeat> <count>1</count> <x-offset>-80</x-offset> <y-offset>0</y-offset> <z-offset>7.7</z-offset> <yaw-offset>0</yaw-offset> <pitch-offset>22</pitch-offset> <wind>false</wind> <eda>0.000001</eda> <weight>500</weight> <buoyancy>31.0</buoyancy> <cd>0</cd> <life>40</life> <collision>true</collision> <impact>true</impact> <impact-report>ai/models/model-impact</impact-report> <submodel-path>Aircraft/SAM-launcher/Models/hanabi-submodels.xml</submodel-path> </submodel> <submodel> <name>missile</name> <model>Aircraft/SAM-launcher/Models/SA-2.xml</model> <trigger>controls/armament/station[3]/missiles</trigger> <speed>200</speed> <repeat>false</repeat> <count>1</count> <x-offset>-6</x-offset> <y-offset>0</y-offset> <z-offset>7.7</z-offset> <yaw-offset>0</yaw-offset> <pitch-offset>22</pitch-offset> <!--<pitch-offset>41</pitch-offset>--> <wind>false</wind> <eda>0.000001</eda> <weight>500</weight> <buoyancy>32</buoyancy> <cd>0</cd> <life>27</life> <!--<collision>true</collision> <impact>true</impact> <impact-report>ai/models/model-impact</impact-report> <submodel-path>Aircraft/SAM-launcher/Models/hanabi-submodels.xml</submodel-path>--> </submodel> </PropertyList>
<submodel-path>に指定したhanabi-submodels.xmlも示します。花火は少し落下していくようにしています。
<?xml version="1.0"?> <PropertyList> <submodel> <name>impact hanabi</name> <model>Aircraft/SAM-launcher/Models/hanabi.xml</model> <speed>0</speed> <repeat>false</repeat> <delay>0</delay> <count>-1</count> <x-offset>0</x-offset> <y-offset>0</y-offset> <z-offset>0</z-offset> <yaw-offset>0</yaw-offset> <pitch-offset>0</pitch-offset> <eda>10</eda> <wind>true</wind> <!--<buoyancy>32.1</buoyancy>--> <buoyancy>10</buoyancy> <life>15</life> </submodel> </PropertyList>