SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLCylinder.h
Go to the documentation of this file.
1
/**
2
* \file SLCylinder.h
3
* \date July 2014
4
* \authors Marcus Hudritsch
5
* \copyright http://opensource.org/licenses/GPL-3.0
6
* \remarks Please use clangformat to format the code. See more code style on
7
* https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8
*/
9
10
#ifndef SLCYLINDER_H
11
#define SLCYLINDER_H
12
13
#include <
SLRevolver.h
>
14
15
//-----------------------------------------------------------------------------
16
/**
17
* @brief SLCylinder is creates sphere mesh based on its SLRevolver methods
18
* @remarks It is important that during instantiation NO OpenGL functions (gl*)
19
* get called because this constructor will be most probably called in a parallel
20
* thread from within an SLScene::registerAssetsToLoad or SLScene::assemble
21
* function. All objects that get rendered have to do their OpenGL initialization
22
* when they are used the first time during rendering in the main thread.
23
* For this mesh it means that the objects for OpenGL drawing (_vao, _vaoP,
24
* _vaoN, _vaoT and _vaoS) remain unused until the first frame is rendered.
25
*/
26
class
SLCylinder
:
public
SLRevolver
27
{
28
public
:
29
SLCylinder
(
SLAssetManager
* assetMgr,
30
SLfloat
cylinderRadius,
31
SLfloat
cylinderHeight,
32
SLuint
stacks
= 1,
33
SLuint
slices
= 16,
34
SLbool
hasTop
=
true
,
35
SLbool
hasBottom
=
true
,
36
SLstring
name
=
"cylinder mesh"
,
37
SLMaterial
*
mat
=
nullptr
);
38
39
// Getters
40
SLfloat
radius
() {
return
_radius
; }
41
SLfloat
height
() {
return
_height
; }
42
SLbool
hasTop
() {
return
_hasTop
; }
43
SLbool
hasBottom
() {
return
_hasBottom
; }
44
45
private
:
46
SLfloat
_radius
;
//!< radius of cylinder
47
SLfloat
_height
;
//!< height of cylinder
48
SLbool
_hasTop
;
//!< Flag if cylinder has a top
49
SLbool
_hasBottom
;
//!< Flag if cylinder has a bottom
50
};
51
//-----------------------------------------------------------------------------
52
#endif
// SLCYLINDER_H
SLfloat
float SLfloat
Definition:
SL.h:173
SLuint
unsigned int SLuint
Definition:
SL.h:171
SLbool
bool SLbool
Definition:
SL.h:175
SLstring
string SLstring
Definition:
SL.h:158
SLRevolver.h
SLAssetManager
Toplevel holder of the assets meshes, materials, textures and shaders.
Definition:
SLAssetManager.h:33
SLCylinder
SLCylinder is creates sphere mesh based on its SLRevolver methods.
Definition:
SLCylinder.h:27
SLCylinder::_height
SLfloat _height
height of cylinder
Definition:
SLCylinder.h:47
SLCylinder::SLCylinder
SLCylinder(SLAssetManager *assetMgr, SLfloat cylinderRadius, SLfloat cylinderHeight, SLuint stacks=1, SLuint slices=16, SLbool hasTop=true, SLbool hasBottom=true, SLstring name="cylinder mesh", SLMaterial *mat=nullptr)
Definition:
SLCylinder.cpp:18
SLCylinder::_hasBottom
SLbool _hasBottom
Flag if cylinder has a bottom.
Definition:
SLCylinder.h:49
SLCylinder::height
SLfloat height()
Definition:
SLCylinder.h:41
SLCylinder::hasTop
SLbool hasTop()
Definition:
SLCylinder.h:42
SLCylinder::hasBottom
SLbool hasBottom()
Definition:
SLCylinder.h:43
SLCylinder::_radius
SLfloat _radius
radius of cylinder
Definition:
SLCylinder.h:46
SLCylinder::_hasTop
SLbool _hasTop
Flag if cylinder has a top.
Definition:
SLCylinder.h:48
SLCylinder::radius
SLfloat radius()
Definition:
SLCylinder.h:40
SLMaterial
Defines a standard CG material with textures and a shader program.
Definition:
SLMaterial.h:56
SLMesh::mat
SLMaterial * mat() const
Definition:
SLMesh.h:177
SLObject::name
const SLstring & name() const
Definition:
SLObject.h:38
SLRevolver
SLRevolver is an SLMesh object built out of revolving points.
Definition:
SLRevolver.h:38
SLRevolver::stacks
SLuint stacks()
Definition:
SLRevolver.h:54
SLRevolver::slices
SLuint slices()
Definition:
SLRevolver.h:55
modules
sl
source
mesh
SLCylinder.h
Generated by
1.9.1