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