rodecomp/Source/Contents/Ground/TerrainHeight.h
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

33 lines
1.1 KiB
C++

#ifndef RAGNAROK_SOURCE_CONTENTS_GROUND_TERRAINHEIGHT_H
#define RAGNAROK_SOURCE_CONTENTS_GROUND_TERRAINHEIGHT_H
#include <cstdint>
struct TerrainHeightCell {
float heights[4];
std::uint32_t type;
};
struct TerrainHeight {
const int& width;
const int& height;
const int& cellSize;
const TerrainHeightCell* cells;
float Height(float x, float z) const;
float PlaneHeight(float x, float z) const;
const TerrainHeightCell* CellAt(int column, int row) const;
bool Walkable(int column, int row) const;
void CellOrigin(int column, int row, float& x, float& z) const;
void CellCenter(int column, int row, float& x, float& z) const;
void WorldCell(float x, float z, int& column, int& row) const;
void WorldSubcell(float x, float z, int& column, int& row, int& subColumn, int& subRow) const;
void SpatialCell(float x, float z, int& column, int& row) const;
void HeightBounds(const int* rectangle, float& minimum, float& maximum) const;
float RayDistance(const float* ray, int column, int row) const;
};
static_assert(sizeof(TerrainHeightCell) == 20);
#endif