Cogs.Core
OGC3DTilesTileset.h
1#pragma once
2
3#include "OGC3DTiles.h"
4
5#include <Resources/DataFetcherManager.h>
6
7#include <Foundation/Geometry/Glm.hpp>
8
9#include <vector>
10#include <string>
11#include <functional>
12
13namespace Cogs::Core {
14 class Context;
15
16 namespace OGC3DTilesTileset {
17 //
18 // See https://github.com/CesiumGS/3d-tiles/blob/main/specification/schema/README.md for
19 // documentation on the JSON schemas
20 //
21
22 enum class RefineType {
23 DEFAULT = 0,
24 REPLACE = DEFAULT,
25 ADD = 1
26 };
27
28 struct Content {
29 std::string URI;
30 OGC3DTiles::BoundingVolume boundingVolume;
31 uint32_t group = 0;
32 };
33
35 bool isOctTree = false; // False => Quadtree
36 uint8_t availableLevels = 0; // Global depth of tree
37 uint8_t subtreeLevels = 0; // How many levels in in each subtree
38 std::string subTreeURLScheme; // Naming scheme for subtree files
39 };
40
41 struct Tile {
42 OGC3DTiles::BoundingVolume boundingVolume;
43 glm::dmat4 transform;
44 float geometricError = 0.0;
45 std::vector<Content> contents;
46 std::vector<Tile> children;
47 bool useImplicitTiling = false;
48 ImplicitTiling implicitTiling;
49 RefineType refine = RefineType::DEFAULT;
50 };
51
52 struct Tileset {
53 // NOTE: This struct is somewhat a flattened and shortened version of the "tileset.json" structure for easier use in C++ land.
54 // This means that certain optional features in the 3DTiles spec are now required.
55 std::string version;
56 float geometricError = 0.0;
57 Tile root;
58 std::string baseURL = "";
59 };
60
61 using FetchCallback = std::function<void(Tileset* mainTileset)>;
62 Cogs::Core::DataFetcherManager::FetchId fetch(Context* context, const std::string& baseURL, FetchCallback callback);
63 }
64}
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....