]> git.mxchange.org Git - flightgear.git/commit
David Culp:
authorehofman <ehofman>
Thu, 26 Aug 2004 08:38:43 +0000 (08:38 +0000)
committerehofman <ehofman>
Thu, 26 Aug 2004 08:38:43 +0000 (08:38 +0000)
commitc4aa3fa661507276cdad8f24d5bc78f52d90f58b
tree3dc33bd94edaacf4772ed1ad04442891e5ab56fb
parent5a8f277b88095cea4f7746b3fbcac49a2f9f9a3f
David Culp:

Here is an update for the submodel system.  This will allow submodels to be
defined for any aircraft, and there are no default submodels.  To use this
submodel system you need to set up a binding (slight change in property name
from last one, but you can use any property name you like, as long as it
matches the name in the submodels.xml file, see below):

 <button n="0">
  <desc>Trigger</desc>
  <binding>
   <command>property-assign</command>
   <property>/systems/submodels/trigger</property>
   <value type="bool">true</value>
  </binding>
  <mod-up>
   <binding>
    <command>property-assign</command>
    <property>/systems/submodels/trigger</property>
    <value type="bool">false</value>
   </binding>
  </mod-up>
 </button>

Then in your *-set.xml file you need to define a path to the configuration
file (similar to the way the electrical system is now done):

<sim>
 ...
  <systems>
   <electrical>
    <path>Aircraft/Generic/generic-electrical.xml</path>
   </electrical>
   <submodels>
    <serviceable type="bool">true</serviceable>
    <path>Aircraft/FW190/submodels.xml</path>
   </submodels>
  </systems>
 ...
</sim>

Then you put the submodel configuration file in your aircraft's directory.
I've attached a file, submodels.xml, that can be used to define a gun that
works just like the former one did.

There are two things remaining to be done.  One is to change the function
SubmodelSystem::transform() to properly position the submodel.  This will
require some complicated matrix code that I might borrow from Yasim.
src/Systems/submodel.cxx
src/Systems/submodel.hxx