refactor enums: CursorShape, InterpolationType, ParticleSpawnShape

This commit is contained in:
MihailRis
2025-04-13 14:18:50 +03:00
parent 7749675a61
commit 3be8546bf4
9 changed files with 44 additions and 91 deletions
+8 -4
View File
@@ -5,8 +5,9 @@
#include <vector>
#include "interfaces/Serializable.hpp"
#include "util/EnumMetadata.hpp"
enum ParticleSpawnShape {
enum class ParticleSpawnShape {
/// @brief Coordinates are regulary distributed within
/// the volume of a ball.
BALL = 0,
@@ -18,8 +19,11 @@ enum ParticleSpawnShape {
BOX
};
std::string to_string(ParticleSpawnShape shape);
ParticleSpawnShape ParticleSpawnShape_from(std::string_view s);
VC_ENUM_METADATA(ParticleSpawnShape)
{"ball", ParticleSpawnShape::BALL},
{"sphere", ParticleSpawnShape::SPHERE},
{"box", ParticleSpawnShape::BOX},
VC_ENUM_END
struct ParticlesPreset : public Serializable {
/// @brief Collision detection
@@ -53,7 +57,7 @@ struct ParticlesPreset : public Serializable {
/// @brief Maximum angular velocity
float maxAngularVelocity = 0.0f;
/// @brief Spawn spread shape
ParticleSpawnShape spawnShape = BALL;
ParticleSpawnShape spawnShape = ParticleSpawnShape::BALL;
/// @brief Spawn spread
glm::vec3 spawnSpread {};
/// @brief Texture name