IG Configuration
All IG configuration parameters (variables such as system settings, connector parameters, date, time and weather, databases, and entity definitions) are stored by default in a single file named ig_config.xml.
-ig_config "my_config.xml"
A configuration file is an ordinary *.xml file with the following structure (example):
<?xml version="1.0" encoding="utf-8"?>
<ig_config>
<variables>
<!-- ==== ADAPTIVE QUALITY SYSTEM ======================= -->
<group name="AdaptiveQualitySystem">
<item name="mode" type="int">0</item>
<item name="debug" type="int">0</item>
<item name="sleep_period_after_world_load" type="float">-1.000000</item>
<item name="cpu_budget" type="float">-1.000000</item>
<item name="threshold" type="float">-1.000000</item>
<item name="change_period" type="float">-1.000000</item>
</group>
<!-- ==== CONNECTOR PARAMETERS ======================= -->
<group name="CIGIConnector">
<item name="version" type="string">3.3</item>
<item name="host">127.0.0.1</item>
<item name="send_port">8889</item>
<item name="recv_port">8888</item>
</group>
<!-- ==== CONFIGURATION FILE SETTINGS ======================= -->
<group name="IG">
<item name="autoload_database" type="int">-1</item>
<item name="config_read_only" type="int">0</item>
<item name="default_view_id" type="int">0</item>
<item name="terrain_intersection_mask" type="int">0</item>
</group>
<!-- ==== WEATHER SETTINGS ======================= -->
<group name="Meteo">
<item name="visibility_transition_time" type="float">3.000000</item>
<item name="precipitations_transition_time" type="float">3.000000</item>
<item name="cloud_transition_time" type="float">3.000000</item>
<item name="visibility_tracker" type="string">ig/weather/tracks/visibility.track</item>
<item name="overcast_preset_tracker" type="string">ig/weather/tracks/clouds_environment.track</item>
<item name="clouds_density_tracker" type="string">ig/weather/tracks/clouds_density.track</item>
<item name="lightning" type="string">ig/weather/fx/lightning/nodes/lightning_particles.node</item>
</group>
<!-- ==== DATE AND TIME SETTINGS ======================= -->
<group name="SkyMap">
<item name="timezone" type="int">0</item>
<item name="datetime" type="string">2003-12-06T10:30:00</item>
</group>
</variables>
<!-- ==== DATABASE LIST ======================= -->
<databases>
<database id="1" world_name="world_1" geodetic_origin="25 25 0"/>
</databases>
<!-- ==== ENTITY DEFINITIONS ======================= -->
<entity_types>
<entity id="118" name="a321">
<path>my_project/entities/aircrafts/A321/a321_air_France.node</path>
<component id="0" name="light_outer">
<property>LightAircraftController</property>
<parameter name="state">enabled</parameter>
<parameter name="data1">landing</parameter>
<!-- ..... -->
<parameter name="data6">logo</parameter>
</component>
<!-- ..... -->
<articulated_part id="1" name="aileron">
<node invert_pitch="1">aileron_left</node>
<node>aileron_right</node>
</articulated_part>
<articulated_part id="2" name="rudder">
<node invert_yaw="1">rudder</node>
</articulated_part>
</entity>
<!-- ..... -->
</entity_types>
<!-- ==== VIEW TYPES LIST ===================================== -->
<view_types>
<view_type type="1" post_materials="post_sensor_heat"/>
<view_type type="2" post_materials="post_sensor_green"/>
<view_type type="3" post_materials="post_sensor_white"/>
<view_type type="4" post_materials="post_sensor_red"/>
<view_type type="5" post_materials="post_sensor_white,post_sensor_heat"/>
</view_types>
<!-- ==== CLOUD TYPES LIST ==================================== -->
<cloud_types>
<cloud_type type="1" name="altocumulus" material="ig/clouds/materials/altocumulus.mat" tracker_file="ig/clouds/track/altocumulus_density.track" shadow_density="0.50999999" padding="0.38499999 0.441000015" elevation="0" thickness="500"/>
<cloud_type type="2" name="altostratus" material="ig/clouds/materials/altostratus.mat" tracker_file="ig/clouds/track/altostratus_density.track" shadow_density="0" padding="0.187999994 0.486000001" elevation="0" thickness="500"/>
<!-- ..... -->
<cloud_type type="12" name="cumulonimbus_2" material="ig/clouds/materials/cumulonimbus_2.mat" tracker_file="ig/clouds/track/cumulus_density.track" shadow_density="0" padding="0.178000003 0.74000001" elevation="0" thickness="500"/>
<cloud_type type="13" name="cumulonimbus_3" material="ig/clouds/materials/cumulonimbus_3.mat" tracker_file="ig/clouds/track/cumulus_density.track" shadow_density="0.98999995" padding="0.0979999974 0.778999984" elevation="0" thickness="500"/>
</cloud_types>
<!-- ==== PRECIPITATION TYPES LIST ==================================== -->
<precipitation_types>
<precipitation_type type="2" name="snow" far_node_path="" near_node_path="ig/weather/fx/snow_particles/nodes/snow_flakes.node"/>
<precipitation_type type="1" name="rain" far_node_path="" near_node_path="ig/weather/fx/rain_particles/nodes/rain_particles.node"/>
</precipitation_types>
<!-- =========================================== -->
<syncker_channels>
<channel view_id="0" use_syncker_projection="1" syncker_name="left_view"/>
<channel view_id="1" use_syncker_projection="0" syncker_name="ground_cam"/>
</syncker_channels>
<!-- =========================================== -->
<cigi_global_terrain_components>
<component_light id="0" name="tomsk_full">CITY1/*</component_light>
<component_light id="1" name="RWY_red_only">CITY1/RWY/RED</component_light>
<component_light id="2" name="RWY_approach">CITY1/RWY/APPROACH/*</component_light>
</cigi_global_terrain_components>
<!-- =========================================== -->
<cigi_weather_layer>
<layer id="1" name="cloud1" layer_type="1"/>
<layer id="2" name="cloud2" layer_type="1"/>
<layer id="3" name="cloud3" layer_type="1"/>
<layer id="4" name="rain" layer_type="2" precipitation_type="1"/>
<layer id="5" name="snow" layer_type="2" precipitation_type="2"/>
</cigi_weather_layer>
<!-- =========================================== -->
</ig_config>
Adaptive Quality System#
This group contains configuration parameters of the Adaptive Quality System, which adapts the image quality for the current performance by increasing/decreasing distance scale values (render_distance_scale and the Simplifier distance scale).
<group name="AdaptiveQualitySystem">
<item name="mode" type="int">0</item>
<item name="debug" type="int">0</item>
<item name="sleep_period_after_world_load" type="float">-1.000000</item>
<item name="cpu_budget" type="float">-1.000000</item>
<item name="threshold" type="float">-1.000000</item>
<item name="max_scale" type="float">1</item>
<item name="min_scale" type="float">0.100000001</item>
<item name="scale_step" type="float">0.0500000007</item>
<item name="change_period" type="float">-1.000000</item>
</group>
The following items are available for the Adaptive Quality System:
mode — one of the modes in which the Adaptive Quality System operates:
- 0 — the system is disabled
- 1 — the system operates in the degrading mode (without re-improving the quality when the conditions are back to normal)
- 2 — the system in normal mode, degrading the image if the CPU budget is exceeded and restoring better quality when the conditions are back to normal.
- debug — 0 to disable the debug mode, 1 to enable displaying the debug info.
- sleep_period_after_world_load — idle time of the Adaptive Quality System, in seconds, after the world is loaded.
- cpu_budget — target CPU Total Time value, in milliseconds. -1 sets the default value of 10 milliseconds.
- threshold — a threshold value, in milliseconds. If CPU Total Time has changed less than this value, no adaptation is performed. -1 sets the default value of 3 milliseconds.
- change_period — update period, in seconds. This period enables you to ignore spikes, not to treat them as degrading performance. -1 sets the default value of 0.5 milliseconds.
- min_scale — minimum scale value defining the lower limit of the range of adjustment of the distance scale (global rendering and Simplifier).
- max_scale — maximum scale value defining the upper limit of the range of adjustment of the distance scale (global rendering and Simplifier).
- scale_step — the Adaptive Quality System shall use this step when adjusting distance scale.
Connector Parameters#
Configuration parameters for connectors are added to the variables group with the corresponding name, e.g. CIGIConnector for CIGI-connector:
<group name="CIGIConnector">
<item name="version" type="string">3.3</item>
<item name="host">127.0.0.1</item>
<item name="send_port">8889</item>
<item name="recv_port">8888</item>
</group>
The following items are available for CIGI:
- version — CIGI protocol version
- host — CIGI Host IP-address
- send_port — TCP port number to be used for sending packets to the CIGI Host
- recv_port — TCP port number to be used for receiving packets from the CIGI Host
- packet_size — maximum size of the packet
The following items are available for DIS:
- broadcast_address — a broadcast address of the server computer that is used to broadcast messages to IG over the network
- site — the Site ID of this application instance
- exercise — the Exercise ID of the DIS
- app — the Application ID of this application instance
Configuration File Settings#
The following parameters are available to control automatic update of the configuration file.
<group name="IG">
<item name="autoload_database" type="int">-1</item>
<item name="config_read_only" type="int">0</item>
<item name="default_view_id" type="int">0</item>
<item name="terrain_intersection_mask" type="int">0</item>
</group>
- autoload_database — ID of the database to be loaded automatically.
- config_read_only — set this parameter to 1 to avoid automatic re-writing of the configuration file with deletion of all your comments.
- default_view_id — ID of the view to be used by default.
- terrain_intersection_mask — intersection mask specifying which surface is considered the ground surface (HAT/HOT requests, entity clamp, etc.).
Weather Settings#
The weather settings are added to the variables group with the name Meteo.
<group name="Meteo">
<item name="visibility_transition_time" type="float">3.000000</item>
<item name="precipitations_transition_time" type="float">3.000000</item>
<item name="cloud_transition_time" type="float">3.000000</item>
<item name="visibility_tracker" type="string">ig/weather/tracks/visibility.track</item>
<item name="overcast_preset_tracker" type="string">ig/weather/tracks/clouds_environment.track</item>
<item name="clouds_density_tracker" type="string">ig/weather/tracks/clouds_density.track</item>
<item name="lightning" type="string">ig/weather/fx/lightning/nodes/lightning_particles.node</item>
<item name="water_beaufort_material_prefix" type="string">water_global_beaufort_%d</item>
</group>
The following items are available:
- visibility_transition_time — time, in seconds, for gradual change of visibility conditions (fog, etc.)
- precipitations_transition_time — time, in seconds, for gradual change of precipitation
- cloud_transition_time — time, in seconds, for gradual change of cloudiness
- visibility_tracker — path to the .track file containing visibility transition effect
- overcast_preset_tracker — path to the .track file containing the overcast preset
- clouds_density_tracker — path to the .track file containing gradual change of cloudiness
- lightning — path to the node storing lighting
- water_beaufort_material_prefix — name of the water material for the corresponding number according to the Beaufort scale
Date and Time Settings#
The date and time settings are added to the variables group with the name SkyMap.
<group name="SkyMap">
<item name="timezone" type="int">0</item>
<item name="datetime" type="string">2003-12-06T10:30:00</item>
</group>
The following items are available:
- timezone — UTC timezone, only an integer value is possible (if not set, UTC=0)
- datetime — date and time set for the specified timezone
Databases#
The list of databases (worlds with terrains) is enclosed in the <databases/> tag. You can specify as many worlds as required.
<databases>
<database id="1" world_name="world_1" geodetic_origin="25 25 0"/>
<!-- ..... -->
<database id="n" world_name="world_n" geodetic_origin="23 10 0"/>
</databases>
The following attributes are available:
- id — ID of the database (used when loading databases)
- world_name — name of the corresponding *.world file
- geodetic_origin — geodetic origin in ellipsoid coordinates (latitude (degrees), longitude (degrees), and altitude (meters) ).
Entity Definitions#
An IG has a number of models, that are used to represent certain entities in the virtual environment. Entity definition section is enclosed in the <entity_types/> tag. To define each entity, the <entity/> tag is used.
Each entity includes the following:
- *.node file containing the hierarchy of nodes representing the entity in the virtual world. A path to this file is specified in the <path/> tag.
-
Set of components (flashing lights, aircraft propellers, afterburners, landing gear, tank tracks, wheels, and like items). Definition of each component is enclosed in the <component/> tag.
Component data in packets, received by IG from connectors, is usually represented as a set of a discrete state and up to six values (data1, data2 ... data6). IG component definitions in this section are actually used to map parameters from connectors to corresponding properties (e.g. data1 field of the outer_light component in the example below corresponds to landing light type). - Set of articulated parts (ailerons, flaps, etc.). Definition of each articulated part is enclosed in the <articulated_part/> tag.
Below is an example of entity definition section:
<entity_types>
<entity id="111" name="b52">
<path>my_project/entities/aircrafts/B52/b52.node</path>
<component id="0" name="light_outer">
<property>LightAircraftController</property>
<parameter name="state">enabled</parameter>
<parameter name="data1">landing</parameter>
<!-- ..... -->
<parameter name="data6">logo</parameter>
</component>
<!-- ..... -->
<articulated_part id="1" name="aileron">
<node invert_pitch="1">aileron_left</node>
<node>aileron_right</node>
</articulated_part>
<articulated_part id="2" name="rudder">
<node invert_yaw="1">rudder</node>
</articulated_part>
<volume_definition id="0" name="body" shape="0">volumes</volume_definition>
<volume_definition id="1" name="wings" shape="1">volumes</volume_definition>
</entity>
<!-- ..... -->
Components#
Each entity may have an arbitrary number of components assigned, including custom ones. To define a component of an entity use the <component/> tag:
<!-- ..... -->
<entity id="118" name="a321">
<path>my_project/entities/aircrafts/A321/a321_air_France.node</path>
<!-- ..... -->
<component id="22" name="rotorwash">
<property>rotorwash</property>
<parameter name="data1">wind_percent</parameter>
<parameter name="data2">sand_percent</parameter>
</component>
<!-- ..... -->
</entity>
<!-- ..... -->
Components are added to entities by means of assigning corresponding properties to nodes. By default it is assumed that all properties corresponding to components are assigned to the root node. In fact, a component's property can be assigned to any node in entity's hierarchy. For such a component you should add the <node/> tag to specify a path to this node (the path is specified relative to the root node):
<!-- ..... -->
<entity id="118" name="a321">
<path>my_project/a321_air_France.node</path>
<!-- ..... -->
<component id="22" name="rotorwash">
<property>rotorwash</property>
<node>path_to_node</node>
<parameter name="data1">wind_percent</parameter>
<parameter name="data2">sand_percent</parameter>
</component>
<!-- ..... -->
</entity>
<!-- ..... -->
Example:
For a hierarchy shown below, we have the comp1 component's property assigned to the aileron_left node, and comp2 component's property assigned to the engine_1_fire node. Definition of components will look like:
|
Articulated Parts#
Each entity may have an arbitrary number of articulated parts (e.g. flaps, slats, etc.). To define an articulated part of an entity use the <articulated_part/> tag:
<entity_types>
<entity id="111" name="b52">
<path>my_project/entities/aircrafts/B52/b52.node</path>
<!-- ..... -->
<articulated_part id="1" name="aileron">
<node invert_pitch="1">aileron_left</node>
<node>aileron_right</node>
</articulated_part>
<articulated_part id="2" name="rudder">
<node invert_yaw="1">rudder</node>
</articulated_part>
</entity>
<!-- ..... -->
For each articulated part a corresponding node should be specified using the <node/> tag. Paths are specified relative to the root node, the same way as for components.
You can also specify a path to a node inside a NodeReference as follows:
- <node>path_to_node_reference/^/path_inside_nodereference</node>
Volumes#
To define an entity volume use the <articulated_part/> tag:
<!-- ..... -->
<entity id="111" name="b52">
<path>my_project/entities/aircrafts/B52/b52.node</path>
<!-- ..... -->
<volume_definition id="0" name="body" shape="0">path/inside/nodereference</volume_definition>
<volume_definition id="1" name="wings" shape="1">path/inside/nodereference</volume_definition>
</entity>
<!-- ..... -->
The following attributes are available:
- id — the volume identifier in CIGI/IG.
- name — the name of the volume. You can use it for debugging or when writing your own collision handler.
- shape — the shape order in the physics/shapes tab.
Using this tag requies creating ObjectDummy and BodyDummy inside the entity NodeReference. The value indicated inside this tag is a path to the ObjectDummy inside the entity NodeReference.
Cloud Types#
The list of available cloud types is enclosed in the <cloud_types/> tag. The cloud type can be set via HEMU / IG Host, or using the WeatherLayerCloud::setCloudType() method.
<cloud_types>
<cloud_type type="1" name="altocumulus" material="ig/clouds/materials/altocumulus.mat" tracker_file="ig/clouds/track/altocumulus_density.track" shadow_density="0.50999999" padding="0.38499999 0.441000015" elevation="0" thickness="500"/>
<cloud_type type="2" name="altostratus" material="ig/clouds/materials/altostratus.mat" tracker_file="ig/clouds/track/altostratus_density.track" shadow_density="0" padding="0.187999994 0.486000001" elevation="0" thickness="500"/>
<!-- ..... -->
<cloud_type type="12" name="cumulonimbus_2" material="ig/clouds/materials/cumulonimbus_2.mat" tracker_file="ig/clouds/track/cumulus_density.track" shadow_density="0" padding="0.178000003 0.74000001" elevation="0" thickness="500"/>
<cloud_type type="13" name="cumulonimbus_3" material="ig/clouds/materials/cumulonimbus_3.mat" tracker_file="ig/clouds/track/cumulus_density.track" shadow_density="0.98999995" padding="0.0979999974 0.778999984" elevation="0" thickness="500"/>
</cloud_types>
The following attributes are available:
- type — type of clouds
- name — name of the cloud type
- material — material to be used
- shadow_density — power of the shadow cast by this cloud within the range [0.0, 1.0]
- padding — lower and upper bounds for this type of cloud
- elevation — default elevation for this type of cloud (height above sea level), in meters
- thickness — default thickness for this type of cloud, in meters
Precipitation Types#
The list of available precipitation types is enclosed in the <precipitation_types/> tag.
<precipitation_types>
<precipitation_type type="2" name="snow" far_node_path="" near_node_path="ig/weather/fx/snow_particles/nodes/snow_flakes.node"/>
<precipitation_type type="1" name="rain" far_node_path="" near_node_path="ig/weather/fx/rain_particles/nodes/rain_particles.node"/>
</precipitation_types>
The following attributes are available:
- type — precipitation type id
- name — name of the precipitation type
- far_node_path — path to the node storing a representtation of the precipitation effect for far distances (when left empty the near_node_path is used)
- near_node_path — path to the node storing a representtation of the precipitation effect for close distances
Cameras#
Cameras in IG are synchronized in a special way. A View is an IG wrapper for the Camera, so you can manage a camera via the View only. IG has the following methods to set the desired view for a Slave:
- void setCurrentView(int view_id);
- void setSlaveView(int slave_index, int view_id);
The list of available views is enclosed in the <syncker_channels/> tag. Here you can set the desired view for each Slave and specify if it is affected by the Syncker’s projections:
<syncker_channels>
<channel view_id="0" use_syncker_projection="1" syncker_name="center_view"/>
<channel view_id="1" use_syncker_projection="1" syncker_name="left_view"/>
<channel view_id="2" use_syncker_projection="0" syncker_name="ground_cam"/>
</syncker_channels>
The following attributes are available:
- view_id — ID of the view to be used
- use_syncker_projection — flag indicating if the view is affected by the Syncker’s projections
- syncker_name — name of the view used in the Syncker
View Types#
The list of post effect materials available for the camera is enclosed in the <view_types/> tag. The view type can be set via HEMU / IG Host, or using the setViewType() method.
<view_types>
<view_type type="1" post_materials="post_sensor_heat"/>
<view_type type="2" post_materials="post_sensor_green"/>
...
</view_types>
The following attributes are available:
- id — ID of the database (used when loading databases)
- post_materials — list of post effects to be applied