MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / validateVertex

Function validateVertex

Source/Falcor/Scene/SceneBuilder.cpp:152–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150 };
151
152 void validateVertex(const SceneBuilder::Mesh::Vertex& v, size_t& invalidCount, size_t& zeroCount)
153 {
154 auto isInvalid = [](const auto& x)
155 {
156 return any(isinf(x) || isnan(x));
157 };
158 auto isZero = [](const auto& x)
159 {
160 return length(x) < 1e-6f;
161 };
162
163 if (isInvalid(v.position) || isInvalid(v.normal) || isInvalid(v.tangent) || isInvalid(v.texCrd) || isInvalid(v.boneWeights)) invalidCount++;
164 if (isZero(v.normal) || isZero(v.tangent.xyz())) zeroCount++;
165 }
166
167 bool compareVertices(const SceneBuilder::Mesh::Vertex& lhs, const SceneBuilder::Mesh::Vertex& rhs, float threshold = 1e-6f)
168 {

Callers 1

processMeshMethod · 0.85

Calls 4

anyFunction · 0.50
isinfFunction · 0.50
isnanFunction · 0.50
lengthFunction · 0.50

Tested by

no test coverage detected