2021-03-19 22:11:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "tarray.h"
|
|
|
|
#include "vectors.h"
|
|
|
|
#include "build.h"
|
|
|
|
|
|
|
|
struct SectorGeometryPlane
|
|
|
|
{
|
|
|
|
TArray<FVector3> vertices;
|
|
|
|
TArray<FVector2> texcoords;
|
|
|
|
FVector3 normal{};
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SectorGeometryData
|
|
|
|
{
|
|
|
|
SectorGeometryPlane planes[2];
|
|
|
|
sectortype compare{};
|
2021-03-29 07:25:26 +00:00
|
|
|
vec2_t poscompare{ };
|
|
|
|
vec2_t poscompare2{ };
|
2021-03-19 22:11:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SectorGeometry
|
|
|
|
{
|
|
|
|
TArray<SectorGeometryData> data;
|
|
|
|
|
|
|
|
void ValidateSector(unsigned sectnum, int plane);
|
|
|
|
void MakeVertices(unsigned sectnum, int plane);
|
|
|
|
|
|
|
|
public:
|
|
|
|
SectorGeometryPlane* get(unsigned sectnum, int plane)
|
|
|
|
{
|
|
|
|
if (sectnum >= data.Size()) return nullptr;
|
|
|
|
ValidateSector(sectnum, plane);
|
|
|
|
return &data[sectnum].planes[plane];
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetSize(unsigned sectcount)
|
|
|
|
{
|
|
|
|
data.Clear(); // delete old content
|
|
|
|
data.Resize(sectcount);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
extern SectorGeometry sectorGeometry;
|
|
|
|
|
|
|
|
|