AGL
A graphics library
cylinder.h
1 // Copyright 2019, Savvy Sine, Aline Normoyle
2 
3 #ifndef AGL_MESH_CYLINDER_H_
4 #define AGL_MESH_CYLINDER_H_
5 
6 #include "agl/mesh/triangle_mesh.h"
7 
8 namespace agl {
9 
13 class Cylinder : public TriangleMesh {
14  public:
15  Cylinder(float rad, float len, GLuint sl);
16  Cylinder(float rad1, float rad2, float len, GLuint sl);
17 
18  protected:
19  void init() override;
20 
21  private:
22  void computeMesh(float rad1, float rad2, float len, GLuint sl);
23 
24  float _r1;
25  float _r2;
26  float _length;
27  float _nSlices;
28 };
29 
30 } // namespace agl
31 #endif // AGL_MESH_CYLINDER_H_
agl::Cylinder
Draw a cylinder mesh.
Definition: cylinder.h:13
agl::TriangleMesh
Base class for indexed triangle meshes.
Definition: triangle_mesh.h:16
agl::Cylinder::init
void init() override
Override init to specifiy vertex data for the mesh.
Definition: cylinder.cpp:25