Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
Cylinder.h
Go to the documentation of this file.
1#pragma once
2#include <xgl/TVertexArray.h>
3#include <xgl/global.h>
4
5namespace sf::xgl
6{
7
13class _XGL_CLASS Cylinder final : public TVertexArray<VertexArrayBase::vmPosition | VertexArrayBase::vmNormal>
14{
15 public:
16 // Use the constructors from the base class.
17 using TVertexArray::TVertexArray;
18
23 {
25 float height;
27 float radius;
29 int stacks;
33 bool top;
35 bool bottom;
36 } parameters{0.5f, 0.25f, 20, 20, true, true};
37
41 void setSize(float height, float radius);
42
43 protected:
47 void generate() override;
48};
49
50}// namespace sf::xgl
Class to render a cylinder in OpenGL. Has a single color. Height of the cone is along the Z-axis wher...
Definition Cylinder.h:14
void setSize(float height, float radius)
Sets new sizes.
void generate() override
Overridden from base class.
OpenGL base class and wrapper template for vertex arrays. Automates most of the things needed for pri...
Definition TVertexArray.h:20
Definition DemoRenderer.h:6
Parameters for generating the data.
Definition Cylinder.h:23
bool bottom
Definition Cylinder.h:35
float height
Definition Cylinder.h:25
bool top
Definition Cylinder.h:33
int stacks
Definition Cylinder.h:29
float radius
Definition Cylinder.h:27
int sectors
Definition Cylinder.h:31
#define _XGL_CLASS
Definition xgl/global.h:35