Walk view: Difference between revisions

Jump to navigation Jump to search
2,735 bytes added ,  10 February 2011
Added a 3rd option.
m (moved Walk View to Walk view: Weird capital use)
(Added a 3rd option.)
Line 243: Line 243:
   </input>
   </input>
  </keyboard>
  </keyboard>
==Another option for internal walk views==
Another option is to use the WalkView module available in Aircraft/Generic/WalkView/ (in FlightGear 2.2.0 or later).
Load the WalkView module and the configuration from the -set file. The example below is from [[Nordstern]] and makes the view named "Walk View" into a walk view. See also [[Zeppelin NT]] and [[Short Empire]] for more examples.
<!-- Define the view. -->
<sim>
  ...
  <view n="103">
  <name>Walk View</name>
  <internal>true</internal>
  <config>
    <!-- x/y/z == right/up/back -->
    <from-model type="bool">true</from-model>
    <from-model-idx type="int">0</from-model-idx>
    <x-offset-m type="double">  0.00 </x-offset-m>
    <y-offset-m type="double"> -7.50 </y-offset-m>
    <z-offset-m type="double"> 51.00 </z-offset-m>
    <heading-offset-deg type="double"> 0.0 </heading-offset-deg>
    <pitch-offset-deg type="double"> 0.0 </pitch-offset-deg>
    <default-field-of-view-deg type="double"> 65 </default-field-of-view-deg>
  </config>
  </view>
  ...
</sim>
<!-- Load and configure the WalkView module. -->
<nasal>
  <walkview>
  <file>Aircraft/Generic/WalkView/walkview.nas</file>
  <script>
    # The keel walk-way is a long narrow path running in the fore-aft direction.
    # Additionally there is a path to the side engine cars.
    var keelConstraint =
      walkview.makeUnionConstraint(
        [
        walkview.makePolylinePath(
            [
              [ 10.0,  0.0,  -6.3],
              [ 15.0,  0.0,  -7.2],
              [ 20.0,  0.0,  -7.8],
              [ 25.0,  0.0,  -8.2],
              [ 30.0,  0.0,  -8.6],
              [ 35.0,  0.0,  -8.8],
              [ 40.0,  0.0,  -9.0],
              [ 50.0,  0.0,  -9.1],
              [ 65.0,  0.0,  -9.1],
              [ 70.0,  0.0,  -8.8],
              [ 80.0,  0.0,  -8.5],
              [ 90.0,  0.0,  -7.9],
              [ 95.0,  0.0,  -7.4],
              [100.0,  0.0,  -6.9],
              [105.0,  0.0,  -6.2],
              [110.0,  0.0,  -5.4],
            ],
            0.20),
        walkview.makePolylinePath(
            [
              [ 59.75, -4.90, -7.79],
              [ 59.75, -1.70, -9.05],
              [ 59.75,  1.70, -9.05],
              [ 59.75,  4.90, -7.79],
            ],
            0.20)
        ]);
    # Create the walker for the named view and the given movement restrictions.
    var rigger_walker = walkview.Walker.new("Walk View",
                                            keelConstraint);
  </script>
  </walkview>
  ...
</nasal>
<!-- Load the default keyboard bindings for the walk view (w/W, a, d, s). -->
<input>
  <keyboard include="../Generic/WalkView/walk-view-keys.xml">
  ...
  </keyboard>
  ...
</input>


[[Category:Aircraft enhancement]]
[[Category:Aircraft enhancement]]
789

edits

Navigation menu