TerraForge3D  2.3.1
3D Terrain And Landscape Generator
Heightmap.h
1#pragma once
2
3#include <vector>
4#include <string>
5
7{
8public:
9 Heightmap(uint32_t width, uint32_t height) : m_Width(width), m_Height(height) {}
10 Heightmap(const std::string path);
11 ~Heightmap();
12
13 std::string GetPath() const
14 {
15 return m_Path;
16 }
17 uint32_t GetWidth() const
18 {
19 return m_Width;
20 }
21 uint32_t GetHeight() const
22 {
23 return m_Height;
24 }
25 uint16_t *GetData() const
26 {
27 return m_Data;
28 }
29 uint32_t GetRendererID() const
30 {
31 return m_RendererID;
32 }
33
34 uint16_t Sample(float x, float y, bool interpolated) const;
35
36private:
37 uint32_t m_Width, m_Height;
38 uint16_t *m_Data;
39 uint32_t m_RendererID;
40
41 std::string m_Path;
42
43 uint16_t Get(uint32_t x, uint32_t y) const;
44};