projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
builds through mingw32 now. doesn't seem to run properly though
[laserbrain_demo]
/
src
/
scene.h
diff --git
a/src/scene.h
b/src/scene.h
index
ece454e
..
bd01dec
100644
(file)
--- a/
src/scene.h
+++ b/
src/scene.h
@@
-6,6
+6,8
@@
#include "mesh.h"
#include "snode.h"
#include "texture.h"
#include "mesh.h"
#include "snode.h"
#include "texture.h"
+#include "dataset.h"
+#include "datamap.h"
enum {
SCNLOAD_FLIPYZ = 1,
enum {
SCNLOAD_FLIPYZ = 1,
@@
-15,11
+17,13
@@
enum {
SCNLOAD_STAGE_GL = 0x8000
};
SCNLOAD_STAGE_GL = 0x8000
};
-class Scene {
-private:
- bool own_texset;
+class MetaScene;
+class Scene {
public:
public:
+ MetaScene *metascn;
+ DataMap datamap;
+
// meshes objects and nodes are owned by Scene
std::vector<Mesh*> meshes;
std::vector<Object*> objects;
// meshes objects and nodes are owned by Scene
std::vector<Mesh*> meshes;
std::vector<Object*> objects;
@@
-27,16
+31,17
@@
public:
Mesh *walk_mesh;
Mesh *walk_mesh;
- TextureSet *texset; // only owned by Scene if own_texset is true
+ TextureSet *texset;
void *loader_data;
void *loader_data;
- explicit Scene(TextureSet *tset = 0);
+ explicit Scene();
~Scene();
Scene(const Scene &rhs) = delete;
Scene &operator =(const Scene &rhs) = delete;
void destroy();
~Scene();
Scene(const Scene &rhs) = delete;
Scene &operator =(const Scene &rhs) = delete;
void destroy();
+ void clear(); // clear all contents (meshes, objects, and nodes)
bool load(const char *fname, unsigned int flags = 0);
bool load(const char *fname, unsigned int flags = 0);
@@
-55,6
+60,13
@@
public:
bool remove_node(SceneNode *n);
bool have_node(SceneNode *n) const;
bool remove_node(SceneNode *n);
bool have_node(SceneNode *n) const;
+ // find node by name
+ SceneNode *find_node(const char *name) const;
+ // match nodes with regexp and return the first that matches
+ SceneNode *match_node(const char *qstr) const;
+ // match nodes with regexp and return a list of matches
+ std::list<SceneNode*> match_nodes(const char *qstr) const;
+
/* find and remove all nodes whose names match the regexp
* XXX at the moment this has the effect of flattening the hierarchy in the
* result scene. If we ever need verbatim extraction of whole subtrees we'll
/* find and remove all nodes whose names match the regexp
* XXX at the moment this has the effect of flattening the hierarchy in the
* result scene. If we ever need verbatim extraction of whole subtrees we'll
@@
-72,4
+84,15
@@
public:
void draw() const;
};
void draw() const;
};
+class SceneSet : public DataSet<Scene*> {
+private:
+ static Scene *create_scene();
+ static bool load_scene(Scene *scn, const char *fname);
+ static bool done_scene(Scene *scn);
+ static void free_scene(Scene *scn);
+
+public:
+ SceneSet();
+};
+
#endif // SCENE_H_
#endif // SCENE_H_