#include "bindable.h"
#include "renderable.h"
#include "renderpass.h"
-#include "resourcewatcher.h"
+#include "resourceobserver.h"
namespace Msp {
namespace GL {
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;
void init();
virtual void finish();
+ void bounding_sphere_hint(float, float, float, float);
void level_of_detail(unsigned);
};
std::vector<LevelOfDetail> lods;
Geometry::BoundingSphere<float, 3> bounding_sphere;
+ bool lod0_watched;
+
+ static Matrix identity_matrix;
public:
Object();
void set_technique(unsigned, const Technique *);
const Technique *get_technique(unsigned = 0) const;
+ unsigned get_n_lods() const { return lods.size(); }
+ virtual const Matrix *get_matrix() const { return &identity_matrix; }
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
const RenderPass *get_pass(const Tag &, unsigned) const;
virtual void resource_loaded(Resource &);
+ virtual void resource_removed(Resource &);
};
} // namespace GL