-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathMouseRay.hpp
59 lines (42 loc) · 1.69 KB
/
MouseRay.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
////////////////////////////////////////////////////////////////////////////////////////////////////
// This file is part of CosmoScout VR //
////////////////////////////////////////////////////////////////////////////////////////////////////
// SPDX-FileCopyrightText: German Aerospace Center (DLR) <[email protected]>
// SPDX-License-Identifier: MIT
#ifndef CS_GRAPHICS_MOUSE_RAY_HPP
#define CS_GRAPHICS_MOUSE_RAY_HPP
#include "cs_graphics_export.hpp"
#include <memory>
#include <VistaKernel/GraphicsManager/VistaOpenGLDraw.h>
#include <VistaKernel/GraphicsManager/VistaOpenGLNode.h>
#include <VistaOGLExt/VistaBufferObject.h>
#include <VistaOGLExt/VistaGLSLShader.h>
#include <VistaOGLExt/VistaVertexArrayObject.h>
class VistaTransformNode;
class VistaOpenGLNode;
namespace cs::graphics {
/// A ray that shoots from the mouse into space? DocTODO
class CS_GRAPHICS_EXPORT MouseRay : public IVistaOpenGLDraw {
public:
MouseRay();
MouseRay(MouseRay const& other) = delete;
MouseRay(MouseRay&& other) = delete;
MouseRay& operator=(MouseRay const& other) = delete;
MouseRay& operator=(MouseRay&& other) = delete;
~MouseRay() override = default;
bool Do() override;
bool GetBoundingBox(VistaBoundingBox& bb) override;
private:
std::unique_ptr<VistaTransformNode> mRayTransform;
std::unique_ptr<VistaOpenGLNode> mMouseRayNode;
VistaGLSLShader mShader;
VistaVertexArrayObject mRayVAO;
VistaBufferObject mRayVBO;
VistaBufferObject mRayIBO;
struct {
uint32_t modelViewMatrix = 0;
uint32_t projectionMatrix = 0;
} mUniforms;
};
} // namespace cs::graphics
#endif // CS_GRAPHICS_MOUSE_RAY_HPP