#include "Core/DescentFlyPawn.h" #include "Core/DescentGameClasses.h" #include "Render/DescentLamps.h" #include "Components/SpotLightComponent.h" #include "GameFramework/FloatingPawnMovement.h" ADescentFlyPawn::ADescentFlyPawn() { PrimaryActorTick.bCanEverTick = true; if (UFloatingPawnMovement* Move = Cast(GetMovementComponent())) { // Swim speed for looking around the showcase: 6 m/s. The engine default of 12 m/s overshoots a 7 m vehicle. Move->MaxSpeed = 600.f; Move->Acceleration = 1200.f; Move->Deceleration = 1200.f; } Headlamp = CreateDefaultSubobject(TEXT("Headlamp")); Headlamp->SetupAttachment(GetRootComponent()); Descent::Look::ConfigureSpot(Headlamp, Descent::Look::ELamp::TenderHeadlamp); } void ADescentFlyPawn::Tick(float DeltaSeconds) { Super::Tick(DeltaSeconds); // The camera looks along the control rotation; the lamp follows it (cosmetic, not a sim step). if (Headlamp && GetController()) { Headlamp->SetWorldRotation(GetControlRotation()); } } void ADescentFlyPawn::SetHeadlamp(bool bOn) { bHeadlampOn = bOn; if (Headlamp) { Headlamp->SetVisibility(bOn); } } // The placeholder player: the lowest priority, so any real pawn another track registers replaces it. DESCENT_REGISTER_GAME_CLASS(Pawn, 0, ADescentFlyPawn)