]> git.mxchange.org Git - flightgear.git/blob - src/Model/model.hxx
Working at unraveling and breaking dependencies inside of src/Model.
[flightgear.git] / src / Model / model.hxx
1 // model.hxx - manage a 3D aircraft model.
2 // Written by David Megginson, started 2002.
3 //
4 // This file is in the Public Domain, and comes with no warranty.
5
6 #ifndef __MODEL_HXX
7 #define __MODEL_HXX 1
8
9 #ifndef __cplusplus
10 # error This library requires C++
11 #endif
12
13 #include <vector>
14
15 SG_USING_STD(vector);
16
17 #include <plib/sg.h>
18 #include <plib/ssg.h>
19
20 #include <simgear/props/props.hxx>
21
22
23 // Has anyone done anything *really* stupid, like making min and max macros?
24 #ifdef min
25 #undef min
26 #endif
27 #ifdef max
28 #undef max
29 #endif
30
31
32 /**
33  * Load a 3D model with or without XML wrapper.  Note, this version
34  * Does not know about or load the panel/cockpit information.  Use the
35  * "model_panel.hxx" version if you want to load an aircraft
36  * (i.e. ownship) with a panel.
37  *
38  * If the path ends in ".xml", then it will be used as a property-
39  * list wrapper to add animations to the model.
40  *
41  * Subsystems should not normally invoke this function directly;
42  * instead, they should use the FGModelLoader declared in loader.hxx.
43  */
44 ssgBranch * fgLoad3DModel( const string& fg_root, const string &path,
45                            SGPropertyNode *prop_root, double sim_time_sec );
46
47
48 /**
49  * Make an offset matrix from rotations and position offset.
50  */
51 void
52 fgMakeOffsetsMatrix( sgMat4 * result, double h_rot, double p_rot, double r_rot,
53                      double x_off, double y_off, double z_off );
54
55 /**
56  * Make the animation
57  */
58 void
59 fgMakeAnimation( ssgBranch * model,
60                  const char * name,
61                  vector<SGPropertyNode_ptr> &name_nodes,
62                  SGPropertyNode *prop_root,
63                  SGPropertyNode_ptr node,
64                  double sim_time_sec );
65
66
67 #endif // __MODEL_HXX