]> git.tdb.fi Git - libs/gl.git/blobdiff - source/object.h
Add a speed parameter for animation playback
[libs/gl.git] / source / object.h
index 192cf069bd8f4c8bf1b8a9ca801f5682e7fe4876..c8e372601077c1b1e9c43dd82a221b53b1a904a7 100644 (file)
@@ -5,7 +5,7 @@
 #include "bindable.h"
 #include "renderable.h"
 #include "renderpass.h"
-#include "resourcewatcher.h"
+#include "resourceobserver.h"
 
 namespace Msp {
 namespace GL {
@@ -28,7 +28,7 @@ Objects can have multiple levels of detail.  The most detailed level has index
 0, with increasing indices having less detail.  When rendering an instance, the
 instance's get_level_of_detail method is called to determine which LoD to use.
 */
-class Object: public Renderable, private ResourceWatcher
+class Object: public Renderable, private ResourceObserver
 {
 private:
        struct LevelOfDetail;
@@ -59,6 +59,7 @@ public:
                void init();
                virtual void finish();
 
+               void bounding_sphere_hint(float, float, float, float);
                void level_of_detail(unsigned);
        };
 
@@ -71,6 +72,7 @@ private:
 
        std::vector<LevelOfDetail> lods;
        Geometry::BoundingSphere<float, 3> bounding_sphere;
+       bool lod0_watched;
 
 public:
        Object();
@@ -105,8 +107,6 @@ public:
 
        virtual const Geometry::BoundingSphere<float, 3> *get_bounding_sphere() const { return &bounding_sphere; }
 
-       virtual void render(const Tag &tag = Tag()) const;
-
        virtual void render(Renderer &, const Tag & = Tag()) const;
 
        /** Renders an instance of the object.  The instance's hook functions are
@@ -121,6 +121,7 @@ private:
        const RenderPass *get_pass(const Tag &, unsigned) const;
 
        virtual void resource_loaded(Resource &);
+       virtual void resource_removed(Resource &);
 };
 
 } // namespace GL