3#include "../structs/displacements.hpp"
4#include "../structs/geometry.hpp"
5#include "../structs/textures.hpp"
6#include "../vertex.hpp"
17 static constexpr uint8_t CORNER_LOWER_LEFT = 0;
18 static constexpr uint8_t CORNER_UPPER_LEFT = 1;
19 static constexpr uint8_t CORNER_UPPER_RIGHT = 2;
20 static constexpr uint8_t CORNER_LOWER_RIGHT = 3;
22 static constexpr uint8_t EDGE_LEFT = 0;
23 static constexpr uint8_t EDGE_TOP = 1;
24 static constexpr uint8_t EDGE_RIGHT = 2;
25 static constexpr uint8_t EDGE_BOTTOM = 3;
29 std::span<const Structs::DispVert> dispVertices,
30 std::span<const Structs::Edge> edges,
31 std::span<const Structs::Vector> vertices,
32 std::span<const int32_t> surfaceEdges,
41 std::vector<Vertex> vertices;
43 size_t numVerticesPerAxis;
45 std::array<Structs::DispNeighbour, 4> edgeNeighbours;
46 std::array<std::vector<uint16_t>, 4> cornerNeighbours;
48 [[nodiscard]]
size_t getTriangleListIndexCount()
const;
49 void generateTriangleListIndices(
const std::function<
void(uint32_t i0, uint32_t i1, uint32_t i2)>& iteratee)
const;
52 [[nodiscard]] std::vector<Vertex> triangulate(
53 std::span<const Structs::DispVert> dispVertices,
54 std::span<const Structs::Edge> edges,
55 std::span<const Structs::Vector> vertices,
56 std::span<const int32_t> surfaceEdges
59 void generateInternalNormals();
60 [[nodiscard]]
Structs::Vector generateInternalNormal(
size_t x,
size_t y)
const;
62 [[nodiscard]]
size_t getVertexIndex(
size_t x,
size_t y)
const;
63 [[nodiscard]]
const Vertex& getVertex(
size_t x,
size_t y)
const;
Definition: triangulated-displacement.hpp:15
Definition: BSPParser.hpp:8
Definition: displacements.hpp:29
Definition: textures.hpp:15
Definition: textures.hpp:8
Definition: common.hpp:18