Virtual Testbed
Ship dynamics simulator for extreme conditions
WindFieldObject.hh
1 #ifndef VTESTBED_GRAPHICS_WINDFIELDOBJECT_HH
2 #define VTESTBED_GRAPHICS_WINDFIELDOBJECT_HH
3 
4 #include <vtestbed/core/types.hh>
5 #include <vtestbed/graphics/types.hh>
6 
7 namespace vtb {
8 
9  namespace graphics {
10 
11  template <class T>
12  class WindFieldObject: public Object3D, public Drawable3D {
13 
14  private:
16  using vec3 = vtb::core::Vector3<T>;
17  using array_type = blitz::Array<vec3,3>;
20 
21  private:
22  DrawableGroup3D _drawables;
23  Magnum::Shaders::VertexColor3D _shader;
24  Mesh _mesh;
25  Buffer _vertexBuffer;
26  bool _show_field = true;
27  bool _show_boundary = true;
28 
29  public:
30 
31  inline WindFieldObject(): Drawable3D(*this, nullptr) {}
32 
33  inline bool show() const { return this->_show_field || this->_show_boundary; }
34  inline void showField(bool b) { this->_show_field = b; }
35  inline void showBoundary(bool b) { this->_show_boundary = b; }
36 
37  void draw(const Matrix4& m, Camera3D& camera) override;
38  void step(const testbed_type& testbed);
39  void init(const testbed_type& testbed);
40 
41  };
42 
43  }
44 
45 }
46 
47 #endif // vim:filetype=cpp
Main namespace.
Definition: convert.hh:9