forked from ademirtug/digital_globe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspheroid.h
53 lines (40 loc) · 1.16 KB
/
spheroid.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include "de2.h"
#include <iostream>
#include <set>
#include "glm/glm.hpp"
#include "util.h"
#include "map_provider.h"
struct earth {};
struct plate_name {
std::string name;
};
class plate : public mesh {
size_t resolution_{ 0 };
public:
plate(std::string plate_path, size_t resolution);
box b;
std::string plate_path_;
corner_normals cn;
};
class earth_plate : public texture_model {
public:
earth_plate(std::string plate_path, size_t resolution = 16);
~earth_plate();
static map_quest<disk_store>& get_provider();
};
class spheroid : public sub_system<renderer_system> {
public:
spheroid(double semi_axis_a, double semi_axis_c) : earth_a(semi_axis_a), c(semi_axis_c) {}
void process(ecs_s::registry& world, renderer_system& renderer);
corner_normals& get_corner_normals(std::string plate_path);
size_t resolution{ 32 };
private:
void evaluate_completed_requests(ecs_s::registry& world);
using rtype = decltype(std::declval<de2>().load_model_async<model>());
double earth_a{ .0f }, c{ .0f };
std::map<std::string, rtype> requests_made_;
std::vector<rtype> vertices;
//corner normals cache;
lru_cache<std::string, corner_normals> cn_cache;
};