SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLSpheric.h
Go to the documentation of this file.
1 /**
2  * \file SLSpheric.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 SLSPHERIC_H
11 #define SLSPHERIC_H
12 
13 #include <SLRevolver.h>
14 
15 class SLRay;
16 class SLMaterial;
17 
18 //-----------------------------------------------------------------------------
19 //! SLSphere creates a sphere mesh based on SLRevolver
20 class SLSpheric : public SLRevolver
21 {
22 public:
23  SLSpheric(SLAssetManager* assetMgr,
25  SLfloat thetaStartDEG,
26  SLfloat thetaEndDEG,
27  SLuint stacks = 32,
28  SLuint slices = 32,
29  SLstring name = "spheric mesh",
30  SLMaterial* mat = nullptr);
31 
32  // Getters
33  SLfloat radius() { return _radius; }
34 
35 protected:
36  SLfloat _radius; //!< radius of the sphere
37  SLfloat _thetaStartDEG; //!< Polar start angle 0-180deg
38  SLfloat _thetaEndDEG; //!< Polar end angle 1-180deg
39 };
40 //-----------------------------------------------------------------------------
41 #endif // SLSPHERIC_H
float SLfloat
Definition: SL.h:173
unsigned int SLuint
Definition: SL.h:171
string SLstring
Definition: SL.h:158
Toplevel holder of the assets meshes, materials, textures and shaders.
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
Ray class with ray and intersection properties.
Definition: SLRay.h:40
SLRevolver is an SLMesh object built out of revolving points.
Definition: SLRevolver.h:38
SLuint stacks()
Definition: SLRevolver.h:54
SLuint slices()
Definition: SLRevolver.h:55
SLSphere creates a sphere mesh based on SLRevolver.
Definition: SLSpheric.h:21
SLfloat radius()
Definition: SLSpheric.h:33
SLfloat _thetaStartDEG
Polar start angle 0-180deg.
Definition: SLSpheric.h:37
SLfloat _thetaEndDEG
Polar end angle 1-180deg.
Definition: SLSpheric.h:38
SLfloat _radius
radius of the sphere
Definition: SLSpheric.h:36
SLSpheric(SLAssetManager *assetMgr, SLfloat radius, SLfloat thetaStartDEG, SLfloat thetaEndDEG, SLuint stacks=32, SLuint slices=32, SLstring name="spheric mesh", SLMaterial *mat=nullptr)
Definition: SLSpheric.cpp:18