FGCamera: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(→‎Commands: (updating the article to v1.1))
(32 intermediate revisions by 5 users not shown)
Line 12: Line 12:
-->
-->
}}
}}
{{WIP}}
{{Note|Also see [[FGCamera API]]}}


{{#ev:youtube|DMZB7QXpR9I|400|right|FGCamera v1.0 in action}}
{{#ev:youtube|DMZB7QXpR9I|400|right|FGCamera v1.0 in action}}
'''FGCamera''' is an alternative FlightGear view system that adds features similar to „EZdok Camera Addon“ for Flight Simulator X. FGCamera is written in Nasal.
'''FGCamera''' is an alternative FlightGear view system, written in Nasal, that adds features similar to [http://www.ezdok-software.com/ EZdok Camera Addon] for Flight Simulator X.


'''Currently available features:'''
'''Currently available features:'''
Line 26: Line 28:


== Download link / Installation ==
== Download link / Installation ==
# [https://drive.google.com/file/d/0B7ZpQgmbsSZGTGlSeGRyOGV0bmM/edit?usp=sharing Download fgcamera_v1.rar]
{{caution|create backup copies before overwriting.}}
# [https://drive.google.com/file/d/0B7ZpQgmbsSZGY183eDJBdEpZYXM/view?usp=sharing Download fgcamera_v1_2.zip]
# Delete (if exist) FG HOME/aircraft-data/FGCamera;
# Delete (if exist) FG HOME/aircraft-data/FGCamera;
# Delete (if exist) FG ROOT/Nasal/fgcamera;
# Delete (if exist) FG ROOT/Nasal/fgcamera;
# Copy fgcamera folder (from downloaded archive) to FG ROOT/Nasal;
# Copy fgcamera folder (from downloaded archive) to FG ROOT/Nasal;
# Copy modified mice.xml from "FG ROOT/nasal/fgcamera" to "FG ROOT/";
# Use FG ROOT/Nasal/fgcamera/fgcamera_cfg as config. If you use fgrun, open advanced settings, go to "General" and select config path (point to fgcamera_cfg.xml)
# Use FG ROOT/Nasal/fgcamera/fgcamera_cfg as config. If you use fgrun, open advanced settings, go to "General" and select config path (point to fgcamera_cfg.xml)
{{note|make sure that ''File>Input Configuration>Click right mouse to cycle mouse behaviour'' (FG menu) is selected}}
{{note| FGCamera uses dedicated views with names "FGCamera1", "FGCamera2", "FGCamera3", "FGCamera4", "FGCamera5" with view numbers 120, 121, 122, 123, 124.
Some aircraft models check for specific view name, and other check for specific view numbers. To be fully compatible with fgcamera, aircraft model should check the property "/sim/current-view/internal" instead of view name or view number.}}
Current (development) version of FGCamera can be downloaded [https://drive.google.com/open?id=0B7ZpQgmbsSZGNkJOYzZFb1RZUnc here]


== User Interface ==
== User Interface ==
Line 46: Line 55:


* "Options" button opens FGCamera's global settings dialog. This dialog is currently non functional.
* "Options" button opens FGCamera's global settings dialog. This dialog is currently non functional.
* "Copy" button creates a copy of currently selected camera view,
* "Create new camera..." button opens new camera creation dialog.
* "Create new camera..." button opens new camera creation dialog.
*The list of cameras shows all the camera views that are created for the currently selected aircraft. Each camera view has its own index. The active view (currently selected view) is marked by square brackets.
*The list of cameras shows all the camera views that are created for the currently selected aircraft. Each camera view has its own index. The active view (currently selected view) is marked by square brackets. Category of each camera is displayed as a suffix in square brackets.
* The active view can be renamed using input box below the list of cameras.
* The active view can be renamed using input box below the list of cameras. The second input box is used to define view category.
* Buttons "U" and "D" are used to rearrange camera views.
* Buttons "U" and "D" are used to rearrange camera views.
* "Delete" button removes the active camera.
* "Del" button removes the active camera.
* "Save" button saves all the cameras data to disk.
* "Save" button saves all the cameras data to disk.
* "Close" closes the dialog (changes will not be saved to disk).
* "Close" closes the dialog (changes will not be saved to disk).
Line 68: Line 78:
[[File: Fgcamera camera settings dialog.jpg|thumb]]
[[File: Fgcamera camera settings dialog.jpg|thumb]]


* Show popupTip - if selected, shows view name when the camera is selected;
* Show dialog - if selected, shows preferred GUI dialog when the camera is selected;
* FOV – field of view;
* FOV – field of view;
* View movement – group of inputs that controls view movement between preset views:
* View movement – group of inputs that controls view movement between preset views:
** Transition time – time to move camera from current position to preset position.
** Transition time – time to move camera from current position to preset position.
* View adjustment – group of inputs that controls view adjustment behaviour:
* View adjustment – group of inputs that controls view adjustment behavior:
** Linear velocity – translational velocity of camera in meters per second,
** Linear velocity – translational velocity of camera in meters per second,
** Angular velocity – angular velocity of camera in degrees per second.
** Angular velocity – angular velocity of camera in degrees per second.
Line 86: Line 98:
* select preset views: {{key press|1}}, {{key press|2}}, {{key press|3}}, {{key press|4}}, {{key press|5}}, {{key press|6}}, {{key press|7}}, {{key press|8}}, {{key press|9}}, {{key press|0}}.
* select preset views: {{key press|1}}, {{key press|2}}, {{key press|3}}, {{key press|4}}, {{key press|5}}, {{key press|6}}, {{key press|7}}, {{key press|8}}, {{key press|9}}, {{key press|0}}.


* adjust camera position: {{key press|}}, {{key press|}}, {{key press|}}, {{key press|}}, {{key press|Page Up}}, {{key press|Page Down}}.
* adjust camera position: {{key press|up}}, {{key press|down}}, {{key press|left}}, {{key press|right}}, {{key press|Page Up}}, {{key press|Page Down}}.


{{note|'''to People using keyboard to fly (with or without mouse):''' throttle keys aren't working with the camera }}
* cycle through categories: {{key press|Shift}} + {{key press|up}}, {{key press|Shift}} + {{key press|down}}.
 
* cycle through views in category: {{key press|Shift}} + {{key press|left}}, {{key press|Shift}} + {{key press|right}}.
 
{{note|'''to People using keyboard to fly (with or without mouse):''' throttle keys aren't working with the camera if default FGCamera key assignments are used }}


Key assignments can be customized by editing ''FGROOT/Nasal/fgcamera/fgcamera_cfg.xml''
Key assignments can be customized by editing ''FGROOT/Nasal/fgcamera/fgcamera_cfg.xml''


=== Commands ===
=== Commands ===
Current version of FGCamera has two commands:
Current version of FGCamera has the following commands:
* ''fgcamera-select'' - selects camera by index. If the camera does not exist, switches to camera 0;
* ''fgcamera-select'' - selects camera by index. If the camera does not exist, switches to camera 0;
* ''fgcamera-adjust'' - adjusts view position and orientation;
* ''fgcamera-adjust'' - adjusts view position and orientation;
Line 189: Line 205:


==== fgcamera-next-category ====
==== fgcamera-next-category ====
{{WIP}}
Binding example:
<syntaxhighlight>
<!-- ... -->
    <binding>
        <command>fgcamera-next-category</command>
    </binding>
<!-- ... -->
</syntaxhighlight>


==== fgcamera-prev-category ====
==== fgcamera-prev-category ====
{{WIP}}
Binding example:
<syntaxhighlight>
<!-- ... -->
    <binding>
        <command>fgcamera-prev-category</command>
    </binding>
<!-- ... -->
</syntaxhighlight>


==== fgcamera-next-in-category ====
==== fgcamera-next-in-category ====
{{WIP}}
Binding example:
<syntaxhighlight>
<!-- ... -->
    <binding>
        <command>fgcamera-next-in-category</command>
    </binding>
<!-- ... -->
</syntaxhighlight>


==== fgcamera-prev-in-category ====
==== fgcamera-prev-in-category ====
{{WIP}}
Binding example:
<syntaxhighlight>
<!-- ... -->
    <binding>
        <command>fgcamera-prev-in-category</command>
    </binding>
<!-- ... -->
</syntaxhighlight>


==== fgcamera-reset-view ====
==== fgcamera-reset-view ====
Binding example:
<syntaxhighlight>
<!-- ... -->
    <binding>
        <command>fgcamera-reset-view</command>
    </binding>
<!-- ... -->
</syntaxhighlight>
== Replay timestamps ==
{{WIP}}
{{WIP}}
[FGCamera v1.2.1]
<syntaxhighlight>
<PropertyList>
    <timestamp>
        ...
    </timestamp>
    <timestamp>
        ...
    </timestamp>
    ...
</PropertyList>
</syntaxhighlight>
<syntaxhighlight>
    <timestamp>
        <time-str>0:00.0</time-str>
        <jump-to>7:15.0</jump-to>    <!-- optional -->
        <camera-id>0</camera-id>
    </timestamp>
</syntaxhighlight>
<syntaxhighlight>
    <timestamp>
        <time-str>0:00.0</time-str>
        <jump-to>5:25.8</jump-to>    <!-- optional -->
        <click-camera>
            <latitude-deg>37.62122627018694</latitude-deg>
            <longitude-deg>-122.3981490730425</longitude-deg>
            <altitude-ft>27.42773406108862</altitude-ft>
        </click-camera>
    </timestamp>
</syntaxhighlight>


== Development status (Oct 2014) ==
== Development status (Apr 2015) ==
* {{progressbar|20}} Dynamic view movement;
* {{progressbar|60}} "AI/MP [[Scripted AI Missiles|Missile]] view" mode [http://forum.flightgear.org/viewtopic.php?f=27&t=24491];
* {{progressbar|40}} Random camera movement (effects);
* {{progressbar|80}} Dynamic view movement;
* {{not done}} Alternative config (presets) that supports "keyboard+mouse" flight controls;
* {{done}} Random camera movement (effects). Effects can be copied/pasted and imported from external files. New dialogs for RND effects management.
* {{done}} <s>Alternative config (presets) that supports "keyboard+mouse" flight controls;</s> modifying the script to fully support "keyboard+mouse" flight controls;
* {{done}} View Categories;
* {{done}} View Categories;
* {{done}} Making view name popup-tips optional (customizable for each view);
* {{done}} Making view name popup-tips optional (customizable for each view);
* {{done}} Each camera view can open GUI dialog;
* {{done}} Each camera view can open GUI dialog;
* {{progressbar|80}} Ability to load older version cameras (backward compatibility).
* {{progressbar|100}} Ability to load older version cameras (backward compatibility);
* {{progressbar|40}} Each camera view can open 2d panel;
* {{progressbar|40}} dedicated [[FGCamera API]] (e.g. for aircraft developers wanting to use fgcamera directly), intended to support versioning for stable APIs, without introducing regressions;
* {{progressbar|80}} reimplement current FGCamera functionality using [[Property rules]] (reduce Nasal usage);


== Gallery ==
== Gallery ==
Line 222: Line 312:
{{#ev:youtube|x-JPzLox-gI|300}}
{{#ev:youtube|x-JPzLox-gI|300}}
{{#ev:youtube|YUG7G0IMpXc|300}}
{{#ev:youtube|YUG7G0IMpXc|300}}
{{#ev:youtube|xsnWJe_xUgw|300}}


== Support ==
== Support ==

Revision as of 18:45, 21 July 2017

FGCamera
Started in 03/2014
Description Alternate Camera Manager System
Contributor(s)
  • Marius_A (since 03/2014)
Status Under active development as of 08/2014
WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.
Note  Also see FGCamera API
FGCamera v1.0 in action

FGCamera is an alternative FlightGear view system, written in Nasal, that adds features similar to EZdok Camera Addon for Flight Simulator X.

Currently available features:

  • 4 camera types:
    • Virtual cockpit,
    • Aircraft (look-at),
    • Aircraft (look-from),
    • World (look-from);
  • Arbitrary number of preset views;
  • Smooth/discrete transition between the views of the same camera type.

Download link / Installation

Caution  create backup copies before overwriting.
  1. Download fgcamera_v1_2.zip
  2. Delete (if exist) FG HOME/aircraft-data/FGCamera;
  3. Delete (if exist) FG ROOT/Nasal/fgcamera;
  4. Copy fgcamera folder (from downloaded archive) to FG ROOT/Nasal;
  5. Copy modified mice.xml from "FG ROOT/nasal/fgcamera" to "FG ROOT/";
  6. Use FG ROOT/Nasal/fgcamera/fgcamera_cfg as config. If you use fgrun, open advanced settings, go to "General" and select config path (point to fgcamera_cfg.xml)
Note  make sure that File>Input Configuration>Click right mouse to cycle mouse behaviour (FG menu) is selected
Note  FGCamera uses dedicated views with names "FGCamera1", "FGCamera2", "FGCamera3", "FGCamera4", "FGCamera5" with view numbers 120, 121, 122, 123, 124.

Some aircraft models check for specific view name, and other check for specific view numbers. To be fully compatible with fgcamera, aircraft model should check the property "/sim/current-view/internal" instead of view name or view number.

Current (development) version of FGCamera can be downloaded here

User Interface

Fgcamera menu item.jpg

Graphical user interface is used to create and manage camera views. FGCamera dialogs can be launched using menubar item View/FGCamera (experimental).

Currently, there are three functional dialogs:

  • Main,
  • Camera creation,
  • Current camera settings.

Main Dialog

Fgcamera main dialog.jpg
  • "Options" button opens FGCamera's global settings dialog. This dialog is currently non functional.
  • "Copy" button creates a copy of currently selected camera view,
  • "Create new camera..." button opens new camera creation dialog.
  • The list of cameras shows all the camera views that are created for the currently selected aircraft. Each camera view has its own index. The active view (currently selected view) is marked by square brackets. Category of each camera is displayed as a suffix in square brackets.
  • The active view can be renamed using input box below the list of cameras. The second input box is used to define view category.
  • Buttons "U" and "D" are used to rearrange camera views.
  • "Del" button removes the active camera.
  • "Save" button saves all the cameras data to disk.
  • "Close" closes the dialog (changes will not be saved to disk).

Camera Creation Dialog

Fgcamera new camera dialog.jpg
  • "Camera type" popup list is used to select camera type. Supported types:
    • cockpit,
    • aircraft (look at),
    • aircraft (look from),
    • world (look from);
  • "Create" – creates new camera view and selects it as an active camera.
  • "Cancel" – closes the dialog.

"Current camera settings" Dialog

Fgcamera camera settings dialog.jpg
  • Show popupTip - if selected, shows view name when the camera is selected;
  • Show dialog - if selected, shows preferred GUI dialog when the camera is selected;
  • FOV – field of view;
  • View movement – group of inputs that controls view movement between preset views:
    • Transition time – time to move camera from current position to preset position.
  • View adjustment – group of inputs that controls view adjustment behavior:
    • Linear velocity – translational velocity of camera in meters per second,
    • Angular velocity – angular velocity of camera in degrees per second.
    • Lowpass filter – "smoothness" of the camera movement.
  • Mouse look – group of inputs that controls mouse look behaviour:
    • Mouse sensitivity – self explanatory,
    • Lowpass filter – "smoothness" of the camera movement.
  • "Apply" saves current camera position (does not write to disk).
  • "Cancel" – closes the dialog (current camera position will not be saved).

Controls

Preconfigured keys

  • select preset views: 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.
  • adjust camera position: , , , , Page Up, Page Down.
  • cycle through categories: Shift + , Shift + .
  • cycle through views in category: Shift + , Shift + .
Noteto People using keyboard to fly (with or without mouse): throttle keys aren't working with the camera if default FGCamera key assignments are used

Key assignments can be customized by editing FGROOT/Nasal/fgcamera/fgcamera_cfg.xml

Commands

Current version of FGCamera has the following commands:

  • fgcamera-select - selects camera by index. If the camera does not exist, switches to camera 0;
  • fgcamera-adjust - adjusts view position and orientation;
  • fgcamera-next-category - cycles to next view category;
  • fgcamera-prev-category - cycles to previous view category;
  • fgcamera-next-in-category - cycles to next view in currently selected category;
  • fgcamera-prev-in-category - cycles to previous view in currently selected category;
  • fgcamera-reset-view - resets currently selected camera's position and orientation.

fgcamera-select

Uses two arguments:

  • camera-id - integer number (camera-id ≥ 0);
  • camera-type - currently non-functional, suggested value is "aircraft".

Keyboard binding example:

<key n="48">
    <name> 0 </name>
    <repeatable type="bool">false</repeatable>
    <desc>Preset view 0</desc>
    <binding>
        <command>fgcamera-select</command>
        <camera-id>0</camera-id>
        <camera-type>aircraft</camera-type>
    </binding>
</key>

fgcamera-adjust

Uses two arguments:

  • velocity - camera movement velocity. Recommended values -1, 0, 1;
  • dof - affected degree of freedom. Valid values:
    • x - left/right,
    • y - up/down,
    • z - back/forward,
    • h - heading,
    • p - pitch,
    • r - roll.

Keyboard binding example:

<key n="360">
    <name> PageUp </name>
    <desc>Camera Up</desc>
    <binding>
        <command>fgcamera-adjust</command>
        <velocity>1</velocity>
        <dof>y</dof>
    </binding>
    <mod-up>
        <binding>
            <command>fgcamera-adjust</command>
            <velocity>0</velocity>
            <dof>y</dof>
        </binding>
    </mod-up>
</key>

Joystick POV hat binding example:

<axis>
    <number><windows>6</windows></number>
    <desc>View Direction</desc>
    <low>
        <binding>
            <command>fgcamera-adjust</command>
            <velocity>1</velocity>
            <dof>h</dof>
        </binding>
        <mod-up>
            <binding>
                <command>fgcamera-adjust</command>
                <velocity>0</velocity>
                <dof>h</dof>
            </binding>
        </mod-up>
    </low>
    <high>
        <binding>
            <command>fgcamera-adjust</command>
            <velocity>-1</velocity>
            <dof>h</dof>
        </binding>
        <mod-up>
            <binding>
                <command>fgcamera-adjust</command>
                <velocity>0</velocity>
                <dof>h</dof>
            </binding>
        </mod-up>
    </high>
</axis>

fgcamera-next-category

Binding example:

<!-- ... -->
    <binding>
        <command>fgcamera-next-category</command>
    </binding>
<!-- ... -->

fgcamera-prev-category

Binding example:

<!-- ... -->
    <binding>
        <command>fgcamera-prev-category</command>
    </binding>
<!-- ... -->

fgcamera-next-in-category

Binding example:

<!-- ... -->
    <binding>
        <command>fgcamera-next-in-category</command>
    </binding>
<!-- ... -->

fgcamera-prev-in-category

Binding example:

<!-- ... -->
    <binding>
        <command>fgcamera-prev-in-category</command>
    </binding>
<!-- ... -->

fgcamera-reset-view

Binding example:

<!-- ... -->
    <binding>
        <command>fgcamera-reset-view</command>
    </binding>
<!-- ... -->

Replay timestamps

WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.

[FGCamera v1.2.1]

<PropertyList>
    <timestamp>
        ...
    </timestamp>
    <timestamp>
        ...
    </timestamp>
    ...
</PropertyList>
    <timestamp>
        <time-str>0:00.0</time-str>
        <jump-to>7:15.0</jump-to>     <!-- optional -->
        <camera-id>0</camera-id>
    </timestamp>
    <timestamp>
        <time-str>0:00.0</time-str>
        <jump-to>5:25.8</jump-to>     <!-- optional -->
        <click-camera>
            <latitude-deg>37.62122627018694</latitude-deg>
            <longitude-deg>-122.3981490730425</longitude-deg>
            <altitude-ft>27.42773406108862</altitude-ft>
        </click-camera>
    </timestamp>

Development status (Apr 2015)

  • 60}% completed "AI/MP Missile view" mode [1];
  • 80}% completed Dynamic view movement;
  • Done Done Random camera movement (effects). Effects can be copied/pasted and imported from external files. New dialogs for RND effects management.
  • Done Done Alternative config (presets) that supports "keyboard+mouse" flight controls; modifying the script to fully support "keyboard+mouse" flight controls;
  • Done Done View Categories;
  • Done Done Making view name popup-tips optional (customizable for each view);
  • Done Done Each camera view can open GUI dialog;
  • 100}% completed Ability to load older version cameras (backward compatibility);
  • 40}% completed Each camera view can open 2d panel;
  • 40}% completed dedicated FGCamera API (e.g. for aircraft developers wanting to use fgcamera directly), intended to support versioning for stable APIs, without introducing regressions;
  • 80}% completed reimplement current FGCamera functionality using Property rules (reduce Nasal usage);

Gallery

Support

FGCamera forum thread