Files
michael balzer a49c74b915 MeshModelingToolset: Move ModelingOperators and ModelingOperatorsEditorOnly modules out of experimental plugin
#jira UETOOL-3823
#rb lonnie.li
#preflight 617b1aea5794a500014f544a

#ROBOMERGE-AUTHOR: michael.balzer
#ROBOMERGE-SOURCE: CL 17972239 in //UE5/Release-5.0/... via CL 17972248
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v885-17909292)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17972256 by michael balzer in ue5-release-engine-test branch]
2021-10-28 19:47:45 -04:00

57 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Snapping/BasePositionSnapSolver3.h"
class FToolDataVisualizer;
namespace UE
{
namespace Geometry
{
/**
* FRaySpatialSnapSolver solves for a Point snap location based on an input Ray
* and a set of snap targets (3D points and 3D lines).
*
* See FBasePositionSnapSolver3 for details on how to set up the snap problem
* and get results.
*/
class MODELINGCOMPONENTS_API FRaySpatialSnapSolver : public FBasePositionSnapSolver3
{
public:
FRaySpatialSnapSolver();
/**
* Optional function that will be used to project potential snap points onto constraints.
* Note that Line/Curve constraints are still respected, so eg if this projects to a 3D grid,
* then when calculating possible line-snap positions, the 3D grid point will be projected back
* onto the line targets.
*/
TFunction<FVector3d(const FVector3d&)> PointConstraintFunc = nullptr;
//
// solving
//
/** Solve the snapping problem */
void UpdateSnappedPoint(const FRay3d& Ray);
//
// Utility rendering
//
/** Visualization of snap targets and result (if available) */
void Draw(FToolDataVisualizer* Renderer, float LineLength, TMap<int,FLinearColor>* ColorMap = nullptr);
protected:
TArray<FSnapTargetPoint> GeneratedTargetPoints;
void GenerateTargetPoints(const FRay3d& Ray);
};
} // end namespace UE::Geometry
} // end namespace UE