71 lines
2.0 KiB
C++
71 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "EditorViewportClient.h"
|
|
|
|
class FFLESHEditor;
|
|
class FSceneViewport;
|
|
|
|
/**
|
|
* FLESH Editor Viewport Client
|
|
* Handles 3D view rendering and interactions
|
|
*/
|
|
class FFLESHViewportClient : public FEditorViewportClient
|
|
{
|
|
public:
|
|
/** Constructor */
|
|
FFLESHViewportClient(FFLESHEditor* InEditor);
|
|
|
|
/** Destructor */
|
|
virtual ~FFLESHViewportClient();
|
|
|
|
/** Draw the viewport */
|
|
virtual void Draw(const FSceneView* View, FPrimitiveDrawInterface* PDI) override;
|
|
|
|
/** Handle mouse clicks - deprecated API kept for compatibility with existing code */
|
|
virtual bool InputKey(FViewport* InViewport, int32 ControllerId, FKey Key, EInputEvent Event, float AmountDepressed = 1.f, bool bGamepad = false) override;
|
|
|
|
/** Handle mouse clicks - new API */
|
|
virtual bool InputKey(const FInputKeyEventArgs& EventArgs) override;
|
|
|
|
/** Override mouse movement handling to provide camera controls similar to asset editor */
|
|
virtual bool InputAxis(FViewport* InViewport, int32 ControllerId, FKey Key, float Delta, float DeltaTime, int32 NumSamples = 1, bool bGamepad = false) override;
|
|
|
|
/** Load and display objects from NodeTree */
|
|
void LoadNodesFromNodeTree();
|
|
|
|
/** Update objects displayed in the viewport */
|
|
void UpdateVisibleNodes();
|
|
|
|
/** Focus on the selected object */
|
|
void FocusOnSelectedNode();
|
|
|
|
/** Reset camera */
|
|
void ResetCamera();
|
|
|
|
/** Toggle wireframe mode */
|
|
void ToggleWireframe();
|
|
|
|
/** Toggle bone display */
|
|
void ToggleBones();
|
|
|
|
/** Viewport pointer */
|
|
FSceneViewport* Viewport;
|
|
|
|
private:
|
|
/** Editor reference */
|
|
FFLESHEditor* Editor;
|
|
|
|
/** Show wireframe */
|
|
bool bShowWireframe;
|
|
|
|
/** Show bones */
|
|
bool bShowBones;
|
|
|
|
/** Preview scene for the viewport */
|
|
TSharedPtr<FPreviewScene> PreviewScene;
|
|
|
|
/** Recursively load node and its children */
|
|
void LoadNodeRecursive(TSharedPtr<FVisceraNodeItem> Node, USceneComponent* ParentComponent);
|
|
};
|