BSPParser
Simple and modern library for parsing the Valve BSP format
Loading...
Searching...
No Matches
displacements.hpp
1#pragma once
2
3#include "common.hpp"
4#include "../limits.hpp"
5#include <array>
6#include <cstdint>
7
8namespace BspParser::Structs {
10 uint16_t index = 0xFFFF;
11 uint8_t orientation = 0;
12 uint8_t span = 0;
13 uint8_t neighbourSpan = 0;
14
15 [[nodiscard]] bool isValid() const {
16 return index != 0xFFFF;
17 }
18 };
19
21 std::array<DispSubNeighbour, 2> subNeighbors;
22 };
23
25 std::array<uint16_t, Limits::MAX_DISP_CORNER_NEIGHBORS> neighbours;
26 uint8_t numNeighbours;
27 };
28
29 struct DispInfo {
30 Vector startPosition;
31
32 int32_t dispVertStart;
33 int32_t dispTriStart;
34
35 int32_t power;
36 int32_t minTess;
37
38 float smoothingAngle;
39 int32_t contents;
40 uint16_t mapFace;
41 int32_t lightmapAlphaStart;
42 int32_t lightmapSamplePositionStart;
43
44 std::array<DispNeighbour, 4> edgeNeighbours;
45 std::array<DispCornerNeighbours, 4> cornerNeighbours;
46
47 std::array<uint32_t, 10> allowedVertices;
48 };
49
50 struct DispVert {
51 Vector vec;
52 float dist;
53 float alpha;
54 };
55}
Definition: BSPParser.hpp:22
Definition: displacements.hpp:24
Definition: displacements.hpp:29
Definition: displacements.hpp:20
Definition: displacements.hpp:9
Definition: displacements.hpp:50
Definition: common.hpp:18