]> git.mxchange.org Git - flightgear.git/blob - docs-mini/README.introduction
0bdaaae8247443d7d20114f295dd3419e7718fbe
[flightgear.git] / docs-mini / README.introduction
1
2 Internals
3 ---------
4
5 The core of FlightGear is the property system. This is a tree like internal
6 representation of global variables. The property system is explained more
7 in detail later on.
8
9 FlightGear' way of doing things is breaking it up into small pieces. There is
10 (for example) animation code that reacts on property changes. There is also a
11 Flight Dynamics model (FDM) that (amongst other things) updates properties.
12 There is a menu system that can display and alter properties. Then we have
13 sound code that plays sound based on ... properties.
14
15 Maybe you see a pattern evolve by now.
16
17 All subsystems are almost self containing. Most of the time they only read the
18 values of some properties, and sometimes they alter other properties. This is
19 the basic way of communicating between subsystems.
20
21
22 Property System
23 ---------------
24
25 The property system is best described as an in-memory LDAP database which holds
26 the state of global variables. The system has a tree like hierarchy (like a
27 file system) and has a root node, sub nodes (like subdirectories) and end-nodes
28 (variables).
29
30 All variables are kept internally as raw values and can be converted to any
31 other supported type (boolean, int, float double and string).
32
33 Like a file system, every node can be accessed relative to the current node, or
34 absolute to the root node.
35
36 The property system also allows aliasing nodes to other nodes (like symbolic
37 linking files or directories to other files or directories) and may be assigned
38 read-only or read-write.
39
40 If necessary it would be possible for parts of the program to hold it's own
41 property tree, which is inaccessible from the global property tree, by keeping
42 track of it's own root-node.
43
44 Property I/O code allows one to easily read the tree from, or write the tree to
45 an XML file.
46
47
48 Scripting
49 ---------
50
51 The scripting langage Nasal can also read and modify properties but it can also
52 be incorporated into the menu system. The documentation for Nasal can be found
53 here:  http://www.plausible.org/nasal/flightgear.html
54