-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapping.h
60 lines (53 loc) · 1.44 KB
/
mapping.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
53
54
55
56
57
58
59
60
#pragma once
#include <thread>
#include <DirectXMath.h>
#include <noise/noise.h>
#include "noiseutils.h"
#include "maths.h"
using namespace DirectX;
enum Biome
{
BIOME_NONE,
BIOME_TUNDRA,
BIOME_SNOW,
BIOME_DESERT_COLD,
BIOME_DESERT_HOT,
BIOME_FOREST_BOREAL,
BIOME_FOREST_TEMPERATE_RAIN,
BIOME_FOREST_TEMPERATE_SEASONAL,
BIOME_FOREST_TROPICAL_RAIN,
BIOME_FOREST_TROPICAL_SEASONAL,
BIOME_WOODLAND
};
class Mapping
{
public:
Mapping();
void Setup(int _hres, float m_temp, XMFLOAT3 perlin, XMFLOAT3 mapPerlin, float waterHeight, float flatten);
void CreateMaps(int _hres, float m_temp, XMFLOAT3 perlin, XMFLOAT3 mapPerlin, float waterHeight, float flatten);
void CreateHeightMap(float m_temp, XMFLOAT3 perlin, XMFLOAT3 mapPerlin, float waterHeight, float flatten);
void HeightmapThread(int z, float temp, XMFLOAT3 perlin, XMFLOAT3 mapPerlin, float waterHeight, float flatten);
bool Shutdown();
float GetHeightMapValue(int face, int x, int y);
float GetHeightMapValueFloat(int face, float xCoordFloat, float yCoordFloat);
XMFLOAT3 GetColorMapValue(int face, int x, int y);
int GetHeightMapRes();
bool IsBuilt();
bool IsBuilding();
void Cancel();
bool Cancelled();
float GetWaterHeight();
void SetPlanet(void* planet);
void* CurrentPlanet();
private:
//heightmap
float* h_map;
XMFLOAT3* c_map;
int h_res;
bool h_built = false;
bool h_building = false;
bool cancel = false;
int h_finished = 0;
float m_waterHeight;
void* m_planet;
};