User Tools

Site Tools


aircraft:tmd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
aircraft:tmd [2019/07/07 17:22] – [DynamicObjects] jhaircraft:tmd [2019/07/21 15:22] jh
Line 10: Line 10:
  
 ===== Purpose ===== ===== Purpose =====
 +
 The TMD-file contains the main definition of an aircraft. It describes the aircraft as a collection of objects that can have different attributes and connections to each other in an object-oriented approach. Among the objects that can be defined in a tmd file are engines, propellers, wings, airfoils, wheels, actuators, logic circuits, rigidbodies, joints, sound sources, instruments, autopilot, navigation receivers and many general purpose objects like integrals and mathematical functions. The TMD-file contains the main definition of an aircraft. It describes the aircraft as a collection of objects that can have different attributes and connections to each other in an object-oriented approach. Among the objects that can be defined in a tmd file are engines, propellers, wings, airfoils, wheels, actuators, logic circuits, rigidbodies, joints, sound sources, instruments, autopilot, navigation receivers and many general purpose objects like integrals and mathematical functions.
  
 ===== Sections ===== ===== Sections =====
 +
 The TMD file consist of three sections: The TMD file consist of three sections:
   * [[#DynamicObjects]]   * [[#DynamicObjects]]
Line 37: Line 39:
  
 ==== DynamicObjects ==== ==== DynamicObjects ====
 +
 The dynamics section defines all objects that create the dynamics and systems simulation for an aircraft. Physical values, such as the location of the aircraft, it's speed and orientation as well as the deflection of it's control surfaces, the rotation speed of engines or [[aircraft:tmd:propeller|propellers]], electrical loads, fuel consumption, system states and numerous other values are calculated numerically by Aerofly FS 2's physics engine. The dynamics section defines all objects that create the dynamics and systems simulation for an aircraft. Physical values, such as the location of the aircraft, it's speed and orientation as well as the deflection of it's control surfaces, the rotation speed of engines or [[aircraft:tmd:propeller|propellers]], electrical loads, fuel consumption, system states and numerous other values are calculated numerically by Aerofly FS 2's physics engine.
  
-The core of each aircraft in the Aerofly flight simulator is a [[aircraft:tmd:rigidbody|rigidbody]] simulation. Each body has its own mass, position, velocity, orientation and angular velocity. Forces like gravity, [[aircraft:tmd:aerowing|aerodynamic forces]], [[aircraft:tmd:propulsion|engine]] or [[aircraft:tmd:propeller|propeller]] thrust and torque, [[aircraft:tmd:collision|collisions]] with the ground are computed and applied to the body. [[aircraft:tmd:rigidbody|Joints]] connect different bodies and apply forces and torques to the bodies. In the tmd code the rigidbody system definition is usually positioned at the very beginning of the file. Further down in the dynamics section the aerodynamic properties ([[aircraft:tmd:aerodynamics|aerowings]], [[aircraft:tmd:airfoil|airfoils]]) of the aircraft are defined, followed by the [[aircraft:tmd:actuator|primary flight control]] deflections and more advanced aircraft systems like [[aircraft:tmd:electrics|electrics]] or [[aircraft:tmd:fuel|fuel systems]]. Simulated [[tmd:instruments|instruments]] like the attitude indicators, airspeed indicators and altimeters complement the tmd dynamics section.+The core of each aircraft in the Aerofly flight simulator is a [[aircraft:tmd:rigidbody|rigidbody]] simulation. Each body has its own mass, position, velocity, orientation and angular velocity. Forces like gravity, [[aircraft:tmd:aerowing|aerodynamic forces]], [[aircraft:tmd:propulsion|engine]] or [[aircraft:tmd:propeller|propeller]] thrust and torque, [[aircraft:tmd:collision|collisions]] with the ground are computed and applied to the body. [[aircraft:tmd:rigidbody|Joints]] connect different bodies and apply forces and torques to the bodies. In the tmd code the rigidbody system definition is usually positioned at the very beginning of the file. Further down in the dynamics section the aerodynamic properties ([[aircraft:tmd:aerodynamics|aerowings]], [[aircraft:tmd:airfoil|airfoils]]) of the aircraft are defined, followed by the more advanced aircraft systems like [[aircraft:tmd:electrical|electrical]][[aircraft:tmd:hydraulic|hydraulic]] or [[aircraft:tmd:fuel|fuel systems]]. Simulated [[aircraft:tmd:instruments|instruments]] like the attitude indicators, airspeed indicators and altimeters are towards the end tmd dynamics section.
  
 The objects defined in the graphics and sound section use the output generated by the dynamics simulation to render the 3D objects and animations. Therefore it is necessary to hand over the required values to the graphics and sound using an output object. This includes the position of all control surfaces and primary flight controls as well as values that are visible on any display in the cockpit. An example can be found below. The objects defined in the graphics and sound section use the output generated by the dynamics simulation to render the 3D objects and animations. Therefore it is necessary to hand over the required values to the graphics and sound using an output object. This includes the position of all control surfaces and primary flight controls as well as values that are visible on any display in the cockpit. An example can be found below.
Line 49: Line 52:
   * [[aircraft:tmd:actuators   |Actuators]]   * [[aircraft:tmd:actuators   |Actuators]]
   * [[aircraft:tmd:propulsion  |Propulsion]]   * [[aircraft:tmd:propulsion  |Propulsion]]
 +  * [[aircraft:tmd:instruments |Instrumentation]]
   * [[aircraft:tmd:inputs      |Inputs (buttons, switches and knobs, flight controls, digital inputs)]]   * [[aircraft:tmd:inputs      |Inputs (buttons, switches and knobs, flight controls, digital inputs)]]
 +  * [[aircraft:tmd:logic       |Math and Logic Circuits]]
   * [[aircraft:tmd:events      |Event Based Programming]]   * [[aircraft:tmd:events      |Event Based Programming]]
-  * [[aircraft:tmd:electrics   |Electrical Systems]]+  * [[aircraft:tmd:electrical  |Electrical Systems]]
   * [[aircraft:tmd:fuel        |Fuel Systems]]   * [[aircraft:tmd:fuel        |Fuel Systems]]
-  * [[aircraft:tmd:instruments |Instrumentation]]+  * [[aircraft:tmd:hydraulic   |Hydraulic Systems]] 
 +  * [[aircraft:tmd:autopilot   |Autopilot and Flight Management]]
  
  
Line 75: Line 81:
  
 The rendering engine itself can't directly access the user's control inputs or simulate the position of slow moving actuators; this is what the physics engine does. Every animation, therefore, needs to get their inputs from the dynamics section where all the physical movements or delays can be simulated. To send a value from the dynamics section to the graphics section the dynamics section needs to define an 'output' object as described above and the graphics section needs to have a [[aircraft:tmd:graphics_input|graphics_input]] object whose InputID matches the 'Name' property of the output followed by the text '.Output'. The rendering engine itself can't directly access the user's control inputs or simulate the position of slow moving actuators; this is what the physics engine does. Every animation, therefore, needs to get their inputs from the dynamics section where all the physical movements or delays can be simulated. To send a value from the dynamics section to the graphics section the dynamics section needs to define an 'output' object as described above and the graphics section needs to have a [[aircraft:tmd:graphics_input|graphics_input]] object whose InputID matches the 'Name' property of the output followed by the text '.Output'.
 +
 +Collection of the pages relevant to the GraphicObjects section:
 +  * [[aircraft:tmd:inputs              |Animation of buttons, switches and knobs]]
 +  * [[aircraft:tmd:rigidbodygraphics   |Rigidbodygraphics, transformations and bendingbodygraphics]]
 +  * [[aircraft:tmd:lighting            |Interieur lighting and external lights]]
 +  * [[aircraft:tmd:displays            |Numerical Displays, LCDs, flight displays, HUDs]]
 +  * [[aircraft:tmd:humangraphics       |Human character]]
 +
  
 ==== SoundObjects ==== ==== SoundObjects ====
Line 82: Line 96:
 Similar to the graphics section a [[aircraft:tmd:soundinput|soundinput]] object will read the value of a dynamics [[aircraft:tmd:output|output]] object and provide its value for the entire sound section. Similar to the graphics section a [[aircraft:tmd:soundinput|soundinput]] object will read the value of a dynamics [[aircraft:tmd:output|output]] object and provide its value for the entire sound section.
  
 +Most relevant pages
 +  * [[aircraft:tmd:inputs      |Button, switch and knob sounds triggered in DynamicObjects]]
 +  * [[aircraft:tmd:sound       |Sound input, mixing, mapping, fading, etc.]]
  
-===== Object unique names =====+===== Object Unique Names =====
 Each object in a section must have a unique name by which it can be referenced. Using a name for more than one object in a section can have undesired effects. Each object in a section must have a unique name by which it can be referenced. Using a name for more than one object in a section can have undesired effects.
  
-===== Naming Conventions =====+===== Object Naming Conventions =====
 We use naming rules and give similar objects the same names across different airplanes: We use naming rules and give similar objects the same names across different airplanes:
   *The name of an object uses the characters A-Z, a-z, 0-9 only and the first character of the name is always capitalized.     *The name of an object uses the characters A-Z, a-z, 0-9 only and the first character of the name is always capitalized.  
Line 95: Line 112:
   *Abbreviations are avoided, the full name is always preferred.     *Abbreviations are avoided, the full name is always preferred.  
  
-===== Object structure =====+===== Object Structure ===== 
 The example code below creates an object of the class 'control_input' with the name 'ThrottleLever' in the dynamics section when the simulator loads the aircraft. During runtime, this object will filter out messages with the name 'Controls.Throttle1' which are typically sent by the control device assigned to the left throttle input in the 'Controls Settings' user interface. The control_input object will store the value of the latest message in memory for later use by other objects. The example code below creates an object of the class 'control_input' with the name 'ThrottleLever' in the dynamics section when the simulator loads the aircraft. During runtime, this object will filter out messages with the name 'Controls.Throttle1' which are typically sent by the control device assigned to the left throttle input in the 'Controls Settings' user interface. The control_input object will store the value of the latest message in memory for later use by other objects.
  
Line 115: Line 133:
 </code> </code>
  
-===== Object communication within section =====+===== Communication Within Section ===== 
 Most objects in the tmd file need to communicate in some form. For example, a jet_engine object needs to know the throttle lever position so that it can calculate the thrust increase or decrease over time and apply a variable strength force to the 'Fuselage' to accelerate it. In the tmd code snipped below, the developer defined that the engine should use the output of the ThrottleLever object as its ThrottleControl input. It would also be possible to use the autothrottle output as an example or any other imaginable output from an instrument reading or an output of a logic circuit if that is desired. Most objects in the tmd file need to communicate in some form. For example, a jet_engine object needs to know the throttle lever position so that it can calculate the thrust increase or decrease over time and apply a variable strength force to the 'Fuselage' to accelerate it. In the tmd code snipped below, the developer defined that the engine should use the output of the ThrottleLever object as its ThrottleControl input. It would also be possible to use the autothrottle output as an example or any other imaginable output from an instrument reading or an output of a logic circuit if that is desired.
  
Line 133: Line 152:
 These manually programmed connections allow enormous flexibility, easy debugging and incredibly simple and fast object code. Each object can be as 'stupid' as can be, it just uses its inputs, does something with it and sets its output value or internal state if it has one. Then, if another object comes by and wants to know the output value, it just grabs it and calculates its outputs with that. This way very long chains, logic trees or even iterations and control loops can be created that actually perform different logic depending on the aircraft's state or the user's inputs. It's important to note that the order in which the objects appear in the tmd code has no effect on the simulation. These manually programmed connections allow enormous flexibility, easy debugging and incredibly simple and fast object code. Each object can be as 'stupid' as can be, it just uses its inputs, does something with it and sets its output value or internal state if it has one. Then, if another object comes by and wants to know the output value, it just grabs it and calculates its outputs with that. This way very long chains, logic trees or even iterations and control loops can be created that actually perform different logic depending on the aircraft's state or the user's inputs. It's important to note that the order in which the objects appear in the tmd code has no effect on the simulation.
  
-===== Object communication across sections =====+===== Communication Across Sections ===== 
 Objects defined in different sections of the tmd cannot communicate directly. The only possible connections are from the dynamics section to the graphics section and from the dynamics section to the sound section. Objects defined in different sections of the tmd cannot communicate directly. The only possible connections are from the dynamics section to the graphics section and from the dynamics section to the sound section.
  
Line 140: Line 160:
 One way to imagine the communication between the sections is that each value from the dynamics section is sent through a wire to either the graphics processing unit or the sound processing devices. One way to imagine the communication between the sections is that each value from the dynamics section is sent through a wire to either the graphics processing unit or the sound processing devices.
  
-==== Example dynamics to graphics section ====+==== Example Dynamics to Graphics Section ==== 
 In the example below the position of the throttle lever input is put out by the dynamics section and then in the graphics section the value is read in. We usually give the 'graphics_input' object the same name as the 'output' from the dynamics section to avoid confusion. In the example below the position of the throttle lever input is put out by the dynamics section and then in the graphics section the value is read in. We usually give the 'graphics_input' object the same name as the 'output' from the dynamics section to avoid confusion.
  
Line 186: Line 207:
  
 ==== Summary ==== ==== Summary ====
 +
   - The 'control_input' object in the dynamics section reads the position of the user's control input device and makes this value available in the entire dynamics section as 'ThrottleLever.Output'.     - The 'control_input' object in the dynamics section reads the position of the user's control input device and makes this value available in the entire dynamics section as 'ThrottleLever.Output'.  
   - An 'output' object with the name 'ThrottleLeverPosition' is declared in the dynamics section which makes its input value also available for 'graphics_input' and 'soundinput' objects in the graphics and sound section respectively.     - An 'output' object with the name 'ThrottleLeverPosition' is declared in the dynamics section which makes its input value also available for 'graphics_input' and 'soundinput' objects in the graphics and sound section respectively.  
aircraft/tmd.txt · Last modified: 2022/07/19 21:14 by jh