add 'spawn_spread' and 'spawn_shape'

This commit is contained in:
MihailRis
2024-11-03 17:14:30 +03:00
parent 86b83a5377
commit 39893ee940
4 changed files with 68 additions and 2 deletions
+19
View File
@@ -4,6 +4,21 @@
#include "interfaces/Serializable.hpp"
enum ParticleSpawnShape {
/// @brief Coordinates are regulary distributed within
/// the volume of a ball.
BALL = 0,
/// @brief Coordinates are regulary distributed on
/// a sphere.
SPHERE,
/// @brief Coordinates are uniform distributed within
/// the volume of a box.
BOX
};
std::string to_string(ParticleSpawnShape shape);
ParticleSpawnShape ParticleSpawnShape_from(std::string_view s);
struct ParticlesPreset : public Serializable {
/// @brief Collision detection
bool collision = true;
@@ -25,6 +40,10 @@ struct ParticlesPreset : public Serializable {
glm::vec3 explosion {2.0f};
/// @brief Particle size
glm::vec3 size {0.1f};
/// @brief Spawn spread shape
ParticleSpawnShape spawnShape;
/// @brief Spawn spread
glm::vec3 spawnSpread {};
/// @brief Texture name
std::string texture = "";
/// @brief Size of random sub-uv region