Howto:Add blackout and redout settings: Difference between revisions
Jump to navigation
Jump to search
m (→Involved properties: typo) |
(+ Pilot will be blinded, not incapacitated; "Head shake"; Proper XML header; Found the related source files, in flightgear/src/Scenery ;-) |
||
Line 1: | Line 1: | ||
This is '''how to add blackout and redout settings''' to an aircraft. These settings will determine when the view will start to turn black or red and when it will be fully black or red due to {{wikipedia|G-force#Human tolerance of g-force|g-force}}. | This is '''how to add blackout and redout settings''' to an aircraft. These settings will determine when the view will start to turn black or red and when it will be fully black or red due to {{wikipedia|G-force#Human tolerance of g-force|g-force}}. | ||
{{note|While the pilot will be temporarily blind due to g-force he will not be incapacitated and will still be able to control the aircraft.}} | |||
== Involved properties == | == Involved properties == | ||
Line 11: | Line 13: | ||
These properties can be controlled at runtime or be added to any [[PropertyList XML files|PropertyList XML file]], for example an [[aircraft-set.xml]] or your own [[FlightGear configuration via XML|configuration file]]. | These properties can be controlled at runtime or be added to any [[PropertyList XML files|PropertyList XML file]], for example an [[aircraft-set.xml]] or your own [[FlightGear configuration via XML|configuration file]]. | ||
In addition to these properties there is another property, <code>/sim/rendering/headshake/enabled</code> (bool), that will make the pilots viewpoint move up and down due to the g-force, for example due to maneuvers or turbulence. | |||
== Example == | == Example == | ||
Line 16: | Line 20: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<?xml version="1.0" encoding="UTF-8"?> | |||
<PropertyList> | <PropertyList> | ||
<!-- ... --> | <!-- ... --> | ||
<rendering> | <sim> | ||
<!-- ... --> | |||
<rendering> | |||
<redout> | |||
<enabled type="bool" userarchive="y">true</enabled> | |||
<parameters> | |||
<blackout-onset-g>6</blackout-onset-g> | |||
<blackout-complete-g>8</blackout-complete-g> | |||
</ | <redout-onset-g>-2</redout-onset-g> | ||
</ | <redout-complete-g>-4</redout-complete-g> | ||
</ | </parameters> | ||
</redout> | |||
<headshake> | |||
<enabled type="bool" userarchive="y">true</enabled> | |||
</headshake> | |||
</rendering> | |||
<!-- ... --> | |||
</sim> | |||
<!-- ... --> | <!-- ... --> | ||
</PropertyList> | </PropertyList> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Related content == | == Related content == | ||
=== Source === | === Source code === | ||
* {{repo link|site=sf|proj=flightgear/fgdata|type=git|path=Nasal/redout.nas|pre=FGData}} | * {{repo link|site=sf|proj=flightgear/fgdata|type=git|path=Nasal/redout.nas|pre=FGData}} | ||
* {{repo link|site=sf|proj=flightgear/flightgear|type=git|path=src/Scenery/redout.hxx|pre=FlightGear}} | |||
* {{repo link|site=sf|proj=flightgear/flightgear|type=git|path=src/Scenery/redout.cxx|pre=FlightGear}} | |||
[[Category:Aircraft enhancement]] | [[Category:Aircraft enhancement]] | ||
[[Category:Howto]] | [[Category:Howto]] |
Revision as of 17:22, 28 May 2015
This is how to add blackout and redout settings to an aircraft. These settings will determine when the view will start to turn black or red and when it will be fully black or red due to g-force .
Note While the pilot will be temporarily blind due to g-force he will not be incapacitated and will still be able to control the aircraft. |
Involved properties
Blackout and redout are controlled through these properties in /sim/rendering/redout/
:
enabled
(bool)parameters/blackout-onset-g
(double)parameters/blackout-complete-g
(double)parameters/redout-onset-g
(double)parameters/redout-complete-g
(double)
These properties can be controlled at runtime or be added to any PropertyList XML file, for example an aircraft-set.xml or your own configuration file.
In addition to these properties there is another property, /sim/rendering/headshake/enabled
(bool), that will make the pilots viewpoint move up and down due to the g-force, for example due to maneuvers or turbulence.
Example
This example show how these setting can be added to a propertylist xml file:
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
<!-- ... -->
<sim>
<!-- ... -->
<rendering>
<redout>
<enabled type="bool" userarchive="y">true</enabled>
<parameters>
<blackout-onset-g>6</blackout-onset-g>
<blackout-complete-g>8</blackout-complete-g>
<redout-onset-g>-2</redout-onset-g>
<redout-complete-g>-4</redout-complete-g>
</parameters>
</redout>
<headshake>
<enabled type="bool" userarchive="y">true</enabled>
</headshake>
</rendering>
<!-- ... -->
</sim>
<!-- ... -->
</PropertyList>