group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
TeslaBeamEffect.hpp File Reference

Continuous, curved energy-arc beam for the auto-lock Tesla Cannon. More...

#include "particles/ParticleTypes.hpp"
#include <cstdint>
#include <glm/glm.hpp>
#include <vector>
Include dependency graph for TeslaBeamEffect.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TeslaBeamEffect
 Sustained curved energy-arc beams, keyed by owner entity id. More...
struct  TeslaBeamEffect::Branch
 One forked branch diverging from the main arc. More...
struct  TeslaBeamEffect::Beam
 State for a single sustained, curved beam. More...

Detailed Description

Continuous, curved energy-arc beam for the auto-lock Tesla Cannon.

Adapted from HitscanEffect (the instant fBm lightning bolt) but reworked for a sustained beam that visibly bows toward its locked target instead of snapping in a straight line from barrel to hit point. Each active beam is driven every frame by the owning entity's BeamState (origin + locked-target point); when the owner stops firing the beam is no longer driven and fades.

Signal chain per frame (per beam): t [0,1] along a deeply-bowed cubic Bezier spine (sag toward target) -> domain-warped 4-octave fBm crackle, perpendicular to the spine -> sin(t*pi) envelope (pinned at both endpoints) plus a few forked branches for the Winston "tesla" look.

Rendering: three additive triangle-strip layers (bloom / channel / white-hot core) in the energy-green palette, matching the beam point-light colour.