You've already forked LuckyWorld
Clean up and document code
This commit is contained in:
@ -6,20 +6,52 @@
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "LRRenderUtilLibrary.generated.h"
|
||||
|
||||
class USceneCaptureComponent2D;
|
||||
class UTextureRenderTarget2D;
|
||||
class UStaticMeshComponent;
|
||||
|
||||
/**
|
||||
*
|
||||
* Utility library for capturing and rendering objects in the Lucky Robots system
|
||||
*/
|
||||
UCLASS()
|
||||
UCLASS(BlueprintType, Blueprintable)
|
||||
class LUCKYWORLDV2_API ULRRenderUtilLibrary : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
/**
|
||||
* 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,
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Render Utilities")
|
||||
UTextureRenderTarget2D* CaptureMeshToRenderTarget(UStaticMeshComponent* MeshComp, const FVector2D& ImageSize, UObject* WorldContextObject);
|
||||
UObject* WorldContextObject,
|
||||
TEnumAsByte<enum ESceneCaptureSource> CaptureSource = ESceneCaptureSource::SCS_BaseColor);
|
||||
|
||||
private:
|
||||
void SetupSceneCaptureForMesh(USceneCaptureComponent2D* SceneCapture, UStaticMeshComponent* MeshComp);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
};
|
||||
|
Reference in New Issue
Block a user