Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
Donut.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{
11class _XGL_CLASS Donut final : public TVertexArray<VertexArrayBase::vmPosition | VertexArrayBase::vmNormal>
12{
13 public:
14 // Use the constructors from the base class.
16
17 void setSize(float height, float radius);
18
23 {
29 float height;
33 int stacks;
34 } parameters{0.25f, 0.3f, 0.05f, 36, 7};
35
36 protected:
38 void generate() override;
39};
40
41}// namespace sf::xgl
Class to render a donut around the z-axis in OpenGL. Uses sectors and stacks for the generation of po...
Definition Donut.h:12
TVertexArray(ShaderProgram *sp)
Constructor.
void generate() override
Overridden from base class.
void setSize(float height, float radius)
TVertexArray(ShaderProgram *sp)
Constructor.
Definition DemoRenderer.h:6
Parameters for generating the data.
Definition Donut.h:23
float height
Height of the donut.
Definition Donut.h:29
float outerRadius
Outer radius of the donut.
Definition Donut.h:27
int sectors
Number of sectors.
Definition Donut.h:31
int stacks
Number of stacks.
Definition Donut.h:33
float innerRadius
Inner radius of the donut.
Definition Donut.h:25
#define _XGL_CLASS
Definition xgl/global.h:35