Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
TrailPlugin.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
3#pragma once
4
7
8#include <vector>
9
10namespace esengine {
11
12namespace trail { class TrailSystem; }
13
16 glm::vec3 pos{0.0f, 0.0f, 0.0f};
17 f32 age01 = 0.0f;
18};
19
29public:
30 void setTrailSystem(trail::TrailSystem* system) { trail_system_ = system; }
31
32 void collect(RenderCollectContext& ctx) override;
33 const char* collectScope() const override { return "render.collect.trail"; }
34
35private:
36 trail::TrailSystem* trail_system_ = nullptr;
37 std::vector<TrailCenter> scratch_center_;
38 std::vector<BatchVertex> scratch_verts_;
39 std::vector<u32> scratch_indices_;
40};
41
42} // namespace esengine
Motion-trail renderer (TrailRenderer component).
const char * collectScope() const override
What this plugin's collect is called in a frame profile.
void collect(RenderCollectContext &ctx) override
void setTrailSystem(trail::TrailSystem *system)
static EstellaContext & ctx()
float f32
32-bit floating point
Definition Types.hpp:59
One centerline sample: world position + normalized age (0 head, 1 tail).