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 std::vector<RefPtr<const Mesh> > meshes;
28 RefPtr<const Technique> technique;
31 class Loader: public DataFile::CollectionObjectLoader<Object>
35 Loader(Object &, Collection &);
41 void mesh_inline_lod(unsigned);
42 void mesh(const std::string &);
43 void mesh_lod(unsigned, const std::string &);
44 void technique_inline();
45 void technique(const std::string &);
51 void set_mesh(const Mesh *m) { set_mesh(0, m); }
52 void set_mesh(unsigned, const Mesh *);
53 const Mesh *get_mesh(unsigned = 0) const;
54 void set_technique(const Technique *);
55 const Technique *get_technique() const { return technique.get(); }
58 Renders the object. A tag can be provided to render a non-default pass.
60 virtual void render(const Tag &tag = Tag()) const;
62 virtual void render(Renderer &, const Tag & = Tag()) const;
65 Renders the object with an instance. The instance's hook functions are
66 called before and after drawing the mesh. A tag may also be given to render
69 virtual void render(Renderer &, const ObjectInstance &, const Tag & = Tag()) const;
72 const RenderPass *get_pass(const Tag &) const;