Virtual Testbed
Ship dynamics simulator for extreme conditions
TexturedObject.hh
1 #ifndef VTESTBED_GRAPHICS_TEXTUREDOBJECT_HH
2 #define VTESTBED_GRAPHICS_TEXTUREDOBJECT_HH
3 
4 #include <Magnum/GL/Mesh.h>
5 #include <Magnum/Resource.h>
6 #include <Magnum/Shaders/Phong.h>
7 
8 #include <vtestbed/graphics/types.hh>
9 
10 namespace vtb {
11 
12  namespace graphics {
13 
15  public Object3D,
16  public Drawable3D
17  {
18 
19  public:
20 
21  explicit
23  Magnum::ResourceKey meshId,
24  Magnum::ResourceKey materialId,
25  Magnum::ResourceKey diffuseTextureId,
26  Object3D* parent,
27  DrawableGroup3D* group
28  );
29 
30  private:
31  void
32  draw(const Matrix4& transformationMatrix, Camera3D& camera) override;
33 
34  Magnum::Resource<Magnum::GL::Mesh> _mesh;
35  Magnum::Resource<Magnum::GL::Texture2D> _diffuseTexture;
36  Magnum::Resource<Magnum::Shaders::Phong> _shader;
37  Vector3 _ambientColor;
38  Vector3 _specularColor;
39  Float _shininess;
40 
41  };
42 
43  }
44 
45 }
46 
47 #endif // vim:filetype=cpp
Main namespace.
Definition: convert.hh:9