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

Stands a card in for the MeshRenderer beside it once the object covers less than screenSize of the view. More...

#include <Impostor.hpp>

Public Member Functions

 Impostor ()=default

Public Attributes

f32 screenSize {0.06f}
 Fraction of the viewport height below which the card replaces the mesh.
i32 frames {8}
 Directions along each side of the atlas: frames x frames pictures in all.
i32 resolution {1024}
 The atlas's side in pixels.
bool enabled {true}

Detailed Description

Stands a card in for the MeshRenderer beside it once the object covers less than screenSize of the view.

The mesh is photographed from frames x frames directions over the upper half of a sphere into one atlas, as it is lit when the pictures are taken. Each view then draws the picture taken nearest its own direction to the object, on a card facing it, and every impostor that shares an atlas is drawn with the others: a forest on the horizon is a handful of draws. The atlas is shared by every entity with the same mesh, material, texture and colour.

What it cannot do: the light is the light at the time of the pictures, the picture changes in steps as the view moves round, a card casts no shadow and is not seen from below.

Definition at line 32 of file Impostor.hpp.

Constructor & Destructor Documentation

◆ Impostor()

esengine::ecs::Impostor::Impostor ( )
default

Member Data Documentation

◆ enabled

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

Definition at line 46 of file Impostor.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ frames

i32 esengine::ecs::Impostor::frames {8}

Directions along each side of the atlas: frames x frames pictures in all.

Definition at line 39 of file Impostor.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ resolution

i32 esengine::ecs::Impostor::resolution {1024}

The atlas's side in pixels.

Definition at line 43 of file Impostor.hpp.

Referenced by EMSCRIPTEN_BINDINGS().

◆ screenSize

f32 esengine::ecs::Impostor::screenSize {0.06f}

Fraction of the viewport height below which the card replaces the mesh.

Definition at line 35 of file Impostor.hpp.

Referenced by EMSCRIPTEN_BINDINGS().


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