MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
InfluenceContext.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <glm/vec3.hpp>
4
5namespace MayaFlux::Buffers {
6class RenderProcessor;
7}
8
9namespace MayaFlux::Nexus {
10
11/**
12 * @struct InfluenceUBO
13 * @brief GPU-side std140 layout matching InfluenceContext plain data fields.
14 *
15 * Packs into two vec4 slots plus one partial (48 bytes total).
16 * GLSL declaration:
17 * @code
18 * layout(set = 1, binding = 1) uniform Influence {
19 * vec3 position;
20 * float intensity;
21 * vec3 color;
22 * float radius;
23 * float size;
24 * };
25 * @endcode
26 */
27struct alignas(16) InfluenceUBO {
28 glm::vec3 position { 0.0F };
29 float intensity { 1.0F };
30 glm::vec3 color { 1.0F, 1.0F, 1.0F };
31 float radius { 1.0F };
32 float size { 1.0F };
33 float _pad[3] {};
34};
35
36static_assert(sizeof(InfluenceUBO) == 48, "InfluenceUBO must be 48 bytes for std140 alignment");
37
38/**
39 * @struct InfluenceContext
40 * @brief Data passed to an Emitter or Agent influence function on each commit.
41 *
42 * Only the fields relevant to the active execution path are populated.
43 * Fields marked @note future are reserved for later domain expansions and
44 * are always default-initialised in the current implementation.
45 */
47 glm::vec3 position {}; ///< Position of the influence point in world space.
48
49 float intensity { 1.0F }; ///< Intensity of the influence, typically in the range [0, 1], but may exceed 1 for strong influences.
50
51 float radius { 1.0F }; ///< Radius of influence around the position, defining the area of effect for spatially-dependent influences.
52
53 std::optional<glm::vec3> color; ///< Optional color hint for the influence, may be used for visualisation or shader effects.
54
55 std::optional<float> size; ///< Optional size hint for the influence, may be used for visualisation or shader effects.
56
57 // @note future: ShaderProcessor* shader_proc { nullptr };
58 // @note future: std::span<const double> audio_snapshot;
59
60 std::weak_ptr<Buffers::RenderProcessor> render_proc;
61};
62
63} // namespace MayaFlux::Nexus
std::weak_ptr< Buffers::RenderProcessor > render_proc
glm::vec3 position
Position of the influence point in world space.
std::optional< glm::vec3 > color
Optional color hint for the influence, may be used for visualisation or shader effects.
std::optional< float > size
Optional size hint for the influence, may be used for visualisation or shader effects.
float intensity
Intensity of the influence, typically in the range [0, 1], but may exceed 1 for strong influences.
float radius
Radius of influence around the position, defining the area of effect for spatially-dependent influenc...
Data passed to an Emitter or Agent influence function on each commit.
GPU-side std140 layout matching InfluenceContext plain data fields.