You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- SEditorViewportClient now has an additional optional parameter in its constructor for the SEditorViewport that the client is attached to
- SBasePoseViewport, SDestructibleMeshEditorViewport, and SPhATPreviewViewport were all updated to inherit from SEditorViewport (previously just inherited from SCompoundWidget)
[CL 2398765 by Dan Hertzka in Main branch]
115 lines
3.6 KiB
C++
115 lines
3.6 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
|
|
class FCascade;
|
|
class SCascadePreviewViewport;
|
|
|
|
|
|
/*-----------------------------------------------------------------------------
|
|
FCascadeViewportClient
|
|
-----------------------------------------------------------------------------*/
|
|
|
|
class FCascadeEdPreviewViewportClient : public FEditorViewportClient
|
|
{
|
|
public:
|
|
/** Constructor */
|
|
FCascadeEdPreviewViewportClient(TWeakPtr<FCascade> InCascade, const TSharedRef<SCascadePreviewViewport>& InCascadeViewport);
|
|
~FCascadeEdPreviewViewportClient();
|
|
|
|
/** FEditorViewportClient interface */
|
|
virtual void Draw(FViewport* Viewport, FCanvas* Canvas) override;
|
|
virtual void Draw(const FSceneView* View, FPrimitiveDrawInterface* PDI) override;
|
|
virtual bool InputKey(FViewport* Viewport, int32 ControllerId, FKey Key, EInputEvent Event, float AmountDepressed = 1.0f, bool bGamepad = false) override;
|
|
virtual bool InputAxis(FViewport* Viewport, int32 ControllerId, FKey Key, float Delta, float DeltaTime, int32 NumSamples = 1, bool bGamepad = false) override;
|
|
virtual FSceneInterface* GetScene() const override;
|
|
virtual FLinearColor GetBackgroundColor() const override;
|
|
virtual bool ShouldOrbitCamera() const override;
|
|
virtual void AddReferencedObjects( FReferenceCollector& Collector ) override;
|
|
virtual bool CanCycleWidgetMode() const override;
|
|
|
|
/** Sets the position and orientation of the preview camera */
|
|
void SetPreviewCamera(const FRotator& NewPreviewAngle, float NewPreviewDistance);
|
|
|
|
/** Update the memory information of the particle system */
|
|
void UpdateMemoryInformation();
|
|
|
|
/** Generates a new thumbnail image for the content browser */
|
|
void CreateThumbnail();
|
|
|
|
/** Draw flag types */
|
|
enum EDrawElements
|
|
{
|
|
ParticleCounts = 0x001,
|
|
ParticleEvents = 0x002,
|
|
ParticleTimes = 0x004,
|
|
ParticleMemory = 0x008,
|
|
VectorFields = 0x010,
|
|
Bounds = 0x020,
|
|
WireSphere = 0x040,
|
|
OriginAxis = 0x080,
|
|
Orbit = 0x100
|
|
};
|
|
|
|
/** Accessors */
|
|
FPreviewScene& GetPreviewScene();
|
|
bool GetDrawElement(EDrawElements Element) const;
|
|
void ToggleDrawElement(EDrawElements Element);
|
|
FColor GetPreviewBackgroundColor() const;
|
|
UStaticMeshComponent* GetFloorComponent();
|
|
FEditorCommonDrawHelper& GetDrawHelper();
|
|
float& GetWireSphereRadius();
|
|
|
|
private:
|
|
/** Pointer back to the ParticleSystem editor tool that owns us */
|
|
TWeakPtr<FCascade> CascadePtr;
|
|
|
|
/** Preview mesh */
|
|
UStaticMeshComponent* FloorComponent;
|
|
|
|
/** Camera potition/rotation */
|
|
FRotator PreviewAngle;
|
|
float PreviewDistance;
|
|
|
|
/** If true, will take screenshot for thumbnail on next draw call */
|
|
float bCaptureScreenShot;
|
|
|
|
/** User input state info */
|
|
FVector WorldManipulateDir;
|
|
FVector LocalManipulateDir;
|
|
float DragX;
|
|
float DragY;
|
|
EAxisList::Type WidgetAxis;
|
|
EWidgetMovementMode WidgetMM;
|
|
bool bManipulatingVectorField;
|
|
|
|
/** Draw flags (see EDrawElements) */
|
|
int32 DrawFlags;
|
|
|
|
/** Radius of the wireframe sphere */
|
|
float WireSphereRadius;
|
|
|
|
/** Veiwport background color */
|
|
FColor BackgroundColor;
|
|
|
|
/** The scene used for the viewport. Owned externally */
|
|
FPreviewScene CascadePreviewScene;
|
|
|
|
/** The size of the ParticleSystem via FArchive memory counting */
|
|
int32 ParticleSystemRootSize;
|
|
/** The size the particle modules take for the system */
|
|
int32 ParticleModuleMemSize;
|
|
/** The size of the ParticleSystemComponent via FArchive memory counting */
|
|
int32 PSysCompRootSize;
|
|
/** The size of the ParticleSystemComponent resource size */
|
|
int32 PSysCompResourceSize;
|
|
|
|
/** Draw info index for vector fields */
|
|
const int32 VectorFieldHitproxyInfo;
|
|
|
|
/** Speed multiplier used when moving the scene light around */
|
|
const float LightRotSpeed;
|
|
};
|
|
|