You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#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]
57 lines
1.4 KiB
C++
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
|