Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
Normals.h
Go to the documentation of this file.
1#pragma once
2#include <xgl/TVertexArray.h>
3#include <xgl/global.h>
4
5namespace sf::xgl
6{
7
11class _XGL_CLASS Normals final : public TVertexArray<VertexArrayBase::vmPosition>
12{
13 public:
14 // Use the constructors from the base class.
15 using TVertexArray::TVertexArray;
16
21 {
26 float length;
31 float lineWidth;
32
33 } parameters{0.02f, 2.0f};
34
38 bool isTarget(const VertexArrayBase* object) const;
39
43 void setTarget(const VertexArrayBase* object);
44
45 protected:
49 void generate() override;
50
54 void modifyContext(bool before, bool draw, size_t mode_index) override;
55
56 private:
60 const VertexArrayBase* _vertexArray{nullptr};
61};
62
63}// namespace sf::xgl
Class to render Normals from another vertex array.
Definition Normals.h:12
bool isTarget(const VertexArrayBase *object) const
Checks if the passed object is where the normals are taken from.
void modifyContext(bool before, bool draw, size_t mode_index) override
Overridden from base class to set the line width.
void setTarget(const VertexArrayBase *object)
Sets the target for this and regenerates the data.
void generate() override
Overridden from base class.
OpenGL base class and wrapper template for vertex arrays. Automates most of the things needed for pri...
Definition TVertexArray.h:20
Base class for Vertex array derived classes.
Definition VertexArrayBase.h:14
Definition DemoRenderer.h:6
Parameters for generating the data.
Definition Normals.h:21
float lineWidth
Dynamic line width of the normals. This parameter is used when drawing.
Definition Normals.h:31
float length
Static length of the normal lines. This parameter is used when generating data.
Definition Normals.h:26
#define _XGL_CLASS
Definition xgl/global.h:35