3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GL_OBJETCINSTANCE_H_
9 #define MSP_GL_OBJETCINSTANCE_H_
12 #include "renderable.h"
23 Represents a single instance of an Object. An application can derive another
24 class from this and overload the hook functions to specify location and other
25 instance-specific parameters for the rendered objects.
27 The finish_render function generally should clean up everything done by
28 setup_render, unless the rendering sequence is known to allow otherwise.
30 class ObjectInstance: public Renderable
36 ObjectInstance(const Object &);
38 const Object &get_object() const { return object; }
40 virtual bool has_pass(const Tag &tag) const;
42 virtual void render(const Tag &tag=Tag()) const;
45 Hook function, called from Object just before rendering the mesh.
47 virtual void setup_render(const ObjectPass &) const { }
50 Hook function, called from Object right after rendering the mesh.
52 virtual void finish_render(const ObjectPass &) const { }
54 virtual unsigned get_level_of_detail() const { return 0; }