8 if (!destroyConn_.isConnected()) {
10 states_.erase(entity);
17 for (
auto entity : view) {
21 if (!
trail.enabled)
continue;
25 const glm::vec3& pos = transform.worldPosition;
27 auto it = states_.find(entity);
28 if (it == states_.end()) {
29 if (!
trail.emitting)
continue;
30 it = states_.try_emplace(entity).first;
32 auto& state = it->second;
38 bool record = state.points.empty();
40 glm::vec3 d = pos - state.points.back().position;
42 record = glm::dot(d, d) >= md * md;
45 state.points.push_back({pos, time_});
51 while (!state.points.empty() && state.points.front().birth_time < cutoff) {
52 state.points.pop_front();
55 if (state.points.empty()) {