X-Plane historically had only one windshield for the 2d cockpit, on which effects for icing, rain or wipers were displayed. With the advent of more sophisticated 3d effects, it has become necessary to simulate more than one glass surface for looking out.
X-Plane 12 has four distinct window surfaces. They are numbered as follows:
- Pilot front windshield
- Copilot front windshield
- Pilot side window
- Copilot side window
Even numbers refer to the left side (0 being even) and odd numbers to the right side.
Ice and defrost
Depending on temperature and weather conditions around the airplane, ice can form on the windows. The amount of ice is tracked as a ratio from 0..1 and available as an array dataref, index as per above
The pilot can turn on electric heating for each window (a real airplane might not have heat for every window, in which case there simply wouldn’t be switches for some of the dataref indices).
controls the electric switches, which will then consume the amps set in Plane Maker for
De-ice: window heat,
De-ice: window heat copilot,
De-ice: l side window heat and
De-ice: r side window heat respectively.
The heating elements can be failed by their respective bus, or the failure datarefs
X-Plane has two wiper speed controllers, acting on the left (even numbered) wipers and right (odd numbered wipers).
sim/cockpit2/switches/wiper_speed_switch int y enum 0=park, 1=25%speed,2=50%speed,3=100%speed
Wiper speed 0 is aliased to the old wiper_speed dataref for backward compatibility for the pilot windshield.
Four wipers can be defined in Plane Maker and assigned min and max deflection angles. If your aircraft has less than four wipers, simply assign the unnecessary wipers so that angle 1 == angle 2, in which case no movement will be generated.
sim/flightmodel2/misc/wiper_angle_deg float n degrees
tells you the deflection of each wiper and this dataref will be used to wipe the 3d rain off the windshield in the 3d cockpit as well.
Some business jets don’t have wipers, and instead rely on airflow alone to run the water off of specially coated windshields.
On the ground, a blower is used to generate an airflow over the windshield, to run off water when airspeed is insufficient to do so. In X-Plane, you can turn on two blowers for left and right side with the dataref
sim/cockpit2/switches/rain_repellent_switch int y boolean
This will use electric power to generate the airflow.