Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::ecs::LODGroup Struct Reference

Stand-in geometry chosen by how much of the screen the object covers. More...

#include <LODGroup.hpp>

Public Member Functions

 LODGroup ()=default

Public Attributes

resource::MeshHandle lod1
 Geometry drawn once the object is smaller than lod1Size.
resource::MeshHandle lod2
 Geometry drawn once the object is smaller than lod2Size.
resource::MeshHandle lod3
 Geometry drawn once the object is smaller than lod3Size.
f32 lod1Size {0.5f}
 Fraction of the viewport height below which lod1 replaces the MeshRenderer's own mesh. The sizes must descend.
f32 lod2Size {0.25f}
f32 lod3Size {0.1f}
f32 cullSize {0.02f}
 Fraction of the viewport height below which nothing is drawn at all. 0 disables it, so a group without one is never invisible.
f32 hysteresis {0.1f}
 How much further than a threshold the object must grow before the finer level comes back — 0.1 turns a 0.20 boundary into 0.20 down, 0.22 up. Zero lets a level flip every frame at the boundary.
bool enabled {true}

Detailed Description

Stand-in geometry chosen by how much of the screen the object covers.

The MeshRenderer beside it stays level 0; this says what may be drawn instead as it shrinks. Thresholds are fractions of the viewport HEIGHT, which hold across resolutions, fields of view and both projections where a distance holds across none. Selection belongs to the VIEW, not the entity.

Definition at line 30 of file LODGroup.hpp.

Constructor & Destructor Documentation

◆ LODGroup()

esengine::ecs::LODGroup::LODGroup ( )
default

Member Data Documentation

◆ cullSize

f32 esengine::ecs::LODGroup::cullSize {0.02f}

Fraction of the viewport height below which nothing is drawn at all. 0 disables it, so a group without one is never invisible.

Definition at line 57 of file LODGroup.hpp.

Referenced by esengine::gatherLodLevels(), lodgroupApplyJS(), and lodgroupToJS().

◆ enabled

bool esengine::ecs::LODGroup::enabled {true}

Definition at line 66 of file LODGroup.hpp.

Referenced by lodgroupApplyJS(), and lodgroupToJS().

◆ hysteresis

f32 esengine::ecs::LODGroup::hysteresis {0.1f}

How much further than a threshold the object must grow before the finer level comes back — 0.1 turns a 0.20 boundary into 0.20 down, 0.22 up. Zero lets a level flip every frame at the boundary.

Definition at line 63 of file LODGroup.hpp.

Referenced by esengine::gatherLodLevels(), lodgroupApplyJS(), and lodgroupToJS().

◆ lod1

resource::MeshHandle esengine::ecs::LODGroup::lod1

Geometry drawn once the object is smaller than lod1Size.

Definition at line 33 of file LODGroup.hpp.

Referenced by esengine::gatherLodLevels(), lodgroupApplyJS(), and lodgroupToJS().

◆ lod1Size

f32 esengine::ecs::LODGroup::lod1Size {0.5f}

Fraction of the viewport height below which lod1 replaces the MeshRenderer's own mesh. The sizes must descend.

Definition at line 46 of file LODGroup.hpp.

Referenced by esengine::gatherLodLevels(), lodgroupApplyJS(), and lodgroupToJS().

◆ lod2

resource::MeshHandle esengine::ecs::LODGroup::lod2

Geometry drawn once the object is smaller than lod2Size.

Definition at line 37 of file LODGroup.hpp.

Referenced by esengine::gatherLodLevels(), lodgroupApplyJS(), and lodgroupToJS().

◆ lod2Size

f32 esengine::ecs::LODGroup::lod2Size {0.25f}

Definition at line 49 of file LODGroup.hpp.

Referenced by esengine::gatherLodLevels(), lodgroupApplyJS(), and lodgroupToJS().

◆ lod3

resource::MeshHandle esengine::ecs::LODGroup::lod3

Geometry drawn once the object is smaller than lod3Size.

Definition at line 41 of file LODGroup.hpp.

Referenced by esengine::gatherLodLevels(), lodgroupApplyJS(), and lodgroupToJS().

◆ lod3Size

f32 esengine::ecs::LODGroup::lod3Size {0.1f}

Definition at line 52 of file LODGroup.hpp.

Referenced by esengine::gatherLodLevels(), lodgroupApplyJS(), and lodgroupToJS().


The documentation for this struct was generated from the following file:
  • /home/runner/work/estella/estella/src/esengine/ecs/components/LODGroup.hpp