X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Fscene.h;h=692dcd0dfc6c7ebf88e0e8c7f0b26d7c0aae4b33;hb=9e63512930bc7dace6dc169c65161961e5dcfcf6;hp=e55de1a84323529dfe4300c6ebec210d52c8664e;hpb=9813f8711628a0fbe786406e974dc33546dc9cee;p=libs%2Fgl.git diff --git a/source/render/scene.h b/source/render/scene.h index e55de1a8..692dcd0d 100644 --- a/source/render/scene.h +++ b/source/render/scene.h @@ -11,9 +11,15 @@ namespace Msp { namespace GL { /** -Scenes are containers for other Renderables. This is a base class that can't -be instantiated. Examples of available Scene types are SimpleScene, -InstancedScene and OrderedScene. +Container for other renderables. Subclasses provide different ways of +rendering the contents. + +All types of Scenes perform frustum culling on the contents, skipping +renderables whose bounding sphere is fully outside the view volume. If a +bounding sphere cannot be determined, culling is not performed on that +renderable. + +SimpleScene is a good default choice if there are no specific requirements. */ class Scene: public Renderable { @@ -25,7 +31,8 @@ protected: private: ContentMap *content; - unsigned inst_counter; + + static unsigned inline_counter; public: Loader(Scene &s, Collection &c): Loader(s, c, 0) { } @@ -36,6 +43,7 @@ protected: void object(const std::string &); void object_tagged(const std::string &, const std::string &); void scene(const std::string &); + void scene_inline(); }; public: @@ -54,12 +62,12 @@ protected: mutable Matrix culling_matrix; mutable Vector4 frustum_edges[6]; - Scene() { } + Scene() = default; private: Scene(const Scene &); Scene &operator=(const Scene &); public: - virtual ~Scene() { } + virtual ~Scene() = default; virtual void add(Renderable &) = 0; virtual void remove(Renderable &) = 0;