15 SCNLOAD_STAGE_IO = 0x4000,
16 SCNLOAD_STAGE_GL = 0x8000
24 // meshes objects and nodes are owned by Scene
25 std::vector<Mesh*> meshes;
26 std::vector<Object*> objects;
31 TextureSet *texset; // only owned by Scene if own_texset is true
34 explicit Scene(TextureSet *tset = 0);
37 Scene(const Scene &rhs) = delete;
38 Scene &operator =(const Scene &rhs) = delete;
42 bool load(const char *fname, unsigned int flags = 0);
44 // merge scn into this scene, leaving scn empty and safe to destroy
45 bool merge(Scene *scn);
47 void add_object(Object *obj);
48 bool remove_object(Object *obj);
49 bool have_object(Object *obj) const;
51 void add_mesh(Mesh *m);
52 bool remove_mesh(Mesh *m);
53 bool have_mesh(Mesh *m) const;
55 void add_node(SceneNode *n);
56 bool remove_node(SceneNode *n);
57 bool have_node(SceneNode *n) const;
59 /* find and remove all nodes whose names match the regexp
60 * XXX at the moment this has the effect of flattening the hierarchy in the
61 * result scene. If we ever need verbatim extraction of whole subtrees we'll
62 * need to change the algorithm.
64 Scene *extract_nodes(const char *qstr);
66 /* bake all node transformations to their respective meshes and make the
67 * node transformations identity.
68 * XXX this assumes no mesh is shared by two nodes.
72 void update(float dt);
77 class SceneSet : public DataSet<Scene*> {
79 static Scene *create_scene();
80 static bool load_scene(Scene *scn, const char *fname);
81 static bool done_scene(Scene *scn);
82 static void free_scene(Scene *scn);