diff --git a/include/light/phong.hh b/include/light/phong.hh index 9c9aa360..983b26bb 100644 --- a/include/light/phong.hh +++ b/include/light/phong.hh @@ -46,6 +46,7 @@ const bsp2_dface_t *Face_EdgeIndexSmoothed(const mbsp_t *bsp, const bsp2_dface_t /// a directed edge can be used by more than one face, e.g. two cube touching just along an edge using edgeToFaceMap_t = std::map, std::vector>; +std::vector FacesUsingVert(int vertnum); const edgeToFaceMap_t &GetEdgeToFaceMap(); class face_cache_t { diff --git a/light/phong.cc b/light/phong.cc index 2c848b22..7a97556d 100644 --- a/light/phong.cc +++ b/light/phong.cc @@ -76,6 +76,16 @@ static map> planesToFaces; static edgeToFaceMap_t EdgeToFaceMap; static vector FaceCache; +vector FacesUsingVert(int vertnum) +{ + const auto &vertsToFaces_const = vertsToFaces; + + auto it = vertsToFaces_const.find(vertnum); + if (it != vertsToFaces_const.end()) + return it->second; + return {}; +} + const edgeToFaceMap_t &GetEdgeToFaceMap() { Q_assert(s_builtPhongCaches);