FastLED 3.9.15
Loading...
Searching...
No Matches

◆ spawnMeteor()

void fl::PerlinParticlePunch::spawnMeteor ( float intensity = 1.0f)

Spawn a BEAT meteor at position 0, traveling toward end of strip.

Parameters
intensity0.0-1.0, controls speed, head brightness, debris.

Definition at line 163 of file perlin_particle_punch.cpp.hpp.

163 {
165 if (!m)
166 return;
167 if (intensity < 0.0f)
168 intensity = 0.0f;
169 if (intensity > 1.0f)
170 intensity = 1.0f;
171 m->alive = true;
172 m->position = 0.0f;
173 m->velocity = (1.5f + intensity * 5.0f) * mSpeed;
174 m->intensity = intensity;
175 m->debrisSpawned = 0;
176 m->maxDebris = u8(5 + intensity * 5);
177 m->frameCounter = 0;
178}
unsigned char u8
Definition stdint.h:131

References fl::PerlinParticlePunch::MeteorParticle::alive, fl::PerlinParticlePunch::MeteorParticle::debrisSpawned, fl::PerlinParticlePunch::MeteorParticle::frameCounter, fl::PerlinParticlePunch::MeteorParticle::intensity, fl::PerlinParticlePunch::MeteorParticle::maxDebris, mSpeed, fl::PerlinParticlePunch::MeteorParticle::position, tryAllocateMeteor(), and fl::PerlinParticlePunch::MeteorParticle::velocity.

Referenced by ~PerlinParticlePunch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: