MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / hasFaceWithProperties

Function hasFaceWithProperties

test/MapExport.cpp:161–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159};
160
161inline bool hasFaceWithProperties(const std::vector<XmlFace>& faces, const std::string& material, unsigned int contentsFlag,
162 const Plane3& plane, double xx, double yx, double tx, double xy, double yy, double ty)
163{
164 constexpr double Epsilon = 0.001;
165
166 for (const auto& face : faces)
167 {
168 if (face.material != material) continue;
169
170 if (face.contentsFlag != contentsFlag) continue;
171
172 if (!math::isNear(face.plane.normal(), plane.normal(), Epsilon)) continue;
173 if (std::abs(face.plane.dist() - plane.dist()) > Epsilon) continue;
174
175 if (std::abs(face.textureMatrix.xx() - xx) > Epsilon) continue;
176 if (std::abs(face.textureMatrix.yx() - yx) > Epsilon) continue;
177 if (std::abs(face.textureMatrix.zx() - tx) > Epsilon) continue;
178 if (std::abs(face.textureMatrix.xy() - xy) > Epsilon) continue;
179 if (std::abs(face.textureMatrix.yy() - yy) > Epsilon) continue;
180 if (std::abs(face.textureMatrix.zy() - ty) > Epsilon) continue;
181
182 return true;
183 }
184
185 return false;
186}
187
188TEST_F(MapExportTest, exportDoom3BrushPortable)
189{

Callers 1

TEST_FFunction · 0.85

Calls 1

isNearFunction · 0.50

Tested by

no test coverage detected