2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#include "ComponentVisualizersPrivatePCH.h"
|
|
|
|
|
#include "ComponentVisualizers.h"
|
|
|
|
|
|
|
|
|
|
#include "SoundDefinitions.h"
|
2014-08-12 11:18:17 -04:00
|
|
|
#include "Perception/PawnSensingComponent.h"
|
2014-10-11 23:04:16 -04:00
|
|
|
#include "PhysicsEngine/PhysicsSpringComponent.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#include "PointLightComponentVisualizer.h"
|
|
|
|
|
#include "SpotLightComponentVisualizer.h"
|
|
|
|
|
#include "AudioComponentVisualizer.h"
|
|
|
|
|
#include "RadialForceComponentVisualizer.h"
|
|
|
|
|
#include "ConstraintComponentVisualizer.h"
|
|
|
|
|
#include "SpringArmComponentVisualizer.h"
|
|
|
|
|
#include "SplineComponentVisualizer.h"
|
2015-01-21 13:58:47 -05:00
|
|
|
#include "SplineMeshComponentVisualizer.h"
|
2014-08-12 11:18:17 -04:00
|
|
|
#include "SensingComponentVisualizer.h"
|
2014-10-11 23:04:16 -04:00
|
|
|
#include "SpringComponentVisualizer.h"
|
2014-10-13 16:13:29 -04:00
|
|
|
#include "PrimitiveComponentVisualizer.h"
|
2014-11-04 06:12:25 -05:00
|
|
|
#include "Components/PointLightComponent.h"
|
|
|
|
|
#include "Components/SpotLightComponent.h"
|
|
|
|
|
#include "Components/AudioComponent.h"
|
|
|
|
|
#include "PhysicsEngine/RadialForceComponent.h"
|
|
|
|
|
#include "PhysicsEngine/PhysicsConstraintComponent.h"
|
|
|
|
|
#include "GameFramework/SpringArmComponent.h"
|
|
|
|
|
#include "Components/SplineComponent.h"
|
|
|
|
|
#include "Components/PrimitiveComponent.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE( FComponentVisualizersModule, ComponentVisualizers );
|
|
|
|
|
|
|
|
|
|
void FComponentVisualizersModule::StartupModule()
|
|
|
|
|
{
|
2014-04-02 18:09:23 -04:00
|
|
|
RegisterComponentVisualizer(UPointLightComponent::StaticClass()->GetFName(), MakeShareable(new FPointLightComponentVisualizer));
|
2014-03-14 14:13:41 -04:00
|
|
|
RegisterComponentVisualizer(USpotLightComponent::StaticClass()->GetFName(), MakeShareable(new FSpotLightComponentVisualizer));
|
|
|
|
|
RegisterComponentVisualizer(UAudioComponent::StaticClass()->GetFName(), MakeShareable(new FAudioComponentVisualizer));
|
|
|
|
|
RegisterComponentVisualizer(URadialForceComponent::StaticClass()->GetFName(), MakeShareable(new FRadialForceComponentVisualizer));
|
|
|
|
|
RegisterComponentVisualizer(UPhysicsConstraintComponent::StaticClass()->GetFName(), MakeShareable(new FConstraintComponentVisualizer));
|
|
|
|
|
RegisterComponentVisualizer(USpringArmComponent::StaticClass()->GetFName(), MakeShareable(new FSpringArmComponentVisualizer));
|
|
|
|
|
RegisterComponentVisualizer(USplineComponent::StaticClass()->GetFName(), MakeShareable(new FSplineComponentVisualizer));
|
2015-01-21 13:58:47 -05:00
|
|
|
RegisterComponentVisualizer(USplineMeshComponent::StaticClass()->GetFName(), MakeShareable(new FSplineMeshComponentVisualizer));
|
2014-08-12 11:18:17 -04:00
|
|
|
RegisterComponentVisualizer(UPawnSensingComponent::StaticClass()->GetFName(), MakeShareable(new FSensingComponentVisualizer));
|
2014-10-11 23:04:16 -04:00
|
|
|
RegisterComponentVisualizer(UPhysicsSpringComponent::StaticClass()->GetFName(), MakeShareable(new FSpringComponentVisualizer));
|
2014-10-13 16:13:29 -04:00
|
|
|
RegisterComponentVisualizer(UPrimitiveComponent::StaticClass()->GetFName(), MakeShareable(new FPrimitiveComponentVisualizer));
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FComponentVisualizersModule::ShutdownModule()
|
|
|
|
|
{
|
|
|
|
|
if(GUnrealEd != NULL)
|
|
|
|
|
{
|
|
|
|
|
// Iterate over all class names we registered for
|
|
|
|
|
for(FName ClassName : RegisteredComponentClassNames)
|
|
|
|
|
{
|
|
|
|
|
GUnrealEd->UnregisterComponentVisualizer(ClassName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FComponentVisualizersModule::RegisterComponentVisualizer(FName ComponentClassName, TSharedPtr<FComponentVisualizer> Visualizer)
|
|
|
|
|
{
|
|
|
|
|
if (GUnrealEd != NULL)
|
|
|
|
|
{
|
|
|
|
|
GUnrealEd->RegisterComponentVisualizer(ComponentClassName, Visualizer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RegisteredComponentClassNames.Add(ComponentClassName);
|
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
|
|
|
|
|
|
|
|
if (Visualizer.IsValid())
|
|
|
|
|
{
|
|
|
|
|
Visualizer->OnRegister();
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|