0417c00d0b97041e18b072a7f8983410721f3c50
[laserbrain_demo] / src / metascene.h
1 #ifndef METASCENE_H_
2 #define METASCENE_H_
3
4 #include <vector>
5 #include <map>
6 #include "scene.h"
7 #include "mesh.h"
8 #include "geom.h"
9 #include "audio/ovstream.h"
10 #include "datamap.h"
11
12
13 struct FlatMirror {
14         Plane plane;
15         float reflect;
16         //std::vector<Object*> objects;
17
18         FlatMirror *next;
19 };
20
21
22 class MetaScene {
23 public:
24         DataMap datamap;
25
26         std::vector<Scene*> scenes;
27
28         Mesh *walk_mesh;
29         Vec3 start_pos;
30         Quat start_rot;
31
32         std::map<Scene*, void*> scndata;
33
34         FlatMirror *mirrors;
35         int num_mirrors;
36         std::map<Object*, FlatMirror*> objmirror;
37
38         AudioStream *music;
39
40         MetaScene();
41         ~MetaScene();
42
43         bool load(const char *fname);
44         bool scene_loaded(Scene *scn);
45
46         void update(float dt);
47         void draw() const;
48
49         /* helper functions which end up calling the corresponding Scene functions
50          * for every scene
51          */
52         SceneNode *find_node(const char *name) const;
53         SceneNode *match_node(const char *qstr) const;
54         std::list<SceneNode*> match_nodes(const char *qstr) const;
55
56         Scene *extract_nodes(const char *qstr);
57
58         int calc_mirror_planes();
59 };
60
61 #endif  // METASCENE_H_