HighMap library (C++)
Loading...
Searching...
No Matches
particles.hpp
Go to the documentation of this file.
1/* Copyright (c) 2023 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4
10#pragma once
11#include <random>
12
13#include <glm/glm.hpp>
14
15#include "highmap/array.hpp"
16
17namespace hmap
18{
19
32glm::ivec2 spawn_borders(std::mt19937 &rng,
33 int nbuffer,
34 const glm::ivec2 &shape);
35
48glm::ivec2 spawn_disc(std::mt19937 &rng,
49 const glm::ivec2 &center,
50 float radius,
51 const glm::ivec2 &shape);
52
64glm::ivec2 spawn_gaussian(std::mt19937 &rng,
65 const glm::vec2 &center,
66 float sigma,
67 const glm::ivec2 &shape);
68
81glm::ivec2 spawn_ring(std::mt19937 &rng,
82 const glm::ivec2 &center,
83 float radius_min,
84 float radius_max,
85 const glm::ivec2 &shape);
86
96glm::ivec2 spawn_uniform(std::mt19937 &rng, const glm::ivec2 &shape);
97
98} // namespace hmap
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition algebra.hpp:23
glm::ivec2 spawn_ring(std::mt19937 &rng, const glm::ivec2 &center, float radius_min, float radius_max, const glm::ivec2 &shape)
Spawn a point uniformly within an annulus (ring).
Definition spawner.cpp:110
glm::ivec2 spawn_disc(std::mt19937 &rng, const glm::ivec2 &center, float radius, const glm::ivec2 &shape)
Spawn a point uniformly inside a disk.
Definition spawner.cpp:71
glm::ivec2 spawn_gaussian(std::mt19937 &rng, const glm::vec2 &center, float sigma, const glm::ivec2 &shape)
Spawn a point using a 2D Gaussian distribution.
Definition spawner.cpp:93
glm::ivec2 spawn_uniform(std::mt19937 &rng, const glm::ivec2 &shape)
Spawn a point uniformly over the full grid.
Definition spawner.cpp:136
glm::ivec2 spawn_borders(std::mt19937 &rng, int nbuffer, const glm::ivec2 &shape)
Spawn a point uniformly along the border of a 2D grid.
Definition spawner.cpp:13