Select Git revision
nest_controller.py
-
Jan Müller authoredJan Müller authored
VAReceiverActor.cpp 12.85 KiB
// Fill out your copyright notice in the Description page of Project Settings.
// what's up?
#include "VAReceiverActor.h"
#include "VAPlugin.h"
#include "VAUtils.h"
#include "VADefines.h"
#include "SoundSource/VAAbstractSourceComponent.h"
#include "ImageSourceModel/VAReflectionWall.h"
#include "Directivity/VADirectivityManager.h"
#include "HRIR/VAHRIRManager.h"
#include "Cluster/DisplayClusterClusterEvent.h"
#include "Engine/World.h" // World
#include "GameFramework/PlayerController.h" // Viewport
#include "IDisplayCluster.h" // For Events
#include "Pawn/VirtualRealityPawn.h" // VR Pawn
#include "Kismet/GameplayStatics.h" // Get Actors of class
#include "Utility/VirtualRealityUtilities.h"
// ****************************************************************** //
// ******* Initialization Functions ********************************* //
// ****************************************************************** //
AVAReceiverActor::AVAReceiverActor()
{
PrimaryActorTick.bCanEverTick = true;
DirManager = MakeShared<FVADirectivityManager>();
HRIRManager = MakeShared<FVAHRIRManager>();
AuralizationModeController = CreateDefaultSubobject<UVAAuralizationModeController>(TEXT("AuralizationModeController"));
}
void AVAReceiverActor::BeginPlay()
{
Super::BeginPlay();
FVAPlugin::SetReceiverActor(this);
// Cluster Stuff for Events //
RunOnAllNodesEvent.Attach(this);
// CurrentReceiverActor = this;
if(bReconnecToVAServer && UVirtualRealityUtilities::IsMaster() && FVAPlugin::IsConnected())
{
//this might be needed if different server version should be started between levels
FVAPlugin::DisconnectServer();
}
//try to start (remote) VAServer automatically
bool bStartedVAServer = false;
if (bAutomaticRemoteVAStart)
{
FVAPlugin::VAServerLauncher.StartVAServerLauncher(); //if possible
bStartedVAServer = FVAPlugin::VAServerLauncher.RemoteStartVAServer(GetIPAddress(), RemoteVAStarterPort, WhichVAServerVersionToStart);
if(bStartedVAServer){
FVAPlugin::SetUseVA(true);
}
}
// Ask if used or not
FVAPlugin::AskForSettings(GetIPAddress(), GetPort(), bAskForDebugMode, !bStartedVAServer);
if (UVirtualRealityUtilities::IsMaster())
{