diff --git a/Aircraft/Instruments-3d/computing-gun-sights/Nasal/lead-computer.nas b/Aircraft/Instruments-3d/computing-gun-sights/Nasal/lead-computer.nas index 3dc79586c..a38351caf 100644 --- a/Aircraft/Instruments-3d/computing-gun-sights/Nasal/lead-computer.nas +++ b/Aircraft/Instruments-3d/computing-gun-sights/Nasal/lead-computer.nas @@ -53,10 +53,11 @@ var harmonizationRange = 0; var range = 0; # constants -var timeStep = 0.1; +var timeStep = getprop(propertyTreeRoot, "timeStep"); # sight damping factor -var SIG = 0.4; +var SIG = getprop(propertyTreeRoot, "dampingFactor") * 0.4; + var KSIG = 1.0 / (1.0 + SIG); var seaLevelAirDensity = 0.00238; diff --git a/Aircraft/Instruments-3d/computing-gun-sights/README.K-14 b/Aircraft/Instruments-3d/computing-gun-sights/README.K-14 new file mode 100644 index 000000000..c01d7190f --- /dev/null +++ b/Aircraft/Instruments-3d/computing-gun-sights/README.K-14 @@ -0,0 +1,79 @@ +To enable full functionality of the K14 gun sight there are several things +that need to be done. + +First change the section of your *set.xml file so that it looks like the +following. + + + + + + Aircraft/Instruments-3d/computing-gun-sights/Nasal/lead-computer.nas + + + +Animation: + +For dark conditions when cabin/cockpit illumination is used all of the K14 sight +is illuminated in response to + +/controls/lighting/cabin-norm + +If you are using a different property for your cabin/cockpit lights you will need to map your +lighting property to /controls/lighting/cabin-norm. + +Aircraft Specific Properties: + +See README.lead-computer + +Below is an example from the P-51D using the K14A sight which needs some additional +settings to control power and lighting for the sight. + + + + + + + + 0 + + 3.125 + + 0.0 + + 1.0 + 0.00136354 + 2900.0 + + 900.0 + 0.2 + + 1.0 + 0 + 170 + 170 + + + + 0 + 1.0 + 1 + 0 + 1 + + + 30 + 0.0 + 1000.0 + + 0 + 0.7375 + 0 + + 1 + + ... + + + \ No newline at end of file diff --git a/Aircraft/Instruments-3d/computing-gun-sights/README.lead-computer b/Aircraft/Instruments-3d/computing-gun-sights/README.lead-computer new file mode 100644 index 000000000..bb800f18c --- /dev/null +++ b/Aircraft/Instruments-3d/computing-gun-sights/README.lead-computer @@ -0,0 +1,81 @@ +Lead Computer Configuration: + +The following properties will need to be set to configure the lead computer for your aircraft. + +These are set in the aircraft's *set.xml file in the section where you are setting initialization values +for various properties. This MUST happen before the nasal section in the *set.xml file. + +The following five values can be found in the submodels.xml configuration file where the guns +ballistics are configured. + +/controls/armament/gunsight/z-gunOffsetFeet = Gun position on z axis relative to the sight line in feet. + +Will = offset value + distance from aircraft center line to sight line height in feet. + +/controls/armament/gunsight/y-gunOffsetFeet = Gun position on y axis relative to the sight line in feet. + +Will = abs value if the guns are equally distributed about the aircraft center line +set this to 0. If this value in non-zero this is in feet. + +/controls/armament/gunsight/gunElevationDegrees = gun pitch setting in degrees. + +/controls/armament/gunsight/ballisticCoefficienct = xxxxx + +/controls/armament/gunsight/muzzleVelocity = xxxxx = In feet per second + +Additional parameters need to be set that are not in the submodels.xml file. + +/controls/armament/gunsight/gunHarminizationRangeFeet = Range where the sight and the bullet + path cross is straight and level flight in feet. + +/controls/armament/gunsight/timeStep = The computer cycle time in seconds. + +This will typically be values between 0.5 and 0.05. These correspond to +lead computer update frequencies of 2 to 20 times per second. Use a slower update +rate for older purely mechanical gun sights and faster rates for newer fully +digital gun sights. Slower rates will tend to make the gun sight lag. + +/controls/armament/gunsight/dampingFactor = The computer damping factor adjustment. + +The optimum dampingFactor is 1.0. Lower values will make the reticle less stable and +prone to over shoot and jitter. However using lower values may result in a more +accurate simulation of older mechanical gun sights which were under damped. Modern +gun sights will be well damped and for those this should be set to 1.0. This value is +capped by the lead computer and values above 1.0 will result in 1.0 being used and +values below 0.3 will result in 0.3 being used. + +/controls/armament/gunsight/MaxAzimuth and /controls/armament/gunsight/MaxElevation = The +maximum deflection of the sight reticle in mils. Used to limit the movement of the reticle +to the mechanical limits of sight being simulated. + +Lead Computer Input Values: + +/controls/armament/gunsight/range = The range to the target in feet. + +With radar ranging this value will be constantly changing. Internally the lead computer +also uses this data to calculate the rate at which the range changes (IE. how fast +the target is being closed in on). + +/controls/armament/gunsight/computer-on = 0 to turn the lead computer off and 1 to start the +lead computer. Cycling power will reinitialize the lead computer. + +Lead Computer Output: + +/controls/armament/gunsight/azimuth and /controls/armament/gunsight/elevation = Deflection +needed to hit the target in mils. 1 mil = 1 foot at a 1000 foot range. These values are +used to drive the sight reticle animation. This is usually done by applying these to a +factor that is then using the resulting product to move the reticle in the animation code. + +Including the Lead Computer in the Aircraft's Set File: + +For the lead computer to function it needs to be added to the aircrafts *set.xml file's nasal section. + +This will look something like this. + + + + + + Aircraft/Instruments-3d/computing-gun-sights/Nasal/lead-computer.nas + + \ No newline at end of file diff --git a/Aircraft/Instruments-3d/computing-gun-sights/README.txt b/Aircraft/Instruments-3d/computing-gun-sights/README.txt deleted file mode 100644 index 2f0cfec14..000000000 --- a/Aircraft/Instruments-3d/computing-gun-sights/README.txt +++ /dev/null @@ -1,64 +0,0 @@ -To enable full functionality of the K14 gun sight there are several things -that need to be done. - -First change the section of your *set.xml file so that it looks like the -following. - - - - - - Aircraft/Instruments-3d/computing-gun-sights/Nasal/lead-computer.nas - - - -Animation: - -For dark conditions when cabin/cockpit illumination is used all of the K14 sight -is illuminated in response to - -/controls/lighting/cabin-norm - -If you are using a different property for your cabin/cockpit lights you will need to map your -lighting property to /controls/lighting/cabin-norm. - -Aircraft Specific Properties: - -The following properties will need to be set to configure the site for an aircraft. - -The following five values can be found in the submodels.xnl configuration file. - -/controls/armament/gunsight/z-gunOffsetFeet = Gun position on z axis relative to the sight line in feet. - Will = offset value + distance from - aircraft center line to sight line height. -/controls/armament/gunsight/y-gunOffsetFeet = Gun position on y axis relative to the sight line in feet. - Will = abs value -/controls/armament/gunsight/gunElevationDegrees = gun pitch setting -/controls/armament/gunsight/ballisticCoefficienct = xxxxx -/controls/armament/gunsight/muzzleVelocity = xxxxx = In feet per second - -/controls/armament/gunsight/gunHarminizationRangeFeet = Range where the sight and the bullet - path cross is level flight in feet. - -Below is an example from the P-51D using the K14A sight which needs some additional -settings to control power and lighting for the sight. - - - - - 0 - 1.0 - -4.0 - 0.0 - 0.6 - 3.8 - 0.00136354 - 2900.0 - 900.0 - 900.0 - - - ... - - - \ No newline at end of file