You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Added a new registry to let the objects provide how their elements should be selected when doing a selection by a volume such as a box or a frustum. Added a some editor only functions for the marquee selection into the world interface. #jira UETOOL-4797 #rb Brooke.Hubert #preflight 624cb2dca64871f1a113bf2a [CL 19727315 by Julien StJean in ue5-main branch]
82 lines
2.6 KiB
C++
82 lines
2.6 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "LevelEditorViewport.h"
|
|
#include "EditorDragTools.h"
|
|
|
|
class FCanvas;
|
|
class UModel;
|
|
|
|
/**
|
|
* Draws a box in the current viewport and when the mouse button is released,
|
|
* it selects/unselects everything inside of it.
|
|
*/
|
|
class FDragTool_ActorBoxSelect : public FDragTool
|
|
{
|
|
public:
|
|
explicit FDragTool_ActorBoxSelect( FLevelEditorViewportClient* InLevelViewportClient )
|
|
: FDragTool(InLevelViewportClient->GetModeTools())
|
|
, LevelViewportClient( InLevelViewportClient )
|
|
{}
|
|
|
|
/**
|
|
* Starts a mouse drag behavior. The start location is snapped to the editor constraints if bUseSnapping is true.
|
|
*
|
|
* @param InViewportClient The viewport client in which the drag event occurred.
|
|
* @param InStart Where the mouse was when the drag started.
|
|
*/
|
|
virtual void StartDrag(FEditorViewportClient* InViewportClient, const FVector& InStart, const FVector2D& InStartScreen) override;
|
|
|
|
/* Updates the drag tool's end location with the specified delta. The end location is
|
|
* snapped to the editor constraints if bUseSnapping is true.
|
|
*
|
|
* @param InDelta A delta of mouse movement.
|
|
*/
|
|
virtual void AddDelta(const FVector& InDelta) override;
|
|
|
|
/**
|
|
* Ends a mouse drag behavior (the user has let go of the mouse button).
|
|
*/
|
|
virtual void EndDrag() override;
|
|
virtual void Render(const FSceneView* View, FCanvas* Canvas) override;
|
|
|
|
private:
|
|
/**
|
|
* Calculates a box to check actors against
|
|
*
|
|
* @param OutBox The created box.
|
|
*/
|
|
void CalculateBox( FBox& OutBox );
|
|
|
|
/**
|
|
* Returns true if the provided BSP node intersects with the provided frustum
|
|
*
|
|
* @param InModel The model containing BSP nodes to check
|
|
* @param NodeIndex The index to a BSP node in the model. This node is used for the bounds check.
|
|
* @param InFrustum The frustum to check against.
|
|
* @param bUseStrictSelection true if the node must be entirely within the frustum
|
|
*/
|
|
bool IntersectsBox( const UModel& InModel, int32 NodeIndex, const FBox& InBox, bool bUseStrictSelection ) const;
|
|
|
|
/** Adds a hover effect to the passed in actor */
|
|
void AddHoverEffect( AActor& InActor );
|
|
|
|
/** Adds a hover effect to the passed in bsp surface */
|
|
void AddHoverEffect( UModel& InModel, int32 SurfIndex );
|
|
|
|
/** Removes a hover effect from the passed in actor */
|
|
void RemoveHoverEffect( AActor& InActor );
|
|
|
|
/** Removes a hover effect from the passed in bsp surface */
|
|
void RemoveHoverEffect( UModel& InModel, int32 SurfIndex );
|
|
|
|
/** List of BSP models to check for selection */
|
|
TArray<UModel*> ModelsToCheck;
|
|
|
|
FLevelEditorViewportClient* LevelViewportClient;
|
|
};
|
|
|