MeshModelingTools: Make CollectSurfacePathMechanic remove preview vertex if there isn't currently a valid one.

#rb Rinat.Abdrashitov
#rnx
#jira UE-118031
#preflight 61e0a3c5797757aace8bd7ff

#ROBOMERGE-AUTHOR: semion.piskarev
#ROBOMERGE-SOURCE: CL 18621566 in //UE5/Release-5.0/... via CL 18621612 via CL 18621664
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18621720 by semion piskarev in ue5-main branch]
This commit is contained in:
semion piskarev
2022-01-14 14:28:47 -05:00
parent 1185ef7d98
commit 0128d4c695
2 changed files with 10 additions and 6 deletions

View File

@@ -54,9 +54,12 @@ void UCollectSurfacePathMechanic::Render(IToolsContextRenderAPI* RenderAPI)
if (!bGeometricCloseOccurred)
{
// This draws the line to the current hover point as a preview
const FLinearColor& DrawPreviewColor = (bCurrentPreviewWillComplete || bGeometricCloseOccurred) ? PathCompleteColor : PreviewColor;
PathDrawer.DrawLine(HitPath[NumPoints].Origin, PreviewPathPoint.Origin, DrawPreviewColor);
if (bPreviewPathPointValid)
{
// This draws the line to the current hover point as a preview
const FLinearColor& DrawPreviewColor = (bCurrentPreviewWillComplete || bGeometricCloseOccurred) ? PathCompleteColor : PreviewColor;
PathDrawer.DrawLine(HitPath[NumPoints].Origin, PreviewPathPoint.Origin, DrawPreviewColor);
}
}
else if (LoopWasClosed())
{
@@ -65,7 +68,7 @@ void UCollectSurfacePathMechanic::Render(IToolsContextRenderAPI* RenderAPI)
}
}
if (!bGeometricCloseOccurred)
if (!bGeometricCloseOccurred && bPreviewPathPointValid)
{
PathDrawer.DrawPoint(PreviewPathPoint.Origin, PreviewColor, PathDrawer.PointSize, PathDrawer.bDepthTested);
}
@@ -121,7 +124,8 @@ bool UCollectSurfacePathMechanic::IsHitByRay(const FRay3d& Ray, FFrame3d& HitPoi
bool UCollectSurfacePathMechanic::UpdatePreviewPoint(const FRay3d& Ray)
{
FFrame3d PreviewPoint;
if ( RayToPathPoint(Ray, PreviewPoint, true ) == false)
bPreviewPathPointValid = RayToPathPoint(Ray, PreviewPoint, true);
if (!bPreviewPathPointValid)
{
return false;
}

View File

@@ -44,7 +44,7 @@ public:
TArray<FFrame3d> HitPath;
FFrame3d PreviewPathPoint;
bool bPreviewPathPointValid = false;
FToolDataVisualizer PathDrawer;
FLinearColor PathColor;