// Copyright Ralpha Team. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "UObject/NoExportTypes.h" #include "Dom/JsonObject.h" #include "Dom/JsonValue.h" #include "RalphaParameterBridge.generated.h" class APostProcessVolume; class ADirectionalLight; class ASkyLight; class AExponentialHeightFog; class ACineCameraActor; /** * Bridge between MCP commands and UE5 rendering systems. * Handles getting/setting parameters on post-process volumes, lights, fog, cameras, etc. */ UCLASS(BlueprintType) class RALPHACORE_API URalphaParameterBridge : public UObject { GENERATED_BODY() public: URalphaParameterBridge(); // Get all current rendering parameters TSharedPtr GetAllParameters(); // Post-Process Volume bool SetPostProcessParameters(const TSharedPtr& Params); TSharedPtr GetPostProcessParameters(); // Directional Light (Sun) bool SetDirectionalLightParameters(const TSharedPtr& Params); TSharedPtr GetDirectionalLightParameters(); // Sky Light bool SetSkyLightParameters(const TSharedPtr& Params); TSharedPtr GetSkyLightParameters(); // Exponential Height Fog bool SetFogParameters(const TSharedPtr& Params); TSharedPtr GetFogParameters(); // Camera bool SetCameraParameters(const TSharedPtr& Params); TSharedPtr GetCameraParameters(); // Render Quality bool SetRenderQuality(const TSharedPtr& Settings); // Asset Search TArray> SearchAssets(const FString& Query, const FString& AssetType, int32 MaxResults); TArray> ListAssets(const FString& FolderPath, const FString& AssetType, bool bRecursive); // Actor Management bool SpawnActor(const FString& AssetPath, const FVector& Location, const FRotator& Rotation, float Scale, const FString& ActorLabel, FString& OutActorId); bool DeleteActor(const FString& ActorId); TArray> ListActors(const FString& ClassFilter, const FString& NameFilter, bool bIncludeTransforms); bool SetActorTransform(const FString& ActorId, const FVector* Location, const FRotator* Rotation, const float* Scale, bool bRelative); TSharedPtr GetActorDetails(const FString& ActorId, bool bIncludeComponents, bool bIncludeMaterials); bool SetActorMaterial(const FString& ActorId, const FString& MaterialPath, int32 MaterialIndex); // Create a simple material with specified properties and apply to actor bool SetActorSimpleMaterial(const FString& ActorId, const FLinearColor& BaseColor, float Metallic, float Roughness, float Opacity); // Create an emissive (unlit) material for glowing objects like sun, lights, screens bool SetActorEmissiveMaterial(const FString& ActorId, const FLinearColor& EmissiveColor, float EmissiveIntensity); // Scene Setup - creates required actors for rendering control TSharedPtr SetupScene(); // Spawn WaterBodyOcean from Water plugin bool SpawnOcean(const FVector& Location, float Size, FString& OutActorId); // Configure ocean wave parameters bool SetOceanWaves(float WaveAmplitude, float WaveLength, float Steepness, int32 NumWaves); // Create a minimal landscape for water plugin support bool CreateLandscape(float Size, float HeightOffset); // Point Light bool SpawnPointLight(const FVector& Location, float Intensity, const FLinearColor& Color, float AttenuationRadius, const FString& ActorLabel, FString& OutActorId); bool SetPointLightParameters(const FString& ActorId, const TSharedPtr& Params); // Spot Light bool SpawnSpotLight(const FVector& Location, const FRotator& Rotation, float Intensity, const FLinearColor& Color, float AttenuationRadius, float InnerConeAngle, float OuterConeAngle, const FString& ActorLabel, FString& OutActorId); bool SetSpotLightParameters(const FString& ActorId, const TSharedPtr& Params); // Rect Light (area lighting for interiors) bool SpawnRectLight(const FVector& Location, const FRotator& Rotation, float Intensity, const FLinearColor& Color, float SourceWidth, float SourceHeight, float AttenuationRadius, const FString& ActorLabel, FString& OutActorId); bool SetRectLightParameters(const FString& ActorId, const TSharedPtr& Params); // Skeletal Mesh (characters, animated objects) bool SpawnSkeletalMesh(const FString& SkeletalMeshPath, const FVector& Location, const FRotator& Rotation, float Scale, const FString& ActorLabel, FString& OutActorId); bool PlayAnimation(const FString& ActorId, const FString& AnimationPath, bool bLooping, float PlayRate); bool StopAnimation(const FString& ActorId); bool SetAnimationPose(const FString& ActorId, const FString& AnimationPath, float Time); // Reflection Captures bool SpawnSphereReflectionCapture(const FVector& Location, float InfluenceRadius, const FString& ActorLabel, FString& OutActorId); bool SpawnBoxReflectionCapture(const FVector& Location, const FVector& BoxExtent, const FString& ActorLabel, FString& OutActorId); bool UpdateReflectionCaptures(); // IES Light Profiles bool SetLightIESProfile(const FString& ActorId, const FString& IESProfilePath); private: // Find actors of specific types in the world APostProcessVolume* FindPostProcessVolume(); ADirectionalLight* FindDirectionalLight(); ASkyLight* FindSkyLight(); AExponentialHeightFog* FindExponentialHeightFog(); ACineCameraActor* FindCineCamera(); // Get the current world UWorld* GetCurrentWorld(); // Parse hex color string to FLinearColor FLinearColor ParseHexColor(const FString& HexColor); FString ColorToHex(const FLinearColor& Color); // Refresh BP_Sky_Sphere when sun position changes void RefreshSkySphere(); };