SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLDisk.h
Go to the documentation of this file.
1 /**
2  * \file SLDisk.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 SLDISK_h
11 #define SLDISK_h
12 
13 #include <SLRevolver.h>
14 
15 //-----------------------------------------------------------------------------
16 /**
17  * @brief SLDisk creates a disk mesh based on SLRevolver
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 SLDisk : public SLRevolver
27 {
28 public:
29  SLDisk(SLAssetManager* assetMgr,
30  SLfloat radius = 1.0f,
31  const SLVec3f& revolveAxis = SLVec3f::AXISY,
32  SLuint slices = 36,
33  SLbool doubleSided = false,
34  SLstring name = "disk mesh",
35  SLMaterial* mat = nullptr);
36 
37  // Getters
38  SLfloat radius() { return _radius; }
39 
40 protected:
41  SLfloat _radius; //!< radius of cone
42  SLbool _doubleSided; //!< flag if disk has two sides
43 };
44 //-----------------------------------------------------------------------------
45 #endif // SLDISK_h
float SLfloat
Definition: SL.h:173
unsigned int SLuint
Definition: SL.h:171
bool SLbool
Definition: SL.h:175
string SLstring
Definition: SL.h:158
Toplevel holder of the assets meshes, materials, textures and shaders.
SLDisk creates a disk mesh based on SLRevolver.
Definition: SLDisk.h:27
SLDisk(SLAssetManager *assetMgr, SLfloat radius=1.0f, const SLVec3f &revolveAxis=SLVec3f::AXISY, SLuint slices=36, SLbool doubleSided=false, SLstring name="disk mesh", SLMaterial *mat=nullptr)
Definition: SLDisk.cpp:18
SLfloat radius()
Definition: SLDisk.h:38
SLbool _doubleSided
flag if disk has two sides
Definition: SLDisk.h:42
SLfloat _radius
radius of cone
Definition: SLDisk.h:41
Defines a standard CG material with textures and a shader program.
Definition: SLMaterial.h:56
SLMaterial * mat() const
Definition: SLMesh.h:177
const SLstring & name() const
Definition: SLObject.h:38
SLRevolver is an SLMesh object built out of revolving points.
Definition: SLRevolver.h:38
SLuint slices()
Definition: SLRevolver.h:55
static SLVec3 AXISY
Definition: SLVec3.h:298