A 3D object cockpit crosshair, intended for landing training in X-Plane helicopters (and maybe also in fixed wing aircraft).
- Features
- Requirements
- Installation
- Uninstallation
- Configuration
- Menu
- Datarefs and Commands
- Known Issues
- License
Provides a crosshair that is displayed outside of the aircraft. This crosshair will indicate the horizontal and vertical flight path angle for flight path prediction, obstacle avoidance and landing. The crosshair compensates for head position to provide a similar sight picture from any cockpit seat. It supports offsets from a reference point or for the crosshair itself.
Below a certain air speed or with the landing lights switched on (see "Configuration" below), three vertical guidance bars representing three approach path angles are displayed next to the crosshair.
- Download the latest xlua plugin from its repository's Releases page.
- Unzip the archive and move the "xlua" folder into the aircraft's "plugins" folder.
- Download the latest code with the "Code" --> "Download ZIP" button or download an older release from the "Releases" page (pick the "Source Code" download).
- Unzip the archive.
- Move the "cockpit_crosshair" folder into "[Aircraft's main folder]/plugins/xlua/scripts".
- Download the latest code with the "Code" --> "Download ZIP" button.
- Unzip the archive.
- Move the "cockpit_crosshair" folder into "[Aircraft's main folder]/plugins/xlua/scripts".
Delete the "cockpit_crosshair" folder from "[Aircraft's main folder]/plugins/xlua/scripts/".
The crosshair is configured in "plugins/xlua/scripts/cockpit_crosshair/settings.cfg". All settings are commented.
Reloading the settings file can be done any time with the "Reload Settings" function from the "Cockpit Crosshair" menu.
The code for parsing and loading the settings file is hardened against malformed lines and values. Check X-Plane's developer console or Log.txt if you find your file does not load properly.
# Settings for Cockpit Crosshair
#
# Parameter identifier, airspeed in knots indicated below which the crosshair turns on
AUTO_ENABLE,999
# Parameter identifier, airspeed in knots indicated below which the angle bars are visible
ANGLE_BARS_MAX_SPD,50
# Parameter identifier, set to 1 if the angle bars are to be exclusively tied to the landing lights switch
ANGLE_BARS_ON_LAND_LIGHT,1
# Parameter identifier, set to 1 if the crosshair should be hidden in the exterior view
INTERIOR_ONLY,1
#
# All rotations in degrees, all offsets in meters
# Parameter identifier, visibility, offset x (sim/aircraft/view/acf_peX), offset y (sim/aircraft/view/acf_peZ), offset z (sim/aircraft/view/acf_peY)
#REFERENCE,0,0.38,-1.88,0.338
REFERENCE,0,0,0,0
# Parameter identifier, visibility, rotation x, rotation y, rotation z, offset x, offset y, offset z
CROSSHAIR,1,0,0,0,0,10,0
# Parameter identifier, visibility, angle, angle, angle
ANGLE_BARS,1,-7,-10,-12
A menu named "Cockpit Crosshair" will be added to the aircraft menu on X-Plane's main menu bar.
Menu options are the follwing:
Item | Description |
---|---|
Toggle Crosshair | Main switch to toggle the crosshair on and off. |
Toggle Reference Object | Toggles the visibility of the reference object so that it can be positioned |
Angle Bars On Land. Lts. | When active, ties the visibility of the angle bars to the landing lights instead of a velocity range |
Interior View Only | When active, the crosshair will only be shown in interior views |
Reload Settings | Will reload settings.cfg |
"Cockpit Crosshair" offers the following datarefs:
Dataref | Type | Writable | Description |
---|---|---|---|
cockpit_crosshair/reference_point | array[4] | Yes | Visibility and location information for the reference object (Visibility,X,Y,Z) |
cockpit_crosshair/crosshair_in | array[7] | Yes | Input properties for the crosshair object: (Visibility,Rot_X,Rot_Y,Rot_Z,Pos_X,Pos_Y,Pos_Z) |
cockpit_crosshair/crosshair_out | array[7] | No | Output properties for the crosshair object: (Visibility,Rot_X,Rot_Y,Rot_Z,Pos_X,Pos_Y,Pos_Z) |
cockpit_crosshair/angle_bars_in | array[4] | Yes | Input properties for the angle bars: (Visibility,Rot_Bar_1,Rot_Bar_2,Rot_Bar_3) |
cockpit_crosshair/angle_bars_out | array[4] | No | Output properties for the angle bars: (Visibility,Rot_Bar_1,Rot_Bar_2,Rot_Bar_3) |
cockpit_crosshair/auto_enable_ias | number | Yes | Indicated airspeed in knots below which the crosshair will turn on |
cockpit_crosshair/angle_bars_ias | number | Yes | Indicated airspeed in knots below which the angle bars are visible |
"Cockpit Crosshair" offers the following commands that can be bound to any input device:
Command | Description |
---|---|
cockpit_crosshair/toggle_crosshair | Toggle the crosshair on/off |
cockpit_crosshair/toggle_reference | Toggles the reference object's visibility on/off |
cockpit_crosshair/reload_settings | Reloads settings.cfg |
- Because the crosshair and reference object is spawned with XPLMCreateInstance, it will always be treated as an external object
- The crosshair can not be scaled, so up close it will be very large and far away potentially hard to see.
- The crosshair can not be drawn over 3D objects, so if it vanishes behind the panel, use side slip in helicopters to put it into a side window or move the eyepoint upward to see it over the nose in fixed wing aircraft.
- The crosshair animation applies rotation first and translation second, so any X,Y,Z offsets will be applied at an angle. I might fix this in the future.
- The slight delay when toggling crosshair visbility features on and off is deliberate because the logic runs in a timer with a 1 second refresh interval to save CPU cycles.
"Cockpit Crosshair" is licensed under the European Union Public License v1.2 (see EUPL-1.2-license.txt). Compatible licenses (e.g. GPLv3) are listed in the section "Appendix" in the license file.