本文整理汇总了C++中APlayerController::GetAudioListenerPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ APlayerController::GetAudioListenerPosition方法的具体用法?C++ APlayerController::GetAudioListenerPosition怎么用?C++ APlayerController::GetAudioListenerPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类APlayerController
的用法示例。
在下文中一共展示了APlayerController::GetAudioListenerPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
//.........这里部分代码省略.........
View->DiffuseOverrideParameter = FVector4(0.f, 0.f, 0.f, 0.f);
View->SpecularOverrideParameter = FVector4(1, 1, 1, 0.0f);
View->NormalOverrideParameter = FVector4(0, 0, 1, 0.0f);
View->RoughnessOverrideParameter = FVector2D(0.0f, 0.0f);
}
if (!View->Family->EngineShowFlags.Diffuse)
{
View->DiffuseOverrideParameter = FVector4(0.f, 0.f, 0.f, 0.f);
}
if (!View->Family->EngineShowFlags.Specular)
{
View->SpecularOverrideParameter = FVector4(0.f, 0.f, 0.f, 0.f);
}
View->CameraConstrainedViewRect = View->UnscaledViewRect;
// If this is the primary drawing pass, update things that depend on the view location
if (i == 0)
{
// Save the location of the view.
LocalPlayer->LastViewLocation = ViewLocation;
PlayerViewMap.Add(LocalPlayer, View);
// Update the listener.
if (AudioDevice != NULL)
{
FVector Location;
FVector ProjFront;
FVector ProjRight;
PlayerController->GetAudioListenerPosition(/*out*/ Location, /*out*/ ProjFront, /*out*/ ProjRight);
FTransform ListenerTransform(FRotationMatrix::MakeFromXY(ProjFront, ProjRight));
ListenerTransform.SetTranslation(Location);
ListenerTransform.NormalizeRotation();
bReverbSettingsFound = true;
FReverbSettings PlayerReverbSettings;
FInteriorSettings PlayerInteriorSettings;
class AAudioVolume* PlayerAudioVolume = GetWorld()->GetAudioSettings(Location, &PlayerReverbSettings, &PlayerInteriorSettings);
if (AudioVolume == nullptr || (PlayerAudioVolume != nullptr && PlayerAudioVolume->Priority > AudioVolume->Priority))
{
AudioVolume = PlayerAudioVolume;
ReverbSettings = PlayerReverbSettings;
}
uint32 ViewportIndex = PlayerViewMap.Num() - 1;
AudioDevice->SetListener(ViewportIndex, ListenerTransform, (View->bCameraCut ? 0.f : GetWorld()->GetDeltaSeconds()), PlayerAudioVolume, PlayerInteriorSettings);
}
}
// Add view information for resource streaming.
IStreamingManager::Get().AddViewInformation(View->ViewMatrices.ViewOrigin, View->ViewRect.Width(), View->ViewRect.Width() * View->ViewMatrices.ProjMatrix.M[0][0]);
GetWorld()->ViewLocationsRenderedLastFrame.Add(View->ViewMatrices.ViewOrigin);
}
}
}
}
}