MayaFlux
0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
PointNode.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
GeometryWriterNode.hpp
"
4
5
namespace
MayaFlux::Nodes::GpuSync
{
6
7
/**
8
* @class PointNode
9
* @brief Single 3D point in space
10
*
11
* GeometryWriterNode that renders exactly ONE point.
12
* Can be used standalone or as building block in NodeNetworks.
13
*
14
* Usage:
15
* ```cpp
16
* auto point = std::make_shared<PointNode>(glm::vec3(0.0f, 0.0f, 0.0f));
17
* auto buffer = std::make_shared<GeometryBuffer>(point);
18
* buffer->initialize();
19
* ```
20
*/
21
class
MAYAFLUX_API
PointNode
:
public
GeometryWriterNode
{
22
public
:
23
/**
24
* @brief Create point at origin
25
*/
26
PointNode
();
27
28
/**
29
* @brief Create point from PointVertex
30
* @param point Initial point data
31
*/
32
explicit
PointNode
(
const
PointVertex
& point);
33
34
/**
35
* @brief Create point at specific position
36
* @param position Initial 3D position
37
* @param color Initial color
38
* @param size Initial point size
39
*/
40
PointNode
(
const
glm::vec3& position,
const
glm::vec3& color = glm::vec3(1.0F),
float
size = 10.0F);
41
42
/**
43
* @brief Set point position
44
* @param position New 3D position
45
*/
46
void
set_position(
const
glm::vec3& position);
47
48
/**
49
* @brief Set point size
50
* @param size New point size
51
*/
52
void
set_size(
float
size);
53
54
/**
55
* @brief Set point color
56
* @param color New point color
57
*/
58
void
set_color(
const
glm::vec3& color);
59
60
/**
61
* @brief Get current position
62
* @return 3D position
63
*/
64
[[nodiscard]] glm::vec3
get_position
()
const
{
return
m_point_vertex.position; }
65
66
/**
67
* @brief Get current color
68
* @return Point color
69
*/
70
[[nodiscard]] glm::vec3
get_color
()
const
{
return
m_point_vertex.color; }
71
72
/**
73
* @brief Get current size
74
* @return Point size
75
*/
76
[[nodiscard]]
float
get_size
()
const
{
return
m_point_vertex.size; }
77
78
/**
79
* @brief Compute frame - upload single point to vertex buffer
80
*/
81
void
compute_frame()
override
;
82
83
private
:
84
PointVertex
m_point_vertex
;
85
};
86
87
}
// namespace MayaFlux::Nodes
GeometryWriterNode.hpp
MayaFlux::Nodes::GpuSync::GeometryWriterNode
Base class for nodes that generate 3D geometry data.
Definition
GeometryWriterNode.hpp:67
MayaFlux::Nodes::GpuSync::PointNode::get_color
glm::vec3 get_color() const
Get current color.
Definition
PointNode.hpp:70
MayaFlux::Nodes::GpuSync::PointNode::get_size
float get_size() const
Get current size.
Definition
PointNode.hpp:76
MayaFlux::Nodes::GpuSync::PointNode::get_position
glm::vec3 get_position() const
Get current position.
Definition
PointNode.hpp:64
MayaFlux::Nodes::GpuSync::PointNode::m_point_vertex
PointVertex m_point_vertex
Definition
PointNode.hpp:84
MayaFlux::Nodes::GpuSync::PointNode
Single 3D point in space.
Definition
PointNode.hpp:21
MayaFlux::Nodes::GpuSync
Definition
Registry.hpp:19
MayaFlux::Nodes::PointVertex
Definition
VertexSpec.hpp:7
src
MayaFlux
Nodes
Graphics
PointNode.hpp
Generated by
1.9.8