mirror planes detection needs work
[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         SceneNode *node;
18
19         FlatMirror *next;
20 };
21
22
23 class MetaScene {
24 public:
25         DataMap datamap;
26
27         std::vector<Scene*> scenes;
28
29         Mesh *walk_mesh;
30         Vec3 start_pos;
31         Quat start_rot;
32
33         std::map<Scene*, void*> scndata;
34
35         FlatMirror *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_