Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
LODGroup.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
13#pragma once
14
15#include "../../core/Types.hpp"
18
19namespace esengine::ecs {
20
29ES_COMPONENT(stability=beta)
30struct LODGroup {
32 ES_PROPERTY(asset = mesh, tooltip="Geometry drawn below the LOD 1 screen size.")
33 resource::MeshHandle lod1;
34
36 ES_PROPERTY(asset = mesh, tooltip="Geometry drawn below the LOD 2 screen size.")
37 resource::MeshHandle lod2;
38
40 ES_PROPERTY(asset = mesh, tooltip="Geometry drawn below the LOD 3 screen size.")
41 resource::MeshHandle lod3;
42
45 ES_PROPERTY(min=0, max=1, tooltip="Screen height fraction below which LOD 1 takes over.")
47
48 ES_PROPERTY(min=0, max=1, tooltip="Screen height fraction below which LOD 2 takes over.")
49 f32 lod2Size{0.25f};
50
51 ES_PROPERTY(min=0, max=1, tooltip="Screen height fraction below which LOD 3 takes over.")
53
56 ES_PROPERTY(min=0, max=1, tooltip="Screen height fraction below which nothing is drawn (0 = never).")
57 f32 cullSize{0.02f};
58
62 ES_PROPERTY(min=0, max=1, advanced, tooltip="Extra fraction to grow past a threshold before the finer level returns.")
64
65 ES_PROPERTY(tooltip="Off: the MeshRenderer's own mesh is always drawn.")
66 bool enabled{true};
67
68 LODGroup() = default;
69};
70
71} // namespace esengine::ecs
Type-safe resource handle system.
Reflection and metadata system for automatic binding generation.
#define ES_COMPONENT(...)
Mark a struct/class as a component that should be exposed to scripts.
#define ES_PROPERTY(...)
Mark a field as a property that should be exposed to scripts.
Core type definitions and utilities for ESEngine.
float f32
32-bit floating point
Definition Types.hpp:59
f32 lod1Size
Fraction of the viewport height below which lod1 replaces the MeshRenderer's own mesh....
Definition LODGroup.hpp:46
resource::MeshHandle lod1
Geometry drawn once the object is smaller than lod1Size.
Definition LODGroup.hpp:33
resource::MeshHandle lod3
Geometry drawn once the object is smaller than lod3Size.
Definition LODGroup.hpp:41
f32 cullSize
Fraction of the viewport height below which nothing is drawn at all. 0 disables it,...
Definition LODGroup.hpp:57
resource::MeshHandle lod2
Geometry drawn once the object is smaller than lod2Size.
Definition LODGroup.hpp:37
f32 hysteresis
How much further than a threshold the object must grow before the finer level comes back — 0....
Definition LODGroup.hpp:63