X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fscene.h;h=bd01dec3f2ea799b3e6eaf5a780df77e3a2a2a2c;hb=2c648dbdf80ad77015e3283beb028cd389c2d2fa;hp=b9e338ba8397ebd2f002ff240da4ac38e945c5e8;hpb=b30241a8a51be904b22459a1d0cc3322e0a505d9;p=laserbrain_demo diff --git a/src/scene.h b/src/scene.h index b9e338b..bd01dec 100644 --- a/src/scene.h +++ b/src/scene.h @@ -20,9 +20,6 @@ enum { class MetaScene; class Scene { -private: - bool own_texset; - public: MetaScene *metascn; DataMap datamap; @@ -34,16 +31,17 @@ public: Mesh *walk_mesh; - TextureSet *texset; // only owned by Scene if own_texset is true + TextureSet *texset; void *loader_data; - explicit Scene(TextureSet *tset = 0); + explicit Scene(); ~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); @@ -62,6 +60,13 @@ public: 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 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