Files
LuckyWorld/Source/LuckyWorldV2/Public/LRRenderUtilLibrary.h

58 lines
2.0 KiB
C
Raw Normal View History

2025-04-29 15:40:38 -07:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "LRRenderUtilLibrary.generated.h"
2025-04-29 16:00:18 -07:00
class USceneCaptureComponent2D;
class UTextureRenderTarget2D;
class UStaticMeshComponent;
2025-04-29 15:40:38 -07:00
/**
2025-04-29 16:00:18 -07:00
* Utility library for capturing and rendering objects in the Lucky Robots system
2025-04-29 15:40:38 -07:00
*/
2025-04-29 16:00:18 -07:00
UCLASS(BlueprintType, Blueprintable)
2025-04-29 15:40:38 -07:00
class LUCKYWORLDV2_API ULRRenderUtilLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
2025-04-29 16:00:18 -07:00
/**
* Captures a static mesh component to a render target texture
* @param MeshComp The static mesh component to capture
* @param ImageSize The size of the output image
* @param WorldContextObject The world context
* @param CaptureSource The type of data to capture (default is BaseColor)
* @return The rendered texture
*/
UFUNCTION(BlueprintCallable, Category = "Lucky Robots|Render Utilities")
static UTextureRenderTarget2D* CaptureMeshToRenderTarget(
UStaticMeshComponent* MeshComp,
const FVector2D& ImageSize,
UObject* WorldContextObject,
TEnumAsByte<enum ESceneCaptureSource> CaptureSource = ESceneCaptureSource::SCS_BaseColor);
2025-04-29 15:40:38 -07:00
2025-04-29 16:00:18 -07:00
/**
* Sets up a scene capture component to focus on a specific mesh
* @param SceneCapture The scene capture component to set up
* @param MeshComp The static mesh component to focus on
* @param CaptureSource The type of data to capture (default is BaseColor)
*/
UFUNCTION(BlueprintCallable, Category = "Lucky Robots|Render Utilities")
static void SetupSceneCaptureForMesh(
USceneCaptureComponent2D* SceneCapture,
UStaticMeshComponent* MeshComp,
TEnumAsByte<enum ESceneCaptureSource> CaptureSource = ESceneCaptureSource::SCS_BaseColor);
2025-04-29 15:40:38 -07:00
2025-04-29 16:00:18 -07:00
/**
* Captures the current view of a scene capture component to its render target
* @param SceneCapture The scene capture component to trigger
* @return Success status
*/
UFUNCTION(BlueprintCallable, Category = "Lucky Robots|Render Utilities")
static bool CaptureSceneNow(USceneCaptureComponent2D* SceneCapture);
2025-04-29 15:40:38 -07:00
};