Skip to content

Commit 160439a

Browse files
author
Joshua
committed
correct when to run the prediction data, its visual only and dedicated servers don't run it
1 parent cff504f commit 160439a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

VRExpansionPlugin/Source/VRExpansionPlugin/Private/VRRootComponent.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ void UVRRootComponent::TickComponent(float DeltaTime, enum ELevelTick TickType,
506506

507507
if (IsLocallyControlled())
508508
{
509+
bool bHadBadTracking = false;
510+
509511
if (owningVRChar && owningVRChar->bTrackingPaused)
510512
{
511513
curCameraLoc = owningVRChar->PausedTrackingLoc;
@@ -524,6 +526,7 @@ void UVRRootComponent::TickComponent(float DeltaTime, enum ELevelTick TickType,
524526
{
525527
curCameraLoc = lastCameraLoc;
526528
curCameraRot = lastCameraRot;
529+
bHadBadTracking = true;
527530
}
528531
else
529532
{
@@ -562,7 +565,7 @@ void UVRRootComponent::TickComponent(float DeltaTime, enum ELevelTick TickType,
562565

563566

564567
// Can adjust the relative tolerances to remove jitter and some update processing
565-
if (!bRetainRoomscale || (!curCameraLoc.Equals(lastCameraLoc, 0.01f) || !curCameraRot.Equals(lastCameraRot, 0.01f)))
568+
if (!bHadBadTracking && (!bRetainRoomscale || (!curCameraLoc.Equals(lastCameraLoc, 0.01f) || !curCameraRot.Equals(lastCameraRot, 0.01f))))
566569
{
567570
// Also calculate vector of movement for the movement component
568571
FVector LastPosition = OffsetComponentToWorld.GetLocation();
@@ -638,7 +641,6 @@ void UVRRootComponent::TickComponent(float DeltaTime, enum ELevelTick TickType,
638641
}
639642
else
640643
{
641-
642644
// Run this first so we get full fidelity on the relative space calculation
643645
FVector NewLocation = StoredCameraRotOffset.RotateVector(FVector(VRCapsuleOffset.X, VRCapsuleOffset.Y, 0.0f)) + curCameraLoc;
644646
FVector PlanerLocation = NewLocation - lastCameraLoc;
@@ -1545,7 +1547,7 @@ bool UVRRootComponent::IsLocallyControlled() const
15451547
GenerateOffsetToWorld();
15461548
}*/
15471549

1548-
if (!owningVRChar->bRetainRoomscale && !IsLocallyControlled())
1550+
if (!owningVRChar->bRetainRoomscale && !IsLocallyControlled() && !IsNetMode(NM_DedicatedServer))
15491551
{
15501552
// Don't smooth this change in mesh position
15511553
FNetworkPredictionData_Client_Character* ClientData = owningVRChar->GetCharacterMovement()->GetPredictionData_Client_Character();

0 commit comments

Comments
 (0)