14 SCNLOAD_STAGE_IO = 0x4000,
15 SCNLOAD_STAGE_GL = 0x8000
23 // meshes objects and nodes are owned by Scene
24 std::vector<Mesh*> meshes;
25 std::vector<Object*> objects;
30 TextureSet *texset; // only owned by Scene if own_texset is true
33 explicit Scene(TextureSet *tset = 0);
36 Scene(const Scene &rhs) = delete;
37 Scene &operator =(const Scene &rhs) = delete;
41 bool load(const char *fname, unsigned int flags = 0);
43 // merge scn into this scene, leaving scn empty and safe to destroy
44 bool merge(Scene *scn);
46 void add_object(Object *obj);
47 bool remove_object(Object *obj);
48 bool have_object(Object *obj) const;
50 void add_mesh(Mesh *m);
51 bool remove_mesh(Mesh *m);
52 bool have_mesh(Mesh *m) const;
54 void add_node(SceneNode *n);
55 bool remove_node(SceneNode *n);
56 bool have_node(SceneNode *n) const;
58 /* find and remove all nodes whose names match the regexp
59 * XXX at the moment this has the effect of flattening the hierarchy in the
60 * result scene. If we ever need verbatim extraction of whole subtrees we'll
61 * need to change the algorithm.
63 Scene *extract_nodes(const char *qstr);
65 /* bake all node transformations to their respective meshes and make the
66 * node transformations identity.
67 * XXX this assumes no mesh is shared by two nodes.
71 void update(float dt);