home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 7 Games / 07-Games.zip / fly8112o.zip / flight.doc < prev    next >
Text File  |  1997-05-20  |  5KB  |  147 lines

  1. /* --------------------------------- flight.doc ----------------------------- */
  2.  
  3. /* This is part of the flight simulator 'fly8'.
  4.  * Author: Eyal Lebedinsky (eyal@eyal.emu.id.au).
  5. */
  6.  
  7.  
  8. The models
  9. ----------
  10.  
  11. Classic
  12.  
  13.    This one simulates a trivial motion model. It always moves in the
  14. direction it is pointing. It has no limits on G loading. It can fly
  15. equaly well underground (so you cannot land it). It is only useful for
  16. learning how the controls work
  17.  
  18.  
  19. Basic
  20.  
  21.    A basic simulation which includes some basic features only. It is
  22. more real than the 'classic' but cannot show any of the subtle effects.
  23.  
  24.  
  25. Xplane
  26.  
  27.    An experimental model which uses some more common derivatives. It is
  28. now obsolete and probably does not work.
  29.  
  30.  
  31. Yplane
  32.  
  33.    A model based on aerodynamic derivates. It is fast (still written in
  34. fixed point). Properly simulates many effects. Reallistic landing gear.
  35.  
  36.    This model will respond to the debug W switch by allowing untrimmed
  37. pitch moment. Normally the only pitch moment is the one from the
  38. elevators (and the corresponding damping).
  39.  
  40.  
  41. Fplane
  42.  
  43.    This model is actually two models in one. The first is identical to
  44. Yplane (derivatives) and the second simulates the actual aerodynamics
  45. phenonena. However, this model uses floating point and as such is much
  46. easier to work with.
  47.  
  48.    This model will respond to the debug W switch by allowing untrimmed
  49. pitch moment. Normally the only pitch moment is the one from the
  50. elevators (and the corresponding damping).
  51.  
  52.    If you set the debug Z switch then the fundamental model will be
  53. used, otherwize the derivative based model is used; this is useful for
  54. comparing the two models.
  55.  
  56.    If you set the debug Y switch then the 'yplane' model will be
  57. activated instead; this is useful for comparing the two models (if the Z
  58. option is turned off!).
  59.  
  60.  
  61. Adding a new model
  62. ------------------
  63.  
  64. As an example, suppose we want to work on a new model based on the
  65. fundamental model of fplane. Let's call this one the zplane model. We
  66. copy fplane.c to zplane.c and rename the entry point from
  67. dynamics_fplane() to dynamics_zplane(). Now we remove the part which
  68. does the derivative based model and remove the dependency on the debug Y
  69. and W switches.  We now have the new model.
  70.  
  71. We add the new model to prm.c. This includes the prototype and the entry
  72. in the table initializers list which follows. You must add the new model
  73. at the end of the list.
  74.  
  75. Now we add the new module to the makefile; just search for one of the
  76. other modules (say 'ofplane') and do the same thing for 'ozplane'.
  77.  
  78. If we really want to do a clean job then we want to also define a
  79. manifest constant for the new model. To plane.h we add something like
  80.  
  81. #define MODEL_ZPLANE    5
  82.  
  83. at the same place where the other models are defined. Note that the
  84. number here is the index into the models table in prm.c. Modifying
  85. plane.h will cause many modules to be recompiled.
  86.  
  87. Finally, for neatness, we create a new parameter file which we will
  88. modify as the model is developed. In the /parms directory we copy
  89. f16.prc to zplane.prc. We add zplane.prm to the makefile and then (at
  90. the top level) we do 'make parm'. Then we copy the new zplane.prm to the
  91. install directory and change the fly.ini there to default to the new
  92. model using the parameter 'Pzplane'.
  93.  
  94.  
  95. Adding a new parameter
  96. ----------------------
  97.  
  98. First we decide on the type (short, fraction, angle or long) and make
  99. a clear comment about it. Also note the units to be used.
  100.  
  101. We now need to add the new parameter to the following:
  102.  
  103. plane.h:
  104.    This declares the new parameter.
  105.  
  106. prm.c:
  107.    This reads the new parameter. The parameter MUST be added in the
  108. correct position that will be used in the *.prc file (it has nothing to
  109. do with the order in plane.h but we keep everything in the same order
  110. for easier maintenance).
  111.  
  112. parms/*.prc:
  113.    Here we supply the new value. We make sure that the a new parameter
  114. is added to ALL the *.prc files, otherwise they will not be read
  115. correctly.
  116.  
  117. Finally, use the new parameter in the your model. Note how the program
  118. handles the fixed point data, just follow the exmaples of other
  119. parameters for converting the input values to floating point.
  120.  
  121. Now, at the top level, we do 'make fly parm install'. Note that if we
  122. changed any files in the install directory then these will be
  123. overwritten, so make sure you keep a copy of these (like the *.ini and
  124. *.vmd and *.max) files elsewhere to be restored.
  125.  
  126.  
  127. General notes
  128. -------------
  129.  
  130. Fly8 uses the following conventions for the axes:
  131.  
  132. X    right
  133. Y    forward
  134. Z    upward
  135. aX    pitch (up)
  136. aY    roll (clockwise)
  137. aZ    yaw (left)
  138.  
  139. This is different from the standard aerodynamic conventions where X and
  140. Y are swapped and Z is the oppsite sign. In the fplane model the fly8
  141. values are converted to local variables which conform to the common
  142. standard so one may ignore this problem there.
  143.  
  144. If you have questions about any other aspect of the program then I can
  145. be contacted as eyal@eyal.emu.id.au; I will be interested in adding
  146. new material to the program if you care to contribute it.
  147.