Repository navigation
Expand file tree
/
Copy pathcamera_node.h
More file actions
91 lines (76 loc) · 1.91 KB
/
Copy pathcamera_node.h
File metadata and controls
91 lines (76 loc) · 1.91 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
////////////////////////////////////////////////////////////////////////////////
// Distributed under the Boost Software License, Version 1.0. //
// (See accompanying file LICENSE or copy at //
// https://www.boost.org/LICENSE_1_0.txt) //
////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <cstddef>
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include "graphics/render_graph/node.h"
namespace iris
{
class ShaderCompiler;
/**
* Enumeration of types of camera data that can be used.
*/
enum class CameraDataType : std::uint8_t
{
POSITION,
};
/**
* Implementation of Node for getting camera data.
*/
class CameraNode : public Node
{
public:
/**
* Construct a new CameraNode
*
* @param camera_data_type
* The type of camera data to get.
*/
CameraNode(CameraDataType camera_data_type);
/**
* Construct a new CameraNode
*
* @param camera_data_type
* The type of camera data to get.
*
* @param swizzle
* A swizzle to apply to the camera data.
*/
CameraNode(CameraDataType camera_data_type, std::string_view swizzle);
/**
* Accept a compiler visitor.
*
* @param compiler
* Compiler to accept.
*/
void accept(ShaderCompiler &compiler) const override;
/**
*/
CameraDataType camera_data_type() const;
/**
* Get swizzle.
*
* @return
* Swizzle, of one was set.
*/
std::optional<std::string> swizzle() const;
/**
* Compute hash of node.
*
* @return
* Hash of node.
*/
std::size_t hash() const override;
private:
/** Type of camera data to get. */
CameraDataType camera_data_type_;
/** Optional swizzle. */
std::optional<std::string> swizzle_;
};
}