1 #ifndef MSP_GL_OBJECT_H_
2 #define MSP_GL_OBJECT_H_
6 #include "renderable.h"
7 #include "renderpass.h"
19 Stores a Mesh together with a Technique to determine its appearance.
21 It is possible to use a single Object for rendering multiple identical or
22 similar objects. See class ObjectInstance.
24 class Object: public Renderable
27 class Loader: public DataFile::CollectionObjectLoader<Object>
31 Loader(Object &, Collection &);
37 void mesh_inline_lod(unsigned);
38 void mesh(const std::string &);
39 void mesh_lod(unsigned, const std::string &);
40 void technique_inline();
41 void technique(const std::string &);
45 std::vector<RefPtr<const Mesh> > meshes;
46 RefPtr<const Technique> technique;
50 Object(const Mesh *, const Technique *);
53 void set_mesh(const Mesh *m) { set_mesh(0, m); }
54 void set_mesh(unsigned, const Mesh *);
55 const Mesh *get_mesh(unsigned = 0) const;
56 void set_technique(const Technique *);
57 const Technique *get_technique() const { return technique.get(); }
60 Renders the object. A tag can be provided to render a non-default pass.
62 virtual void render(const Tag &tag = Tag()) const;
64 virtual void render(Renderer &, const Tag & = Tag()) const;
67 Renders the object with an instance. The instance's hook functions are
68 called before and after drawing the mesh. A tag may also be given to render
71 virtual void render(Renderer &, const ObjectInstance &, const Tag & = Tag()) const;
74 const RenderPass *get_pass(const Tag &) const;