mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-28 04:20:45 +00:00
88706e8e13
Now it only needs recreation if the sector changes.
44 lines
No EOL
769 B
C++
44 lines
No EOL
769 B
C++
#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{};
|
|
};
|
|
|
|
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;
|
|
|
|
|