Skip to content

Commit

Permalink
Upgrade .umd export
Browse files Browse the repository at this point in the history
  • Loading branch information
UnrealKaraulov committed Dec 16, 2024
1 parent 1cae411 commit 0865a84
Show file tree
Hide file tree
Showing 6 changed files with 307 additions and 111 deletions.
13 changes: 12 additions & 1 deletion src/bsp/Bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9871,7 +9871,7 @@ int Bsp::merge_two_models_idx(int src_model, int dst_model, int& tryanotherway)
amax = models[src_model].nMaxs;
bmin = models[dst_model].nMins;
bmax = models[dst_model].nMaxs;

vec3 ent_offset = vec3();

vec3 verts_offset = getCenter(amax, amin) - getCenter(bmax, bmin);
Expand Down Expand Up @@ -10413,6 +10413,17 @@ int Bsp::get_model_from_face(int faceIdx)
return -1;
}

std::vector<int> Bsp::get_faces_from_model(int modelIdx)
{
std::vector<int> result{};
BSPMODEL& mdl = models[modelIdx];
for (int i = 0; i < mdl.nFaces; i++)
{
result.push_back(mdl.iFirstFace + i);
}
return result;
}

int Bsp::get_model_from_leaf(int leafIdx)
{
for (int i = 0; i < modelCount; i++)
Expand Down
1 change: 1 addition & 0 deletions src/bsp/Bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ class Bsp
int get_model_from_face(int faceIdx);
int get_model_from_leaf(int leafIdx);

std::vector<int> get_faces_from_model(int modelIdx);
std::vector<int> get_face_edges(int faceIdx);
std::vector<vec3> get_face_verts(int faceIdx, int limited = INT_MAX);
std::vector<int> get_face_verts_idx(int faceIdx, int limited = INT_MAX);
Expand Down
Loading

0 comments on commit 0865a84

Please sign in to comment.