Implement terrain file reading to generate navmeshes in the future (#703)

* Implement terrain file reading to generate navmeshes in the future

* Make Emo's suggested changes.
This commit is contained in:
Jett
2022-08-04 01:59:47 +01:00
committed by GitHub
parent d2b05a1ac5
commit e6c7f744b5
13 changed files with 300 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
#include "RawHeightMap.h"
#include "BinaryIO.h"
RawHeightMap::RawHeightMap() {}
RawHeightMap::RawHeightMap(std::ifstream& stream, float height, float width) {
// Read in height map data header and scale
BinaryIO::BinaryRead(stream, m_Unknown1);
BinaryIO::BinaryRead(stream, m_Unknown2);
BinaryIO::BinaryRead(stream, m_Unknown3);
BinaryIO::BinaryRead(stream, m_Unknown4);
BinaryIO::BinaryRead(stream, m_ScaleFactor);
// read all vertices in
for (uint64_t i = 0; i < width * height; i++) {
float value;
BinaryIO::BinaryRead(stream, value);
m_FloatMap.push_back(value);
}
}
RawHeightMap::~RawHeightMap() {
}