Added particle emitter component

This commit is contained in:
Antoine Pilote
2023-08-02 12:40:12 -04:00
parent ba102e971c
commit 807e9c9a9f
7 changed files with 147 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
#include "src/Scene/Components/ParticleEmitterComponent.h"
namespace Nuake
{
json ParticleEmitterComponent::Serialize()
{
BEGIN_SERIALIZE();
SERIALIZE_VEC4(ParticleColor);
SERIALIZE_VAL(Amount);
SERIALIZE_VAL(Life);
SERIALIZE_VEC3(Gravity);
SERIALIZE_VAL(GravityRandom);
SERIALIZE_VAL(Radius);
END_SERIALIZE();
}
bool ParticleEmitterComponent::Deserialize(const std::string& str)
{
BEGIN_DESERIALIZE();
DESERIALIZE_VEC4(j["ParticleColor"], ParticleColor);
Amount = j["Amount"];
Life = j["Life"];
DESERIALIZE_VEC3(j["Gravity"], Gravity);
GravityRandom = j["GravityRandom"];
Radius = j["Radius"];
return true;
}
}