AGL
A graphics library
torus.h
1 // Copyright 2020, Savvy Sine, Aline Normoyle
2 
3 #ifndef AGL_MESH_TORUS_H_
4 #define AGL_MESH_TORUS_H_
5 
6 #include "agl/mesh/triangle_mesh.h"
7 
8 namespace agl {
9 
13 class Torus : public TriangleMesh {
14  public:
27  Torus(GLfloat outerRadius, GLfloat innerRadius,
28  GLuint nsides, GLuint nrings);
29 
30  protected:
31  void init() override;
32 
33  private:
34  GLfloat _outerRadius;
35  GLfloat _innerRadius;
36  GLuint _nsides;
37  GLuint _nrings;
38 };
39 
40 } // namespace agl
41 #endif // AGL_MESH_TORUS_H_
agl::Torus
Draw a torus mesh.
Definition: torus.h:13
agl::TriangleMesh
Base class for indexed triangle meshes.
Definition: triangle_mesh.h:16
agl::Torus::init
void init() override
Override init to specifiy vertex data for the mesh.
Definition: torus.cpp:18
agl::Torus::Torus
Torus(GLfloat outerRadius, GLfloat innerRadius, GLuint nsides, GLuint nrings)
Create a torus mesh.
Definition: torus.cpp:10