Skip to content

AMRISpectatorController

Player controller used during demo playback to follow the subject and capture data.

Syntax

class AMRISpectatorController : public APlayerController

Remarks

During replay, a spectator controller is spawned to track the subject pawn, attach sensor cameras, log per-frame experiment state, and save rendered frames to disk. Subclass this controller to add experiment-specific logging. UCLASS

Inheritance Hierarchy

APlayerControllerAMRISpectatorController

Methods

Method Signature Description Blueprint
AMRISpectatorController AMRISpectatorController::AMRISpectatorController(const FObjectInitializer &objectInitializer) Constructor.
AddExperimentState void AMRISpectatorController::AddExperimentState(MRIExperimentState *newState) Appends a the current state of the experiment from this current tick to log.
BeginPlayingState void AMRISpectatorController::BeginPlayingState() override Called when the controller enters the playing state.
CaptureSensors void AMRISpectatorController::CaptureSensors() Save sensor outputs from the current frame.
FindTaggedPlayerPawn APawn * AMRISpectatorController::FindTaggedPlayerPawn() Search for the subject pawn in all the actors in the world.
FixTimeStep void AMRISpectatorController::FixTimeStep(bool fix) Enables or disables fixed time-stepping.
GetDemoNetDriver UDemoNetDriver * AMRISpectatorController::GetDemoNetDriver() const Returns the UDemoNetDriver driving the current replay playback.
GetDemoSubsystem UMRIDemoSubsystem * AMRISpectatorController::GetDemoSubsystem() const Returns the UMRIDemoSubsystem for this session.
GetFrameNumber int AMRISpectatorController::GetFrameNumber() const Returns the current replay frame number.
GetReferencePlayerState AMRISubjectState * AMRISpectatorController::GetReferencePlayerState() const Get the current state at this tick of the replicated player pawn.
IsStale bool AMRISpectatorController::IsStale() Returns whether the replay has finished and this instance should be cleaned up.
LogExperimentState void AMRISpectatorController::LogExperimentState() Captures the state from all registered agents on this current tick, then appends the snapshot to the internal log buffer.
PostActorCreated void AMRISpectatorController::PostActorCreated() override Called after the actor is created in the world.
SaveExperimentLog void AMRISpectatorController::SaveExperimentLog() Writes all accumulated per-frame experiment state to a log file on disk.
SetFrameCaptureFolder void AMRISpectatorController::SetFrameCaptureFolder(const FString &folder) Sets the folder where rendered frames will be written.
SetReferencePawn void AMRISpectatorController::SetReferencePawn(APawn *referencePawn) Sets the reference pawn to follow, i.e.
SpawnLoggerComponent void AMRISpectatorController::SpawnLoggerComponent() Spawns and configures the UMRILoggerComponent used to collect per-frame state.
Tick void AMRISpectatorController::Tick(float deltaTime) override All the framewise logic.
TrySetViewTargetToPlayer void AMRISpectatorController::TrySetViewTargetToPlayer() Attempts to set the view target to the replaying subject pawn.
~AMRISpectatorController AMRISpectatorController::~AMRISpectatorController() Destructor.

Properties

Property Type Description Blueprint
captureFrames bool Are we writing frames from sensors to disk?