mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-16 01:11:28 +00:00
e0fe8d2ed9
SO's vertex interpolation does not use the common framework so it got missed by the sector retriangulation checks. We need to check two wall positions as well to make sure that sector movement is properly detected.
46 lines
No EOL
816 B
C++
46 lines
No EOL
816 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{};
|
|
vec2_t poscompare{ };
|
|
vec2_t poscompare2{ };
|
|
};
|
|
|
|
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;
|
|
|
|
|