Skip to content

Commit

Permalink
Minor fix in AKSceneTracker6DOF
Browse files Browse the repository at this point in the history
Summary: In the normals of a triangles are invalid, we need to ensure that we are testing the replacement triangle (from the back) as in the next loop (and not skipping it).

Reviewed By: enpe

Differential Revision: D64418240

fbshipit-source-id: b5143d617b8119bd2498892dfb01f3f6b0fd9fc9
  • Loading branch information
janherling authored and facebook-github-bot committed Oct 16, 2024
1 parent 2b152a9 commit 34b7736
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion impl/ocean/devices/arkit/AKSceneTracker6DOF.mm
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@

// ARKit sometimes provides invalid per-vertex normals, we remove these triangles

for (size_t n = 0; n < triangleIndices.size(); n += 3)
for (size_t n = 0; n < triangleIndices.size(); /*noop*/)
{
if (Numeric::isNan(perVertexNormals[triangleIndices[n + 0]].x())
|| Numeric::isNan(perVertexNormals[triangleIndices[n + 1]].x())
Expand All @@ -297,6 +297,10 @@

triangleIndices.resize(triangleIndices.size() - 3);
}
else
{
n += 3;
}
}

if (!triangleIndices.empty())
Expand Down

0 comments on commit 34b7736

Please sign in to comment.