2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-05-20 13:39:35 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2014-05-21 07:55:08 -04:00
|
|
|
#include "ComponentVisualizer.h"
|
|
|
|
|
|
Improvements to SplineComponent and its visualization.
#branch UE4
#proj Editor.ComponentVisualizers, Editor.UnrealEd, Runtime.Core, Runtime.Engine
#change FInterpCurve now uses a binary search to obtain the correct key. Removed the optional out-parameter on Eval, EvalDerivative, etc. Removed FORCEINLINEs on large methods.
#change USplineComponent now builds the remap table with points spaced at equal distances, which leads to better results. Added internal methods to obtain the segment length, and the interpolation parameter along the segment at a given distance.
#add Added Duration to USplineComponent.
#add Added a number of different methods for obtaining position, tangent and rotation at a specified distance, or a specified time (optionally at constant velocity).
#add Added methods for building the spline procedurally.
#add Supports right-click context menu on ComponentVisualizers in the standard interface.
#add Key tangents can be manually edited.
#change FLevelEditorViewportClient::ProcessClick now handles right clicks to the Unreal gizmo in the same manner as left clicks, i.e. the method recurses using a version of the hit proxy with the gizmo removed, so we can look at what's underneath. This allows for "genuine" context menus, i.e. depending on what was clicked, instead of using a single default provided by the current level editor.
#reviewedby James.Golding
[CL 2089561 by Richard TalbotWatkin in Main branch]
2014-05-30 07:58:16 -04:00
|
|
|
struct FViewportClick;
|
|
|
|
|
|
2014-05-20 13:39:35 -04:00
|
|
|
/** Class that managed active component visualizer and routes input to it */
|
|
|
|
|
class UNREALED_API FComponentVisualizerManager
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
FComponentVisualizerManager() {}
|
|
|
|
|
virtual ~FComponentVisualizerManager() {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Activate a component visualizer given a clicked proxy */
|
2014-07-23 09:40:19 -04:00
|
|
|
bool HandleProxyForComponentVis(FLevelEditorViewportClient* InViewportClient, HHitProxy *HitProxy, const FViewportClick &Click);
|
2014-05-20 13:39:35 -04:00
|
|
|
/** Clear active component visualizer */
|
|
|
|
|
void ClearActiveComponentVis();
|
|
|
|
|
|
2014-06-18 10:16:16 -04:00
|
|
|
/** Handle a click on the specified level editor viewport client */
|
|
|
|
|
bool HandleClick(FLevelEditorViewportClient* InViewportClient, HHitProxy *HitProxy, const FViewportClick &Click);
|
2014-05-20 13:39:35 -04:00
|
|
|
/** Pass key input to active visualizer */
|
2014-07-23 09:40:19 -04:00
|
|
|
bool HandleInputKey(FEditorViewportClient* InViewportClient, FViewport* Viewport, FKey Key, EInputEvent Event) const;
|
2014-05-20 13:39:35 -04:00
|
|
|
/** Pass delta input to active visualizer */
|
2014-06-18 10:16:16 -04:00
|
|
|
bool HandleInputDelta(FEditorViewportClient* InViewportClient, FViewport* InViewport, FVector& InDrag, FRotator& InRot, FVector& InScale) const;
|
2014-05-20 13:39:35 -04:00
|
|
|
/** Get widget location from active visualizer */
|
2014-07-23 09:40:19 -04:00
|
|
|
bool GetWidgetLocation(const FEditorViewportClient* InViewportClient, FVector& OutLocation) const;
|
|
|
|
|
/** Get custom widget coordinate system from active visualizer */
|
|
|
|
|
bool GetCustomInputCoordinateSystem(const FEditorViewportClient* InViewportClient, FMatrix& OutMatrix) const;
|
Improvements to SplineComponent and its visualization.
#branch UE4
#proj Editor.ComponentVisualizers, Editor.UnrealEd, Runtime.Core, Runtime.Engine
#change FInterpCurve now uses a binary search to obtain the correct key. Removed the optional out-parameter on Eval, EvalDerivative, etc. Removed FORCEINLINEs on large methods.
#change USplineComponent now builds the remap table with points spaced at equal distances, which leads to better results. Added internal methods to obtain the segment length, and the interpolation parameter along the segment at a given distance.
#add Added Duration to USplineComponent.
#add Added a number of different methods for obtaining position, tangent and rotation at a specified distance, or a specified time (optionally at constant velocity).
#add Added methods for building the spline procedurally.
#add Supports right-click context menu on ComponentVisualizers in the standard interface.
#add Key tangents can be manually edited.
#change FLevelEditorViewportClient::ProcessClick now handles right clicks to the Unreal gizmo in the same manner as left clicks, i.e. the method recurses using a version of the hit proxy with the gizmo removed, so we can look at what's underneath. This allows for "genuine" context menus, i.e. depending on what was clicked, instead of using a single default provided by the current level editor.
#reviewedby James.Golding
[CL 2089561 by Richard TalbotWatkin in Main branch]
2014-05-30 07:58:16 -04:00
|
|
|
|
|
|
|
|
/** Generate context menu for the component visualizer */
|
|
|
|
|
TSharedPtr<SWidget> GenerateContextMenuForComponentVis() const;
|
2014-05-20 13:39:35 -04:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/** Currently 'active' visualizer that we should pass input to etc */
|
2014-07-23 09:40:19 -04:00
|
|
|
TWeakPtr<class FComponentVisualizer> EditedVisualizerPtr;
|
2014-05-20 13:39:35 -04:00
|
|
|
};
|