#pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "PlanetDataTypes.h" #include "ComputePointActor.generated.h" class UStaticMeshComponent; class UBillboardComponent; UENUM(BlueprintType) enum class EPointVisualState : uint8 { Normal UMETA(DisplayName="Normal"), Hovered UMETA(DisplayName="Hovered"), Selected UMETA(DisplayName="Selected"), }; /** * AComputePointActor * * Represents one supercomputer data point on the Cesium globe. * * Usage: * 1. Create a Blueprint subclass: Content Browser → New Blueprint → * search "AComputePointActor" as parent class → name it BP_ComputePointActor * 2. In the Blueprint, assign a sphere mesh to SphereMesh (Engine/BasicShapes/Sphere) * 3. Assign a material to NormalMaterial / HoveredMaterial / SelectedMaterial * 4. Set this Blueprint class in APlanetDataManager → ComputePointClass */ UCLASS(BlueprintType, Blueprintable) class PLANETCLIENT_API AComputePointActor : public AActor { GENERATED_BODY() public: AComputePointActor(); // ----------------------------------------------------------------------- // Components // ----------------------------------------------------------------------- // The visible sphere. Assign a sphere mesh in your Blueprint subclass. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Planet|Components") UStaticMeshComponent* SphereMesh; // ----------------------------------------------------------------------- // Materials (assign in Blueprint subclass) // ----------------------------------------------------------------------- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Planet|Visual") UMaterialInterface* NormalMaterial; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Planet|Visual") UMaterialInterface* HoveredMaterial; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Planet|Visual") UMaterialInterface* SelectedMaterial; // ----------------------------------------------------------------------- // Point scale (world units). Tweak this in the Details Panel. // ----------------------------------------------------------------------- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Planet|Visual") float PointScale = 80000.f; // ----------------------------------------------------------------------- // Data (set by APlanetDataManager after spawn) // ----------------------------------------------------------------------- UPROPERTY(BlueprintReadOnly, Category="Planet|Data") FComputePoint PointData; UPROPERTY(BlueprintReadOnly, Category="Planet|Data") EPointVisualState VisualState = EPointVisualState::Normal; // ----------------------------------------------------------------------- // Public API // ----------------------------------------------------------------------- // Called by APlanetDataManager immediately after spawning. UFUNCTION(BlueprintCallable, Category="Planet") void SetPointData(const FComputePoint& Data); // Called by PlanetPlayerController on hover/select. UFUNCTION(BlueprintCallable, Category="Planet") void SetVisualState(EPointVisualState NewState); // Convenience: is this point currently selected? UFUNCTION(BlueprintPure, Category="Planet") bool IsSelected() const { return VisualState == EPointVisualState::Selected; } protected: virtual void BeginPlay() override; private: void ApplyMaterial(); };