Files
UnrealEngineUWP/Engine/Source/Runtime/Experimental/InteractiveToolsFramework/Public/SingleSelectionTool.h
Ryan Schmidt c0ba0d5235 ModelingMode: Add support for selection-focus and point-focus at Tool level.
- New UInteractiveToolCameraFocusAPI UInterface defines functions a Tool can implement to publish its ability to provide a focus-box and focus-point
- ModelingMode uses this API to customize behavior. Box-focus (f hotkey) will now always focus on Tool-provided focus-box if available. Point-focus (c hotkey) will focus on nearer of world-hit and Tool focus-point.
- Default implementations for PrimitiveComponentToolTarget in SingleSelectionTool and MultiSelectionTool
- Custom focus-box implementations for PolyEdit-derived and TriSelect-derived tools, to focus on active selection if available
- Custom focus-point implementations for MeshSurfacePointTool

#rnx
#jira none

[CL 16246252 by Ryan Schmidt in ue5-main branch]
2021-05-10 01:17:30 -04:00

51 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "InteractiveTool.h"
#include "ComponentSourceInterfaces.h"
#include "ToolTargets/ToolTarget.h"
#include "InteractiveToolQueryInterfaces.h"
#include "SingleSelectionTool.generated.h"
UCLASS(Transient)
class INTERACTIVETOOLSFRAMEWORK_API USingleSelectionTool : public UInteractiveTool, public IInteractiveToolCameraFocusAPI
{
GENERATED_BODY()
public:
void SetTarget(UToolTarget* TargetIn)
{
Target = TargetIn;
}
/**
* @return true if all ToolTargets of this tool are still valid
*/
virtual bool AreAllTargetsValid() const
{
return Target ? Target->IsValid() : false;
}
public:
virtual bool CanAccept() const override
{
return AreAllTargetsValid();
}
protected:
UPROPERTY()
TObjectPtr<UToolTarget> Target;
public:
// IInteractiveToolCameraFocusAPI implementation
virtual bool SupportsWorldSpaceFocusBox() override;
virtual FBox GetWorldSpaceFocusBox() override;
virtual bool SupportsWorldSpaceFocusPoint() override;
virtual bool GetWorldSpaceFocusPoint(const FRay& WorldRay, FVector& PointOut) override;
};