Skip to content
Snippets Groups Projects
Commit 851e2150 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

refactor(replication): Renames FTransformRep to FReplicatedTransform

parent d89312a0
No related branches found
No related tags found
1 merge request!54refactor(all): Rename main classes to RWTHVR...
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
+PackageRedirects=(OldName="/DisplayClusterExtensions",NewName="/RWTHVRToolkit",MatchSubstring=true) +PackageRedirects=(OldName="/DisplayClusterExtensions",NewName="/RWTHVRToolkit",MatchSubstring=true)
+ClassRedirects=(OldName="/Script/RWTHVRToolkit.VirtualRealityPawn",NewName="/Script/RWTHVRToolkit.RWTHVRPawn") +ClassRedirects=(OldName="/Script/RWTHVRToolkit.VirtualRealityPawn",NewName="/Script/RWTHVRToolkit.RWTHVRPawn")
+ClassRedirects=(OldName="/Script/RWTHVRToolkit.VRPawnMovement",NewName="/Script/RWTHVRToolkit.CollisionHandlingMovement") +ClassRedirects=(OldName="/Script/RWTHVRToolkit.VRPawnMovement",NewName="/Script/RWTHVRToolkit.CollisionHandlingMovement")
+StructRedirects=(OldName="/Script/RWTHVRToolkit.VRTransformRep",NewName="/Script/RWTHVRToolkit.ReplicatedTransform")
\ No newline at end of file
...@@ -77,7 +77,7 @@ void UClientTransformReplication::GetLifetimeReplicatedProps(TArray<class FLifet ...@@ -77,7 +77,7 @@ void UClientTransformReplication::GetLifetimeReplicatedProps(TArray<class FLifet
} }
// Apply the state update on the server // Apply the state update on the server
void UClientTransformReplication::ServerSendControllerTransformRpc_Implementation(FVRTransformRep NewTransform) void UClientTransformReplication::ServerSendControllerTransformRpc_Implementation(FReplicatedTransform NewTransform)
{ {
// Store new transform and trigger OnRep_Function // Store new transform and trigger OnRep_Function
ReplicatedTransform = NewTransform; ReplicatedTransform = NewTransform;
...@@ -90,7 +90,7 @@ void UClientTransformReplication::ServerSendControllerTransformRpc_Implementatio ...@@ -90,7 +90,7 @@ void UClientTransformReplication::ServerSendControllerTransformRpc_Implementatio
OnRep_ReplicatedTransform(); OnRep_ReplicatedTransform();
} }
bool UClientTransformReplication::ServerSendControllerTransformRpc_Validate(FVRTransformRep NewTransform) bool UClientTransformReplication::ServerSendControllerTransformRpc_Validate(FReplicatedTransform NewTransform)
{ {
return true; return true;
// Optionally check to make sure that player is inside of their bounds and deny it if they aren't? // Optionally check to make sure that player is inside of their bounds and deny it if they aren't?
......
#pragma once #pragma once
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "VRTransformRep.generated.h" #include "ReplicatedTransform.generated.h"
// Simple custom transform struct for more efficient repliation, from VRE Plugin // Simple custom transform struct for more efficient repliation, from VRE Plugin
USTRUCT() USTRUCT()
struct RWTHVRTOOLKIT_API FVRTransformRep struct RWTHVRTOOLKIT_API FReplicatedTransform
{ {
GENERATED_USTRUCT_BODY() GENERATED_USTRUCT_BODY()
...@@ -16,7 +16,7 @@ public: ...@@ -16,7 +16,7 @@ public:
UPROPERTY(Transient) UPROPERTY(Transient)
FRotator Rotation; FRotator Rotation;
FVRTransformRep() FReplicatedTransform()
{ {
Position = FVector::ZeroVector; Position = FVector::ZeroVector;
Rotation = FRotator::ZeroRotator; Rotation = FRotator::ZeroRotator;
......
...@@ -66,7 +66,7 @@ void UReplicatedCameraComponent::GetLifetimeReplicatedProps(TArray<class FLifeti ...@@ -66,7 +66,7 @@ void UReplicatedCameraComponent::GetLifetimeReplicatedProps(TArray<class FLifeti
DOREPLIFETIME(UReplicatedCameraComponent, ControllerNetUpdateRate); DOREPLIFETIME(UReplicatedCameraComponent, ControllerNetUpdateRate);
} }
void UReplicatedCameraComponent::ServerSendControllerTransformRpc_Implementation(FVRTransformRep NewTransform) void UReplicatedCameraComponent::ServerSendControllerTransformRpc_Implementation(FReplicatedTransform NewTransform)
{ {
// Store new transform and trigger OnRep_Function // Store new transform and trigger OnRep_Function
ReplicatedTransform = NewTransform; ReplicatedTransform = NewTransform;
...@@ -75,7 +75,7 @@ void UReplicatedCameraComponent::ServerSendControllerTransformRpc_Implementation ...@@ -75,7 +75,7 @@ void UReplicatedCameraComponent::ServerSendControllerTransformRpc_Implementation
OnRep_ReplicatedTransform(); OnRep_ReplicatedTransform();
} }
bool UReplicatedCameraComponent::ServerSendControllerTransformRpc_Validate(FVRTransformRep NewTransform) bool UReplicatedCameraComponent::ServerSendControllerTransformRpc_Validate(FReplicatedTransform NewTransform)
{ {
return true; return true;
// Optionally check to make sure that player is inside of their bounds and deny it if they aren't? // Optionally check to make sure that player is inside of their bounds and deny it if they aren't?
......
...@@ -69,7 +69,7 @@ void UReplicatedMotionControllerComponent::GetLifetimeReplicatedProps( ...@@ -69,7 +69,7 @@ void UReplicatedMotionControllerComponent::GetLifetimeReplicatedProps(
// See UClientTransformReplication::ServerSendControllerTransformRpc_Implementation // See UClientTransformReplication::ServerSendControllerTransformRpc_Implementation
void UReplicatedMotionControllerComponent::ServerSendControllerTransformRpc_Implementation( void UReplicatedMotionControllerComponent::ServerSendControllerTransformRpc_Implementation(
FVRTransformRep NewTransform) FReplicatedTransform NewTransform)
{ {
// Store new transform and trigger OnRep_Function // Store new transform and trigger OnRep_Function
ReplicatedTransform = NewTransform; ReplicatedTransform = NewTransform;
...@@ -78,7 +78,7 @@ void UReplicatedMotionControllerComponent::ServerSendControllerTransformRpc_Impl ...@@ -78,7 +78,7 @@ void UReplicatedMotionControllerComponent::ServerSendControllerTransformRpc_Impl
OnRep_ReplicatedTransform(); OnRep_ReplicatedTransform();
} }
bool UReplicatedMotionControllerComponent::ServerSendControllerTransformRpc_Validate(FVRTransformRep NewTransform) bool UReplicatedMotionControllerComponent::ServerSendControllerTransformRpc_Validate(FReplicatedTransform NewTransform)
{ {
return true; return true;
// Optionally check to make sure that player is inside of their bounds and deny it if they aren't? // Optionally check to make sure that player is inside of their bounds and deny it if they aren't?
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Components/ActorComponent.h" #include "Components/ActorComponent.h"
#include "Core/VRTransformRep.h" #include "Core/ReplicatedTransform.h"
#include "ClientTransformReplication.generated.h" #include "ClientTransformReplication.generated.h"
...@@ -44,7 +44,7 @@ protected: ...@@ -44,7 +44,7 @@ protected:
// Replicated transform property - used to replicate from server to all non-owning clients // Replicated transform property - used to replicate from server to all non-owning clients
UPROPERTY(EditDefaultsOnly, ReplicatedUsing = OnRep_ReplicatedTransform, Category = "Networking") UPROPERTY(EditDefaultsOnly, ReplicatedUsing = OnRep_ReplicatedTransform, Category = "Networking")
FVRTransformRep ReplicatedTransform; FReplicatedTransform ReplicatedTransform;
// Called whenever ReplicatedTransform is replicated to clients. Not called on Owning client, manually called on server // Called whenever ReplicatedTransform is replicated to clients. Not called on Owning client, manually called on server
UFUNCTION() UFUNCTION()
...@@ -59,7 +59,7 @@ protected: ...@@ -59,7 +59,7 @@ protected:
// Unreliable Server RPC that sends the transform from owning client to the server // Unreliable Server RPC that sends the transform from owning client to the server
UFUNCTION(Unreliable, Server, WithValidation) UFUNCTION(Unreliable, Server, WithValidation)
void ServerSendControllerTransformRpc(FVRTransformRep NewTransform); void ServerSendControllerTransformRpc(FReplicatedTransform NewTransform);
// Function called each tick that checks if we need to send a new state from our local net owner to the server. // Function called each tick that checks if we need to send a new state from our local net owner to the server.
void UpdateState(float DeltaTime); void UpdateState(float DeltaTime);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Camera/CameraComponent.h" #include "Camera/CameraComponent.h"
#include "Core/VRTransformRep.h" #include "Core/ReplicatedTransform.h"
#include "ReplicatedCameraComponent.generated.h" #include "ReplicatedCameraComponent.generated.h"
/** /**
...@@ -37,7 +37,7 @@ protected: ...@@ -37,7 +37,7 @@ protected:
float ControllerNetUpdateCount; float ControllerNetUpdateCount;
UPROPERTY(EditDefaultsOnly, ReplicatedUsing = OnRep_ReplicatedTransform, Category = "Networking") UPROPERTY(EditDefaultsOnly, ReplicatedUsing = OnRep_ReplicatedTransform, Category = "Networking")
FVRTransformRep ReplicatedTransform; FReplicatedTransform ReplicatedTransform;
void UpdateState(float DeltaTime); void UpdateState(float DeltaTime);
...@@ -50,7 +50,7 @@ protected: ...@@ -50,7 +50,7 @@ protected:
} }
UFUNCTION(Unreliable, Server, WithValidation) UFUNCTION(Unreliable, Server, WithValidation)
void ServerSendControllerTransformRpc(FVRTransformRep NewTransform); void ServerSendControllerTransformRpc(FReplicatedTransform NewTransform);
public: public:
// Called every frame // Called every frame
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "MotionControllerComponent.h" #include "MotionControllerComponent.h"
#include "Core/VRTransformRep.h" #include "Core/ReplicatedTransform.h"
#include "ReplicatedMotionControllerComponent.generated.h" #include "ReplicatedMotionControllerComponent.generated.h"
/** /**
...@@ -33,7 +33,7 @@ protected: ...@@ -33,7 +33,7 @@ protected:
float ControllerNetUpdateCount; float ControllerNetUpdateCount;
UPROPERTY(EditDefaultsOnly, ReplicatedUsing = OnRep_ReplicatedTransform, Category = "Networking") UPROPERTY(EditDefaultsOnly, ReplicatedUsing = OnRep_ReplicatedTransform, Category = "Networking")
FVRTransformRep ReplicatedTransform; FReplicatedTransform ReplicatedTransform;
/* /*
* See UClientTransformReplication for a description of the replication functions, they work exactly the same way. * See UClientTransformReplication for a description of the replication functions, they work exactly the same way.
...@@ -48,7 +48,7 @@ protected: ...@@ -48,7 +48,7 @@ protected:
} }
UFUNCTION(Unreliable, Server, WithValidation) UFUNCTION(Unreliable, Server, WithValidation)
void ServerSendControllerTransformRpc(FVRTransformRep NewTransform); void ServerSendControllerTransformRpc(FReplicatedTransform NewTransform);
public: public:
// Called every frame // Called every frame
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment