]> git.tdb.fi Git - libs/gl.git/blobdiff - source/scene.h
Remove the culler abstraction and move frustum culling to Scene
[libs/gl.git] / source / scene.h
index 687c581fe5d4070c27d6e62819be4a3f8bff48aa..611f3508e2d7e103a592787aa5e08ea75f0f1625 100644 (file)
@@ -4,12 +4,11 @@
 #include <list>
 #include <msp/datafile/objectloader.h>
 #include "renderable.h"
+#include "vector.h"
 
 namespace Msp {
 namespace GL {
 
-class Culler;
-
 /**
 Scenes are containers for other Renderables.  This is a base class that can't
 be instantiated.  Examples of available Scene types are SimpleScene,
@@ -29,7 +28,7 @@ public:
 
 protected:
        std::list<Renderable *> owned_data;
-       std::list<Culler *> cullers;
+       mutable Vector3 frustum_edges[4];
 
        Scene() { }
 private:
@@ -41,15 +40,12 @@ public:
        virtual void add(const Renderable &) = 0;
        virtual void remove(const Renderable &) = 0;
 
-       void add_culler(Culler &);
-       void remove_culler(Culler &);
-
        using Renderable::render;
        virtual void render(const Tag & = Tag()) const;
 
 protected:
-       virtual void setup_cullers(const Renderer &) const;
-       virtual bool cull(const Renderer &, const Renderable &) const;
+       void setup_frustum(const Renderer &) const;
+       bool frustum_cull(const Renderer &, const Renderable &) const;
 };
 
 } // namespace GL