group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
RibbonEmitter.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <glm/glm.hpp>
7
13{
14 static constexpr int MaxNodes = 32;
15
17 struct Node
18 {
19 glm::vec3 pos{};
20 float age = 0.f;
21 };
22
24 int count = 0;
25 int head = 0;
26
27 float width = 4.f;
28 float maxAge = 0.4f;
29 float recordInterval = 0.016f;
30 float recordAccumulator = 0.f;
31
32 glm::vec4 tipColor{1.f, 0.6f, 0.1f, 1.f};
33 glm::vec4 tailColor{1.f, 0.3f, 0.0f, 0.f};
34};
A single recorded point along the ribbon trail.
Definition RibbonEmitter.hpp:18
glm::vec3 pos
World-space position of this node.
Definition RibbonEmitter.hpp:19
float age
Seconds since this node was recorded.
Definition RibbonEmitter.hpp:20
Component attached to slow/arcing projectile entities (rockets, slow bolts).
Definition RibbonEmitter.hpp:13
float recordInterval
Seconds between node recordings (~60 Hz).
Definition RibbonEmitter.hpp:29
glm::vec4 tailColor
Color at the tail (fades to transparent).
Definition RibbonEmitter.hpp:33
float recordAccumulator
Accumulator for sub-frame node recording.
Definition RibbonEmitter.hpp:30
int count
Number of live nodes.
Definition RibbonEmitter.hpp:24
static constexpr int MaxNodes
Definition RibbonEmitter.hpp:14
Node nodes[MaxNodes]
Definition RibbonEmitter.hpp:23
float maxAge
Nodes older than this are dropped.
Definition RibbonEmitter.hpp:28
glm::vec4 tipColor
Color at the rocket tip (newest node).
Definition RibbonEmitter.hpp:32
int head
Ring-buffer insertion index.
Definition RibbonEmitter.hpp:25
float width
Half-width of ribbon in world units.
Definition RibbonEmitter.hpp:27