SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLCoordAxis.h
Go to the documentation of this file.
1 /**
2  * \file SLCoordAxis.h
3  * \date July 2016
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 SLCOORDAXIS_H
11 #define SLCOORDAXIS_H
12 
13 #include <SLEnums.h>
14 #include <SLMesh.h>
15 
16 //-----------------------------------------------------------------------------
17 /**
18  * @brief Axis aligned coordinate axis mesh
19  * @details The SLAxis mesh draws axis aligned arrows to indicate the
20  * coordinate system. All arrows have unit lenght. The arrow along x,y & z
21  * axis have the colors red, green & blue.
22  * @remarks It is important that during instantiation NO OpenGL functions (gl*)
23  * get called because this constructor will be most probably called in a parallel
24  * thread from within an SLScene::registerAssetsToLoad or SLScene::assemble
25  * function. All objects that get rendered have to do their OpenGL initialization
26  * when they are used the first time during rendering in the main thread.
27  * For this mesh it means that the objects for OpenGL drawing (_vao, _vaoP,
28  * _vaoN, _vaoT and _vaoS) remain unused until the first frame is rendered.
29  */
30 class SLCoordAxis : public SLMesh
31 {
32 public:
33  explicit SLCoordAxis(SLAssetManager* assetMgr,
34  SLfloat arrowThickness = 0.05f,
35  SLfloat arrowHeadLenght = 0.2f,
36  SLfloat arrowHeadWidth = 0.1f);
37 
38  void buildMesh();
39 
40 private:
41  SLfloat _arrowThickness; //!< Thickness of the arrow
42  SLfloat _arrowHeadLength; //!< Lenght of the arrow head
43  SLfloat _arrowHeadWidth; //!< Width of the arrow head
44 };
45 //-----------------------------------------------------------------------------
46 #endif
float SLfloat
Definition: SL.h:173
Toplevel holder of the assets meshes, materials, textures and shaders.
Axis aligned coordinate axis mesh.
Definition: SLCoordAxis.h:31
SLfloat _arrowThickness
Thickness of the arrow.
Definition: SLCoordAxis.h:41
SLCoordAxis(SLAssetManager *assetMgr, SLfloat arrowThickness=0.05f, SLfloat arrowHeadLenght=0.2f, SLfloat arrowHeadWidth=0.1f)
SLAxis::SLAxis ctor with the arrow dimensions.
Definition: SLCoordAxis.cpp:14
void buildMesh()
SLCoordAxis::buildMesh fills in the underlying arrays from the SLMesh object.
Definition: SLCoordAxis.cpp:26
SLfloat _arrowHeadLength
Lenght of the arrow head.
Definition: SLCoordAxis.h:42
SLfloat _arrowHeadWidth
Width of the arrow head.
Definition: SLCoordAxis.h:43
An SLMesh object is a triangulated mesh, drawn with one draw call.
Definition: SLMesh.h:134