|
group2 0.1.0
CSE 125 Group 2
|
Hitscan energy beam using fBm (fractional Brownian motion) path deviation. More...
#include <HitscanEffect.hpp>
Public Member Functions | |
| void | update (float dt, glm::vec3 camForward) |
| Update all active beams, rebuilding arc vertex data each frame. | |
| void | spawn (glm::vec3 origin, glm::vec3 hitPos, WeaponType wt, glm::vec3 camForward) |
| Fire a beam. | |
| const ArcVertex * | arcData () const |
| Get pointer to the arc vertex array for GPU upload. | |
| uint32_t | arcCount () const |
| Get the number of arc vertices currently generated. | |
| uint32_t | activeBeamCount () const |
| Get the number of active beams. | |
| const HitscanBeam * | beamData () const |
| uint32_t | beamCount () const |
Hitscan energy beam using fBm (fractional Brownian motion) path deviation.
Signal chain per frame: t [0,1] along Bezier spine -> optional domain warp -> 4-octave fBm (lacunarity~3, persistence~0.4) -> multiply by sin(t*pi) envelope (pinned at both endpoints) -> scale by baseAmplitude (16 % of beam length) -> apply perpendicular to Bezier tangent
Rendering: three concentric triangle-strip layers per arc (outer bloom halo, inner glow channel, white-hot core) rendered with additive blending, giving an HDR-like look without a post-process pass.
Temporal behaviour:
| uint32_t HitscanEffect::activeBeamCount | ( | ) | const |
Get the number of active beams.
|
inline |
Get the number of arc vertices currently generated.
|
inline |
Get pointer to the arc vertex array for GPU upload.
|
inline |
|
inline |
| void HitscanEffect::spawn | ( | glm::vec3 | origin, |
| glm::vec3 | hitPos, | ||
| WeaponType | wt, | ||
| glm::vec3 | camForward | ||
| ) |
Fire a beam.
Consecutive shots on the same slot produce a smooth morph.
| origin | World-space beam start position. |
| hitPos | World-space beam end position. |
| wt | Weapon type (reserved for future per-weapon tuning). |
| camForward | Camera forward vector for control-point placement. |
| void HitscanEffect::update | ( | float | dt, |
| glm::vec3 | camForward | ||
| ) |
Update all active beams, rebuilding arc vertex data each frame.
| dt | Frame delta time in seconds. |
| camForward | Camera forward vector for billboard orientation. |