Skip to content
Snippets Groups Projects
Commit d62edb9b authored by Jonathan Ehret's avatar Jonathan Ehret
Browse files

Merge branch 'debug-output-CAVE-tracking' into 'fix/cluster-stuff'

Debug output cave tracking

See merge request !8
parents 83e7b344 5bfb0ceb
No related branches found
No related tags found
2 merge requests!9VAServerLauncher Improvement (now also sending reproduction type and ini),!8Debug output cave tracking
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "SoundSource/VASoundSourceRepresentation.h" #include "SoundSource/VASoundSourceRepresentation.h"
#include "Engine/World.h" #include "Engine/World.h"
#include "Utility/VirtualRealityUtilities.h"
// ****************************************************************** // // ****************************************************************** //
...@@ -73,7 +74,7 @@ void FVASoundSource::SetPosition(const FVector NewPosition) ...@@ -73,7 +74,7 @@ void FVASoundSource::SetPosition(const FVector NewPosition)
{ {
Position = NewPosition; Position = NewPosition;
if (!FVAPlugin::SetSoundSourcePosition(SoundSourceID, Position)) if (!FVAPlugin::SetSoundSourcePosition(SoundSourceID, Position) && UVirtualRealityUtilities::IsMaster())
{ {
FVAUtils::LogStuff("[FVASoundSource::SetPosition()]:" + FVAUtils::LogStuff("[FVASoundSource::SetPosition()]:" +
FString(" Could not set sound source position in VA. Position of visual and auditive representation might mismatch now."), true); FString(" Could not set sound source position in VA. Position of visual and auditive representation might mismatch now."), true);
...@@ -86,7 +87,7 @@ void FVASoundSource::SetRotation(const FRotator NewRotation) ...@@ -86,7 +87,7 @@ void FVASoundSource::SetRotation(const FRotator NewRotation)
{ {
Rotation = NewRotation; Rotation = NewRotation;
if (!FVAPlugin::SetSoundSourceRotation(SoundSourceID, Rotation)) if (!FVAPlugin::SetSoundSourceRotation(SoundSourceID, Rotation) && UVirtualRealityUtilities::IsMaster())
{ {
FVAUtils::LogStuff("[FVASoundSource::SetRotation()]:" + FVAUtils::LogStuff("[FVASoundSource::SetRotation()]:" +
FString(" Could not set sound source rotation in VA. Orientation of visual and auditive representation might mismatch now."), true); FString(" Could not set sound source rotation in VA. Orientation of visual and auditive representation might mismatch now."), true);
......
...@@ -257,13 +257,28 @@ bool AVAReceiverActor::UpdateVirtualWorldPose() ...@@ -257,13 +257,28 @@ bool AVAReceiverActor::UpdateVirtualWorldPose()
if(TrackingSource == ETrackingSource::VirtualRealityPawn) if(TrackingSource == ETrackingSource::VirtualRealityPawn)
{ {
// Auralization Pose is coppled to the Virtual Reality Pawn, e.g, HMD, CAVE // Auralization Pose is coupled to the Virtual Reality Pawn, e.g, HMD, CAVE
FVector ViewPos;
FRotator ViewRot; AVirtualRealityPawn* VirtualRealityPawn = Cast<AVirtualRealityPawn>(GetWorld()->GetFirstPlayerController()->AcknowledgedPawn);
GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint(ViewPos, ViewRot); if (VirtualRealityPawn == nullptr)
{
return false;
}
USceneComponent* Head = VirtualRealityPawn->Head;
if (!Head)
{
return false;
}
FVector ViewPos = Head->GetComponentLocation();
FRotator ViewRot = Head->GetComponentRotation();
//Offset from ViewPoint (between eyes) to head center, rotate according to view rotation
ViewPos += ViewRot.RotateVector(ViewpointToHeadcenterOffset);
bool bResult = true; bool bResult = true;
bResult &= FVAPlugin::SetSoundReceiverPosition(ReceiverID, ViewPos + ViewRot.RotateVector(ViewpointToHeadcenterOffset)); //Offset from ViewPoint (between eyes) to head center, rotate according to view rotation bResult &= FVAPlugin::SetSoundReceiverPosition(ReceiverID, ViewPos);
bResult &= FVAPlugin::SetSoundReceiverRotation(ReceiverID, ViewRot); bResult &= FVAPlugin::SetSoundReceiverRotation(ReceiverID, ViewRot);
return bResult; return bResult;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment