MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
VertexSampler.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "Stochastic.hpp"
4
6
7namespace MayaFlux::Kinesis {
8
10
11/**
12 * @brief Spatial distribution mode for point cloud and particle generation.
13 *
14 * Shared enumeration consumed by both ParticleNetwork and PointCloudNetwork.
15 * Separates the concern of spatial distribution from vertex type construction.
16 */
36
37/**
38 * @struct SamplerBounds
39 * @brief Spatial domain for vertex generation.
40 */
42 glm::vec3 min { -1.0F };
43 glm::vec3 max { 1.0F };
44
45 [[nodiscard]] glm::vec3 center() const noexcept { return (min + max) * 0.5F; }
46 [[nodiscard]] glm::vec3 extent() const noexcept { return max - min; }
47 [[nodiscard]] float max_radius() const noexcept { return glm::length(extent()) * 0.5F; }
48};
49
50/**
51 * @brief Generate a batch of spatially distributed samples.
52 * @param distribution Spatial distribution algorithm to apply
53 * @param count Number of samples to generate
54 * @param bounds Spatial domain
55 * @param rng Stochastic engine (caller owns; enables reproducible sequences)
56 * @return SampleResult vector of length <= count (exact for all deterministic modes)
57 *
58 * All geometry is computed here. Callers convert SampleResult to their
59 * concrete vertex type via the projection helpers below.
60 */
61[[nodiscard]] MAYAFLUX_API std::vector<Vertex> generate_samples(
62 SpatialDistribution distribution,
63 size_t count,
64 const SamplerBounds& bounds,
66
67/**
68 * @brief Generate a single sample at a specific index (for indexed/sequential modes).
69 * @param distribution Spatial distribution algorithm
70 * @param index Sample index within the total sequence
71 * @param total Total number of samples in the sequence
72 * @param bounds Spatial domain
73 * @param rng Stochastic engine
74 * @return Single SampleResult
75 *
76 * Useful for ParticleNetwork's per-index generation pattern.
77 */
78[[nodiscard]] MAYAFLUX_API Vertex generate_sample_at(
79 SpatialDistribution distribution,
80 size_t index,
81 size_t total,
82 const SamplerBounds& bounds,
84
85} // namespace MayaFlux::Kinesis
size_t count
Unified generative infrastructure for stochastic and procedural algorithms.
Vertex generate_sample_at(SpatialDistribution dist, size_t index, size_t total, const SamplerBounds &bounds, Stochastic::Stochastic &rng)
Generate a single sample at a specific index (for indexed/sequential modes).
Kakshya::Vertex Vertex
std::vector< Vertex > generate_samples(SpatialDistribution dist, size_t count, const SamplerBounds &bounds, Stochastic::Stochastic &rng)
Generate a batch of spatially distributed samples.
SpatialDistribution
Spatial distribution mode for point cloud and particle generation.
Type-neutral vertex carrying the universal 60-byte attribute layout.
float max_radius() const noexcept
glm::vec3 center() const noexcept
glm::vec3 extent() const noexcept
Spatial domain for vertex generation.