From 705614909bf3f3bb64c7d5214a5b8b1433ff51d9 Mon Sep 17 00:00:00 2001 From: spatialfree Date: Sat, 21 Dec 2024 09:35:48 -0500 Subject: [PATCH] particle system abstraction to support multiple particle systems --- src/VFX.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/VFX.cs b/src/VFX.cs index a57f225..10e6cc6 100644 --- a/src/VFX.cs +++ b/src/VFX.cs @@ -67,5 +67,25 @@ public class Particle this.vel = Vec3.Zero; this.ori = Quat.Identity; this.scl = 0.0f; + +public class ParticleSystem +{ + public Particle[] particles; + public int count; + public int index; + + public ParticleSystem(int count) + { + this.particles = new Particle[count]; + this.count = count; + this.index = 0; + } + + public void Init() + { + for (int i = 0; i < particles.Length; i++) + { + particles[i] = new(); + } } } \ No newline at end of file