You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rnx #rb rinat.abdrashitov #preflight 614cb58d88dbdb000179f1cf #ROBOMERGE-AUTHOR: tyson.brochu #ROBOMERGE-SOURCE: CL 17611355 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257) #ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0 [CL 17611364 by tyson brochu in ue5-release-engine-test branch]
39 lines
1.0 KiB
C++
39 lines
1.0 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "MeshProcessingNodes/GenerateConvexHullMeshNode.h"
|
|
#include "Operations/MeshConvexHull.h"
|
|
#include "Util/ProgressCancel.h"
|
|
|
|
using namespace UE::Geometry;
|
|
using namespace UE::GeometryFlow;
|
|
|
|
EGeometryFlowResult FGenerateConvexHullMeshNode::MakeConvexHullMesh(const FDynamicMesh3& MeshIn,
|
|
const FGenerateConvexHullMeshSettings& Settings,
|
|
FDynamicMesh3& MeshOut,
|
|
TUniquePtr<FEvaluationInfo>& EvaluationInfo)
|
|
{
|
|
FMeshConvexHull Hull(&MeshIn);
|
|
|
|
if (Settings.bPrefilterVertices)
|
|
{
|
|
FMeshConvexHull::GridSample(MeshIn, Settings.PrefilterGridResolution, Hull.VertexSet);
|
|
}
|
|
|
|
Hull.bPostSimplify = false; // Mesh can be simplified later
|
|
|
|
if (Hull.Compute(EvaluationInfo->Progress))
|
|
{
|
|
MeshOut = MoveTemp(Hull.ConvexHull);
|
|
}
|
|
|
|
if (EvaluationInfo->Progress->Cancelled())
|
|
{
|
|
return EGeometryFlowResult::OperationCancelled;
|
|
}
|
|
|
|
// TODO: What if Hull.Compute() fails but not because of cancellation? Should we have a EGeometryFlowResult::Failed?
|
|
|
|
return EGeometryFlowResult::Ok;
|
|
}
|
|
|