GeometryProcessing: replace invalid vertex position check with checkSlow, and handle invalid positions more cleanly

#rb none
#rnx
#fyi jimmy.andrews

[CL 9965788 by Ryan Schmidt in Dev-Editor branch]
This commit is contained in:
Ryan Schmidt
2019-11-03 22:03:27 -05:00
parent e24511b0ea
commit 148dadcda1
2 changed files with 15 additions and 7 deletions

View File

@@ -569,7 +569,12 @@ FVector3d FRemesher::ComputeSmoothedVertexPos(int vID,
}
FVector3d vSmoothed = smoothFunc(*Mesh, vID, SmoothSpeedT);
check(VectorUtil::IsFinite(vSmoothed)); // this will really catch a lot of bugs...
// @todo we should probably make sure that vertex does not move too far here...
checkSlow(VectorUtil::IsFinite(vSmoothed));
if (VectorUtil::IsFinite(vSmoothed) == false)
{
return Mesh->GetVertex(vID);
}
// project onto either vtx constraint target, or surface target
if (vConstraint.Target != nullptr)

View File

@@ -533,13 +533,16 @@ public:
/** Set vertex position */
inline void SetVertex(int VertexID, const FVector3d& vNewPos)
{
check(VectorUtil::IsFinite(vNewPos));
checkSlow(VectorUtil::IsFinite(vNewPos));
check(IsVertex(VertexID));
int i = 3 * VertexID;
Vertices[i] = vNewPos.X;
Vertices[i + 1] = vNewPos.Y;
Vertices[i + 2] = vNewPos.Z;
UpdateTimeStamp(true, false);
if (VectorUtil::IsFinite(vNewPos))
{
int i = 3 * VertexID;
Vertices[i] = vNewPos.X;
Vertices[i + 1] = vNewPos.Y;
Vertices[i + 2] = vNewPos.Z;
UpdateTimeStamp(true, false);
}
}
/** Get extended vertex information */