Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
LodSelection.hpp File Reference

Which representation an object's size on screen asks for. More...

#include "../../core/Types.hpp"
#include "../../math/Math.hpp"
#include <glm/gtc/quaternion.hpp>
#include <cmath>
Include dependency graph for LodSelection.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  esengine::lod::LevelSet
 The screen sizes a group hands over at, in the order it hands them over. More...
struct  esengine::lod::SelectionCounts
 What a frame's selections came to, counted where each one is made. More...

Namespaces

namespace  esengine
namespace  esengine::lod

Functions

void esengine::lod::boundingSphere (const glm::vec3 &position, const glm::quat &rotation, const glm::vec3 &scale, const glm::vec3 &localMin, const glm::vec3 &localMax, glm::vec3 &outCentre, f32 &outRadius)
 The sphere a group is measured by: its centre in the world and its radius.
f32 esengine::lod::screenRelativeSize (const glm::mat4 &viewProjection, const glm::vec3 &centre, f32 radius)
 How much of the viewport's HEIGHT a sphere covers: 1 = one screen high.
u8 esengine::lod::selectLevel (const LevelSet &set, f32 size, u8 current)
 The level size asks for, given the one shown last.

Variables

constexpr u8 esengine::lod::kMaxStandIns = 3
 How many stand-ins a group may declare beyond the renderer's own mesh.
constexpr u8 esengine::lod::kCulled = 0xFFu
 The level of an object small enough that nothing is drawn for it.
constexpr f32 esengine::lod::kSizeAtEye = 1e30f
 What a point at or behind the eye reports.

Detailed Description

Which representation an object's size on screen asks for.

Header-only and free of the renderer, so the arithmetic can be held against its own claims without a device: a projection, a sphere and the level last shown are the whole input.

Definition in file LodSelection.hpp.