]> git.mxchange.org Git - simgear.git/blob - simgear/scene/model/model.hxx
MSVC fix.
[simgear.git] / simgear / scene / 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 #include <set>
15
16 SG_USING_STD(vector);
17 SG_USING_STD(set);
18
19 #include <plib/sg.h>
20 #include <plib/ssg.h>
21
22 #include <simgear/misc/sg_path.hxx>
23 #include <simgear/props/props.hxx>
24
25
26 // Has anyone done anything *really* stupid, like making min and max macros?
27 #ifdef min
28 #undef min
29 #endif
30 #ifdef max
31 #undef max
32 #endif
33
34
35 /**
36  * Load a 3D model with or without XML wrapper.  Note, this version
37  * Does not know about or load the panel/cockpit information.  Use the
38  * "model_panel.hxx" version if you want to load an aircraft
39  * (i.e. ownship) with a panel.
40  *
41  * If the path ends in ".xml", then it will be used as a property-
42  * list wrapper to add animations to the model.
43  *
44  * Subsystems should not normally invoke this function directly;
45  * instead, they should use the FGModelLoader declared in loader.hxx.
46  */
47 ssgBranch *
48 sgLoad3DModel( const string& fg_root, const string &path,
49                           SGPropertyNode *prop_root, double sim_time_sec,
50                           ssgEntity *(*load_panel)(SGPropertyNode *) = 0 );
51
52
53 /**
54  * Make an offset matrix from rotations and position offset.
55  */
56 void
57 sgMakeOffsetsMatrix( sgMat4 * result, double h_rot, double p_rot, double r_rot,
58                      double x_off, double y_off, double z_off );
59
60 /**
61  * Make the animation
62  */
63 void
64 sgMakeAnimation( ssgBranch * model,
65                  const char * name,
66                  vector<SGPropertyNode_ptr> &name_nodes,
67                  SGPropertyNode *prop_root,
68                  SGPropertyNode_ptr node,
69                  double sim_time_sec,
70                  SGPath &texture_path,
71                  set<ssgBranch *> &ignore_branches );
72
73 /**
74  * Set the filter state on models
75  */
76 bool
77 sgSetModelFilter( bool filter );
78
79 /**
80  * Enable or disable Display list usage
81  */
82 extern bool sgUseDisplayList;
83
84 #endif // __MODEL_HXX