Files
planet/ue_client/Source/PlanetClient/InteractiveObjectBase.cpp
linkong 1e6f4b338b feat: add UE5 LED display client — backend API, C++ source, stereo framework
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>
2026-04-14 18:39:05 +08:00

54 lines
1.6 KiB
C++

#include "InteractiveObjectBase.h"
AInteractiveObjectBase::AInteractiveObjectBase()
{
PrimaryActorTick.bCanEverTick = false;
}
void AInteractiveObjectBase::SetInteractiveState(EInteractiveObjectState NewState)
{
if (CurrentState == NewState) return;
if (CurrentState == EInteractiveObjectState::Disabled &&
NewState != EInteractiveObjectState::Normal) return;
EInteractiveObjectState OldState = CurrentState;
CurrentState = NewState;
switch (NewState)
{
case EInteractiveObjectState::Hovered: OnHovered(); break;
case EInteractiveObjectState::Selected: OnSelected(); break;
case EInteractiveObjectState::Normal:
if (OldState == EInteractiveObjectState::Selected) OnDeselected();
else OnRestored();
break;
default: break;
}
OnStateChanged.Broadcast(NewState);
}
// ---------------------------------------------------------------------------
// 默认实现(子类可重写)
// ---------------------------------------------------------------------------
FText AInteractiveObjectBase::GetInfoTitle_Implementation() const
{
return FText::FromString(GetActorLabel());
}
FText AInteractiveObjectBase::GetInfoBody_Implementation() const
{
return FText::FromString(TEXT(""));
}
UTexture2D* AInteractiveObjectBase::GetInfoIcon_Implementation() const
{
return nullptr;
}
void AInteractiveObjectBase::OnHovered_Implementation() {}
void AInteractiveObjectBase::OnSelected_Implementation() {}
void AInteractiveObjectBase::OnDeselected_Implementation(){}
void AInteractiveObjectBase::OnRestored_Implementation() {}