Cogs.Core
TexAtlasComponent.h
1#pragma once
2
3#include <vector>
4#include "Foundation/ComponentModel/Component.h"
5#include "Resources/Material.h"
6
7namespace Cogs::Core
8{
9 enum struct TexAtlasProjection : uint32_t
10 {
16 };
17
23 {
24 TexAtlasComponent() = default;
25 std::string path;
26 std::vector<MaterialHandle> materials;
27 std::vector<glm::dvec2> coefficients;
28 float elevation = 0.f;
30 glm::dvec2 domainMin = glm::dvec2(0.0);
31 glm::dvec2 domainMax = glm::dvec2(1.0);
32 glm::dvec2 domainExtentsMin = glm::dvec2(0.0);
33 glm::dvec2 domainExtentsMax = glm::dvec2(0.0);
34 uint32_t minLevel = 0;
35 uint32_t maxLevel = 8;
36 uint32_t index = 0;
37 float tolerance = 1.f / 2048.f;
38 uint32_t maxItemCount = 512;
39 uint32_t timeout = 30;
40 uint32_t minRetryDelay = 2;
42 bool debugBox = false;
43
44 static void registerType();
45 };
46}
47
48template<> inline Cogs::StringView getName<Cogs::Core::TexAtlasComponent>() { return "TexAtlasComponent"; }
49template<> inline Cogs::StringView getName<Cogs::Core::TexAtlasProjection>() { return "TexAtlasProjection"; }
Base class for Component instances.
Definition: Component.h:143
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:50
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
float elevation
Elevation of map to be used for culling and lod'ing. Keep as precise as possible.
float tolerance
Specifies how big a texel should ideally be if screen has size 1.
glm::dvec2 domainMin
Specifies the lower-left corner of the domain that is mapped.
glm::dvec2 domainExtentsMin
Specifies the lower-left corner of the domain. Values in domain units.
glm::dvec2 domainExtentsMax
Specifies the upper-right corner of the domain. Values in domain units.
std::vector< MaterialHandle > materials
Materials that use this atlas.
std::vector< glm::dvec2 > coefficients
Coefficients that specifies the projection.
uint32_t maxLevel
Maximum level to use.
bool restrictBetweenNearAndFar
Restrict visible tiles to the interval between near and far, otherwise all tiles from eye to the inif...
TexAtlasProjection projection
Projection to use.
uint32_t maxItemCount
Maximum number of tiles to use simultaneously.
uint32_t minLevel
Minimum level to use.
uint32_t minRetryDelay
Minimum delay before retrying a failed fetch in seconds. The delay will double with each successive f...
glm::dvec2 domainMax
Specifies the upper-right corner of the domain that is mapped.
uint32_t index
Which atlas this is when a material has multiple atlases.
uint32_t timeout
Time before timing out a fetch, in seconds. Set to zero to disable.
std::string path
Path to tile hierarcy root.
bool debugBox
Render wireframe box that outlines texture position in world.