You should copy ACflyt.js to an accessible location - generally the js directory. In your program, you should reference ACflyt.js at the beginning of your program - in the same place where you reference the three.js program, e.g.:
js/three.min.js
* * *
js/controls/PointerLockControls.mod.js
js/AC.dataUS.Pup.txt
js/ACflyt.js
Note that the ACflyt.js is preceded by a couple of files. You include the PointerLockControls.mod.js if you want to enable unlimited mouse scrolling on your PC. This is not necessary if the program is to be used on a touchscreen computer.
The AC.dataUS.Pup.txt is the Aircraft Data File for your particular aircraft - in this case, a Sopwith Pup in US units. This is an editable text file which contains values for variables that ACflyt uses to compute rotation and vectors. You can specify whether you are using US units or SI units and input values accordingly.
The Thrust computation is different than the Thrust computation for Jet Aircraft. If your aircraft is a jet aircraft, you will want to enter the following values in the Aircraft Data File:
In your program, you will want to enter a value for PowPct (the percentage of primary power) and SupPct (the percentage of supplemental power). The values range from 0 to 1. ACflyt will multiply PowMax by PowPct and WEPMax by SupPct.
The Thrust computation is different than the Thrust computation for Jet Aircraft. If your aircraft is a jet aircraft, you will want to enter the following values in the Aircraft Data File:
In your program, you will want to enter a value for PowPct (the percentage of primary power) and SupPct (the percentage of supplemental power). The values range from 0 to 1. ACflyt will multiply JetMax by PowPct and AftMax by SupPct.
In the main body of your program, you will call the following routines:
where Obj is address of your aircraft object.
You will designate the initial speed, altitude and rotation of the aircraft in the Aircraft Data File.
Thereafter, the primary inputs that you will input to ACflyt are:
To make sure that your aircraft properly rotates on the landing gear, you want to add the following information in the Aircraft Data File:
In the case of a taildragger, this will allow you to correctly rotate up on your main wheels as the tail leaves the ground. In the case of a tricycle aircraft, this will allow you to correctly rotate back on your main wheels.
A taildragger is different because the tail of the aircraft drops as speed drops. If your aircraft is a taildragger, you should add the following information in the Aircraft Data File:
Flaps generate both extra lift and drag as they are extended. If your aircraft has flaps, you should add the following information in the Aircraft Data File:
In your program, you will want to enter a value for FlpPct which reflects the percentage by which the flaps are extended. The value ranges from 0 to 1. ACflyt will multiply both DrgCdf and FlpCfL by FlpPct.
Retractable landing gear generate extra drag as they are extended. If your aircraft has retractable landing gear, you should add the following information in the Aircraft Data File:
In your program, you will want to enter a value for LngPct which reflects the percentage by which the gear is extended. The value ranges from 0 to 1. ACflyt will multiply DrgCdg by LngPct.
Airbrakes generate extra drag as they are extended. If your aircraft has airbrakes, you should add the following information in the Aircraft Data File:
In your program, you will want to enter a value for BrkPct which reflects the percentage by which the airbrakes are extended. The value ranges from 0 to 1. ACflyt will multiply DrgCdb by BrkPct.
Spoilers reduce lift and generate extra drag as they are extended. If your aircraft has spoilers, you should add the following information in the Aircraft Data File:
In your program, you will want to enter a value for SplPct which reflects the percentage by which the spoilers are extended. The value ranges from 0 to 1. ACflyt will multiply both DrgCds and SplCfL by SplPct.