Backend: - Add /api/v1/ue/* endpoints (compute-points, cables, landing-points, satellites, status) returning flat JSON optimised for UE5 C++ parsing UE5 client (ue_client/): - PlanetDataManager: HTTP fetch + local mock JSON loader, spawns ComputePointActors - ComputePointActor / InteractiveObjectBase: hover/select state, material switching - GlobeInteractionComponent: drag-to-rotate via CesiumGeoreference origin shift, inertia, zoom - StereoRenderingManager: runtime SbS/TbB stereo toggle, IPD control (format TBD) - MotionCaptureInterface: protocol-agnostic gesture/rotate/zoom delegate interface (impl TBD) - PlanetPlayerController: unified mouse + motion-capture input routing - PlanetGameMode, Build.cs, Config, mock data Docs: - ue5_mvp_fused_plan.md updated to v3.0 for LED display context - ue_client_setup_guide.md: step-by-step editor setup guide - ue_todo.md: pending items blocked on vendor answers (stereo format + mocap protocol) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
54 lines
1.3 KiB
C++
54 lines
1.3 KiB
C++
#include "ComputePointActor.h"
|
|
#include "Components/StaticMeshComponent.h"
|
|
|
|
AComputePointActor::AComputePointActor()
|
|
{
|
|
PrimaryActorTick.bCanEverTick = false;
|
|
|
|
SphereMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("SphereMesh"));
|
|
RootComponent = SphereMesh;
|
|
|
|
// Enable mouse-over events so the PlayerController can detect hover
|
|
SphereMesh->bReceivesDecals = false;
|
|
}
|
|
|
|
void AComputePointActor::BeginPlay()
|
|
{
|
|
Super::BeginPlay();
|
|
SetActorScale3D(FVector(PointScale));
|
|
ApplyMaterial();
|
|
}
|
|
|
|
void AComputePointActor::SetPointData(const FComputePoint& Data)
|
|
{
|
|
PointData = Data;
|
|
|
|
// Optional: name the actor in the Outliner for easy debugging
|
|
SetActorLabel(FString::Printf(TEXT("[%d] %s"), Data.Rank, *Data.Name));
|
|
}
|
|
|
|
void AComputePointActor::SetVisualState(EPointVisualState NewState)
|
|
{
|
|
if (VisualState == NewState) return;
|
|
VisualState = NewState;
|
|
ApplyMaterial();
|
|
}
|
|
|
|
void AComputePointActor::ApplyMaterial()
|
|
{
|
|
if (!SphereMesh) return;
|
|
|
|
UMaterialInterface* Mat = nullptr;
|
|
switch (VisualState)
|
|
{
|
|
case EPointVisualState::Hovered: Mat = HoveredMaterial; break;
|
|
case EPointVisualState::Selected: Mat = SelectedMaterial; break;
|
|
default: Mat = NormalMaterial; break;
|
|
}
|
|
|
|
if (Mat)
|
|
{
|
|
SphereMesh->SetMaterial(0, Mat);
|
|
}
|
|
}
|