SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLCoordAxisArrow.h
Go to the documentation of this file.
1 /**
2  * \file SLCoordAxisArrow.h
3  * \date April 2020
4  * \remarks Please use clangformat to format the code. See more code style on
5  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
6  * \authors Jan Dellsperger, Marcus Hudritsch
7  * \copyright http://opensource.org/licenses/GPL-3.0
8 */
9 
10 #ifndef SLCOORDAXISARROW_H
11 #define SLCOORDAXISARROW_H
12 
13 #include <SLMesh.h>
14 
15 //-----------------------------------------------------------------------------
16 /**
17  * @brief Single arrow for coordinate axis
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 SLCoordAxisArrow : public SLMesh
27 {
28 public:
29  explicit SLCoordAxisArrow(SLAssetManager* assetMgr,
30  SLMaterial* material = nullptr,
31  SLfloat arrowThickness = 0.05f,
32  SLfloat arrowHeadLenght = 0.2f,
33  SLfloat arrowHeadWidth = 0.1f);
34 
35  void buildMesh(SLMaterial* material = nullptr);
36 
37 private:
38  SLfloat _arrowThickness; //!< Thickness of the arrow
39  SLfloat _arrowHeadLength; //!< Lenght of the arrow head
40  SLfloat _arrowHeadWidth; //!< Width of the arrow head
41 };
42 //-----------------------------------------------------------------------------
43 
44 #endif
float SLfloat
Definition: SL.h:173
Toplevel holder of the assets meshes, materials, textures and shaders.
Single arrow for coordinate axis.
void buildMesh(SLMaterial *material=nullptr)
SLfloat _arrowHeadWidth
Width of the arrow head.
SLfloat _arrowHeadLength
Lenght of the arrow head.
SLfloat _arrowThickness
Thickness of the arrow.
SLCoordAxisArrow(SLAssetManager *assetMgr, SLMaterial *material=nullptr, SLfloat arrowThickness=0.05f, SLfloat arrowHeadLenght=0.2f, SLfloat arrowHeadWidth=0.1f)
Defines a standard CG material with textures and a shader program.
Definition: SLMaterial.h:56
An SLMesh object is a triangulated mesh, drawn with one draw call.
Definition: SLMesh.h:134