Files
UnrealEngineUWP/Engine/Source/Editor/ComponentVisualizers/Public/Manipulator.h
Marc Audy cac1fe0019 Merge UE5/Release-Engine-Staging @ CL# 15299266 to UE5/Main
This represents UE4/Main @ CL# 15277572

[CL 15299962 by Marc Audy in ue5-main branch]
2021-02-03 14:57:28 -04:00

48 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "GameFramework/Actor.h"
#include "ViewportInteractableInterface.h"
#include "Manipulator.generated.h"
UCLASS()
class COMPONENTVISUALIZERS_API AManipulator : public AActor, public IViewportInteractableInterface
{
GENERATED_BODY()
public:
AManipulator();
// Begin AActor
virtual void PostEditMove(bool bFinished) override;
virtual bool IsEditorOnly() const final;
// End AActor
// Begin IViewportInteractableInterface
virtual void OnPressed(UViewportInteractor* Interactor, const FHitResult& InHitResult, bool& bOutResultedInDrag) override;
virtual void OnHover(UViewportInteractor* Interactor) override;
virtual void OnHoverEnter(UViewportInteractor* Interactor, const FHitResult& InHitResult) override;
virtual void OnHoverLeave(UViewportInteractor* Interactor, const UActorComponent* NewComponent) override;
virtual void OnDragRelease(UViewportInteractor* Interactor) override;
virtual class UViewportDragOperationComponent* GetDragOperationComponent() override { return nullptr; }
virtual bool CanBeSelected() override { return true; };
// End IViewportInteractableInterface
/** Set the component that should be moved when the manipulator was moved. */
void SetAssociatedComponent(USceneComponent* SceneComponent);
private:
/** The component to transform when this manipulator was moved. */
UPROPERTY()
TObjectPtr<USceneComponent> AssociatedComponent;
/** Visual representation of this manipulator. */
UPROPERTY()
TObjectPtr<class UStaticMeshComponent> StaticMeshComponent;
};