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

The frame's reflection probes, and the lookup that picks one. More...

#include <ReflectionStore.hpp>

Classes

struct  Probe
 One probe: the world box it answers inside, and its atlas column. More...

Public Member Functions

void clear ()
bool add (const glm::vec3 &min, const glm::vec3 &max, u32 slot, u32 environment)
 Takes a probe, or refuses one nothing can read.
bool empty () const
u32 count () const
u64 revision () const
 What the frame's reflection probes say, as a number that changes whenever it does (see core/Revision.hpp): asked after the collect, it moves only when this frame's set differs from the one it last answered for.
u32 environment () const
 The baked environment every probe of this frame reads, or 0.
u32 slotAt (const glm::vec3 &p) const
 The column a point at p reflects, or 0 for the environment.
u32 slotForBox (const glm::vec3 &centre, const glm::vec3 &half) const
 The column a whole object reflects, by its world box rather than its origin (ProbeStore::sampleBox's rule): its centre's, else the smallest probe the box overlaps. An imported level's walls keep their origin at the world's centre, outside the room they stand in.
const std::vector< Probe > & probes () const
 The probes themselves, for the frame block that carries their boxes.

Detailed Description

The frame's reflection probes, and the lookup that picks one.

Definition at line 30 of file ReflectionStore.hpp.

Member Function Documentation

◆ add()

bool esengine::ReflectionStore::add ( const glm::vec3 & min,
const glm::vec3 & max,
u32 slot,
u32 environment )
inline

Takes a probe, or refuses one nothing can read.

A probe past the last addressable column is DROPPED rather than clamped into another probe's: clamping would light a room with the reflection of whichever room happened to be baked at that number.

Definition at line 51 of file ReflectionStore.hpp.

References environment(), and esengine::MAX_REFLECTION_PROBES.

◆ clear()

void esengine::ReflectionStore::clear ( )
inline

Definition at line 39 of file ReflectionStore.hpp.

◆ count()

u32 esengine::ReflectionStore::count ( ) const
inline

Definition at line 63 of file ReflectionStore.hpp.

◆ empty()

bool esengine::ReflectionStore::empty ( ) const
inline

Definition at line 62 of file ReflectionStore.hpp.

◆ environment()

u32 esengine::ReflectionStore::environment ( ) const
inline

The baked environment every probe of this frame reads, or 0.

Definition at line 87 of file ReflectionStore.hpp.

Referenced by add().

◆ probes()

const std::vector< Probe > & esengine::ReflectionStore::probes ( ) const
inline

The probes themselves, for the frame block that carries their boxes.

Definition at line 130 of file ReflectionStore.hpp.

◆ revision()

u64 esengine::ReflectionStore::revision ( ) const
inline

What the frame's reflection probes say, as a number that changes whenever it does (see core/Revision.hpp): asked after the collect, it moves only when this frame's set differs from the one it last answered for.

Definition at line 69 of file ReflectionStore.hpp.

References esengine::hash::fnv1aBytes(), esengine::hash::kFnv64Offset, and esengine::nextRevision().

◆ slotAt()

u32 esengine::ReflectionStore::slotAt ( const glm::vec3 & p) const
inline

The column a point at p reflects, or 0 for the environment.

Where two probes overlap the SMALLER wins, the rule ProbeStore takes: a cupboard inside a hall was baked to say what the hall's probe could not.

Definition at line 96 of file ReflectionStore.hpp.

References esengine::ReflectionStore::Probe::slot.

Referenced by slotForBox().

◆ slotForBox()

u32 esengine::ReflectionStore::slotForBox ( const glm::vec3 & centre,
const glm::vec3 & half ) const
inline

The column a whole object reflects, by its world box rather than its origin (ProbeStore::sampleBox's rule): its centre's, else the smallest probe the box overlaps. An imported level's walls keep their origin at the world's centre, outside the room they stand in.

Definition at line 114 of file ReflectionStore.hpp.

References esengine::ReflectionStore::Probe::slot, and slotAt().


The documentation for this class was generated from the following file: