16 SCNLOAD_STAGE_IO = 0x4000,
17 SCNLOAD_STAGE_GL = 0x8000
27 // meshes objects and nodes are owned by Scene
28 std::vector<Mesh*> meshes;
29 std::vector<Object*> objects;
34 TextureSet *texset; // only owned by Scene if own_texset is true
40 Scene(const Scene &rhs) = delete;
41 Scene &operator =(const Scene &rhs) = delete;
45 bool load(const char *fname, unsigned int flags = 0);
47 // merge scn into this scene, leaving scn empty and safe to destroy
48 bool merge(Scene *scn);
50 void add_object(Object *obj);
51 bool remove_object(Object *obj);
52 bool have_object(Object *obj) const;
54 void add_mesh(Mesh *m);
55 bool remove_mesh(Mesh *m);
56 bool have_mesh(Mesh *m) const;
58 void add_node(SceneNode *n);
59 bool remove_node(SceneNode *n);
60 bool have_node(SceneNode *n) const;
62 /* find and remove all nodes whose names match the regexp
63 * XXX at the moment this has the effect of flattening the hierarchy in the
64 * result scene. If we ever need verbatim extraction of whole subtrees we'll
65 * need to change the algorithm.
67 Scene *extract_nodes(const char *qstr);
69 /* bake all node transformations to their respective meshes and make the
70 * node transformations identity.
71 * XXX this assumes no mesh is shared by two nodes.
75 void update(float dt);
79 class SceneSet : public DataSet<Scene*> {
81 static Scene *create_scene();
82 static bool load_scene(Scene *scn, const char *fname);
83 static bool done_scene(Scene *scn);
84 static void free_scene(Scene *scn);