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

refactor(pawn, movement)!: Renames pawn and movement to ARWTHVRPawn and...

refactor(pawn, movement)!: Renames pawn and movement to ARWTHVRPawn and UCollisionHandlingMovement. Add redirectors for now.
parent d71dc0dc
Branches
Tags
1 merge request!54refactor(all): Rename main classes to RWTHVR...
Showing
with 145 additions and 143 deletions
[CoreRedirects]
+PackageRedirects=(OldName="/nDisplayExtensions",NewName="/RWTHVRToolkit",MatchSubstring=true)
+PackageRedirects=(OldName="/DisplayClusterExtensions",NewName="/RWTHVRToolkit",MatchSubstring=true)
+ClassRedirects=(OldName="/Script/RWTHVRToolkit.VirtualRealityPawn",NewName="/Script/RWTHVRToolkit.RWTHVRPawn")
+ClassRedirects=(OldName="/Script/RWTHVRToolkit.VRPawnMovement",NewName="/Script/RWTHVRToolkit.CollisionHandlingMovement")
\ No newline at end of file
......@@ -13,7 +13,7 @@
#include "Engine/CollisionProfile.h"
#include "Logging/StructuredLog.h"
#include "Materials/MaterialInstanceDynamic.h"
#include "Pawn/VirtualRealityPawn.h"
#include "Pawn/RWTHVRPawn.h"
#include "Utility/RWTHVRUtilities.h"
......@@ -230,7 +230,7 @@ void ACAVEOverlayController::BeginPlay()
Overlay->CornerText->SetText(FText::FromString(""));
// Get the pawn so we can have access to head and hand positions
VRPawn = Cast<AVirtualRealityPawn>(PC->GetPawnOrSpectator());
VRPawn = Cast<ARWTHVRPawn>(PC->GetPawnOrSpectator());
if (VRPawn)
{
// we're good to go!
......
......@@ -4,7 +4,7 @@
#include "GameFramework/Actor.h"
#include "CAVEOverlay/DoorOverlayData.h"
#include "Cluster/IDisplayClusterClusterManager.h"
#include "Pawn/VirtualRealityPawn.h"
#include "Pawn/RWTHVRPawn.h"
#include "CAVEOverlayController.generated.h"
DECLARE_LOG_CATEGORY_EXTERN(LogCAVEOverlay, Log, All);
......@@ -86,7 +86,7 @@ private:
// Reference to the currently active pawn that we're tracking positions of.
UPROPERTY()
AVirtualRealityPawn* VRPawn;
ARWTHVRPawn* VRPawn;
// Cluster Events
FOnClusterEventJsonListener ClusterEventListenerDelegate;
......
#include "Pawn/Navigation/VRPawnMovement.h"
#include "Pawn/Navigation/CollisionHandlingMovement.h"
#include "Kismet/KismetSystemLibrary.h"
UVRPawnMovement::UVRPawnMovement(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
UCollisionHandlingMovement::UCollisionHandlingMovement(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
// the capsule is used to store the players size and position, e.g., for other interactions and as starting point
// for the capsule trace (which however not use the capsule component directly)
......@@ -19,7 +19,7 @@ UVRPawnMovement::UVRPawnMovement(const FObjectInitializer& ObjectInitializer) :
Deceleration = 2000.f;
}
void UVRPawnMovement::BeginPlay()
void UCollisionHandlingMovement::BeginPlay()
{
Super::BeginPlay();
LastSteeringCollisionVector = FVector(0, 0, 0);
......@@ -29,7 +29,7 @@ void UVRPawnMovement::BeginPlay()
}
void UVRPawnMovement::TickComponent(float DeltaTime, enum ELevelTick TickType,
void UCollisionHandlingMovement::TickComponent(float DeltaTime, enum ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction)
{
SetCapsuleColliderToUserSize();
......@@ -84,7 +84,7 @@ void UVRPawnMovement::TickComponent(float DeltaTime, enum ELevelTick TickType,
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
}
void UVRPawnMovement::SetHeadComponent(USceneComponent* NewHeadComponent)
void UCollisionHandlingMovement::SetHeadComponent(USceneComponent* NewHeadComponent)
{
HeadComponent = NewHeadComponent;
CapsuleColliderComponent->SetupAttachment(HeadComponent);
......@@ -93,7 +93,7 @@ void UVRPawnMovement::SetHeadComponent(USceneComponent* NewHeadComponent)
CapsuleColliderComponent->SetWorldLocation(FVector(0.0f, 0.0f, -HalfHeight));
}
void UVRPawnMovement::SetCapsuleColliderToUserSize() const
void UCollisionHandlingMovement::SetCapsuleColliderToUserSize() const
{
// the collider should be placed
// between head and floor + MaxStepHeight
......@@ -139,7 +139,7 @@ void UVRPawnMovement::SetCapsuleColliderToUserSize() const
CapsuleColliderComponent->SetWorldRotation(FRotator::ZeroRotator);
}
void UVRPawnMovement::CheckAndRevertCollisionSinceLastTick()
void UCollisionHandlingMovement::CheckAndRevertCollisionSinceLastTick()
{
const FVector CapsuleLocation = CapsuleColliderComponent->GetComponentLocation();
......@@ -165,7 +165,7 @@ void UVRPawnMovement::CheckAndRevertCollisionSinceLastTick()
}
}
void UVRPawnMovement::MoveOutOfNewDynamicCollisions()
void UCollisionHandlingMovement::MoveOutOfNewDynamicCollisions()
{
TOptional<FVector> ResolveDirectionOptional = GetOverlapResolveDirection();
......@@ -179,7 +179,7 @@ void UVRPawnMovement::MoveOutOfNewDynamicCollisions()
}
}
void UVRPawnMovement::CheckForPhysWalkingCollision()
void UCollisionHandlingMovement::CheckForPhysWalkingCollision()
{
if (!LastCollisionFreeCapsulePosition.IsSet())
{
......@@ -199,7 +199,7 @@ void UVRPawnMovement::CheckForPhysWalkingCollision()
}
}
FVector UVRPawnMovement::GetCollisionSafeVirtualSteeringVec(FVector InputVector, float DeltaTime)
FVector UCollisionHandlingMovement::GetCollisionSafeVirtualSteeringVec(FVector InputVector, float DeltaTime)
{
// if we were in a collision in the last step already (so no LastCollisionFreeCapsulePosition is set)
// we allow movement to resole this collision (otherwise you wold be stuck forever)
......@@ -243,7 +243,7 @@ FVector UVRPawnMovement::GetCollisionSafeVirtualSteeringVec(FVector InputVector,
return SafeInput;
}
void UVRPawnMovement::MoveByGravityOrStepUp(float DeltaSeconds)
void UCollisionHandlingMovement::MoveByGravityOrStepUp(float DeltaSeconds)
{
const FVector DownTraceStart = CapsuleColliderComponent->GetComponentLocation();
const float DownTraceDist = MaxFallingDepth < 0.0f ? 1000.0f : MaxFallingDepth;
......@@ -282,7 +282,7 @@ void UVRPawnMovement::MoveByGravityOrStepUp(float DeltaSeconds)
}
}
void UVRPawnMovement::ShiftVertically(float Distance, float VerticalAcceleration, float DeltaSeconds)
void UCollisionHandlingMovement::ShiftVertically(float Distance, float VerticalAcceleration, float DeltaSeconds)
{
VerticalSpeed += VerticalAcceleration * DeltaSeconds;
if (abs(VerticalSpeed * DeltaSeconds) < abs(Distance))
......@@ -296,7 +296,7 @@ void UVRPawnMovement::ShiftVertically(float Distance, float VerticalAcceleration
}
}
FHitResult UVRPawnMovement::CreateCapsuleTrace(const FVector& Start, const FVector& End, const bool DrawDebug) const
FHitResult UCollisionHandlingMovement::CreateCapsuleTrace(const FVector& Start, const FVector& End, const bool DrawDebug) const
{
const EDrawDebugTrace::Type DrawType = DrawDebug ? EDrawDebugTrace::Type::ForDuration : EDrawDebugTrace::Type::None;
......@@ -310,7 +310,7 @@ FHitResult UVRPawnMovement::CreateCapsuleTrace(const FVector& Start, const FVect
return Hit;
}
TOptional<FVector> UVRPawnMovement::GetOverlapResolveDirection() const
TOptional<FVector> UCollisionHandlingMovement::GetOverlapResolveDirection() const
{
TArray<UPrimitiveComponent*> OverlappingComponents;
TArray<TEnumAsByte<EObjectTypeQuery>> traceObjectTypes;
......
......@@ -6,14 +6,14 @@
#include "EnhancedInputSubsystems.h"
#include "Engine/LocalPlayer.h"
#include "GameFramework/PlayerController.h"
#include "Pawn/VirtualRealityPawn.h"
#include "Pawn/RWTHVRPawn.h"
#include "Utility/RWTHVRUtilities.h"
void UMovementComponentBase::SetupPlayerInput(UInputComponent* PlayerInputComponent)
{
IInputExtensionInterface::SetupPlayerInput(PlayerInputComponent);
VRPawn = Cast<AVirtualRealityPawn>(GetOwner());
VRPawn = Cast<ARWTHVRPawn>(GetOwner());
if (!VRPawn || !VRPawn->HasLocalNetOwner())
{
......
......@@ -5,7 +5,7 @@
#include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h"
#include "Pawn/VirtualRealityPawn.h"
#include "Pawn/RWTHVRPawn.h"
#include "Utility/RWTHVRUtilities.h"
void UTurnComponent::SetupPlayerInput(UInputComponent* PlayerInputComponent)
......
// Fill out your copyright notice in the Description page of Project Settings.
#include "Pawn/VirtualRealityPawn.h"
#include "Pawn/RWTHVRPawn.h"
#include "Engine/LocalPlayer.h"
#include "GameFramework/PlayerController.h"
......@@ -9,13 +9,13 @@
#include "Kismet/GameplayStatics.h"
#include "Logging/StructuredLog.h"
#include "Pawn/InputExtensionInterface.h"
#include "Pawn/Navigation/VRPawnMovement.h"
#include "Pawn/Navigation/CollisionHandlingMovement.h"
#include "Pawn/ReplicatedCameraComponent.h"
#include "Pawn/ReplicatedMotionControllerComponent.h"
#include "Roles/LiveLinkTransformTypes.h"
#include "Utility/RWTHVRUtilities.h"
AVirtualRealityPawn::AVirtualRealityPawn(const FObjectInitializer& ObjectInitializer)
ARWTHVRPawn::ARWTHVRPawn(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
BaseEyeHeight = 160.0f;
......@@ -27,7 +27,7 @@ AVirtualRealityPawn::AVirtualRealityPawn(const FObjectInitializer& ObjectInitial
HeadCameraComponent->SetRelativeLocation(FVector(0.0f, 0.0f, BaseEyeHeight));
//so it is rendered correctly in editor
PawnMovement = CreateDefaultSubobject<UVRPawnMovement>(TEXT("Pawn Movement"));
PawnMovement = CreateDefaultSubobject<UCollisionHandlingMovement>(TEXT("Pawn Movement"));
PawnMovement->SetUpdatedComponent(RootComponent);
PawnMovement->SetHeadComponent(HeadCameraComponent);
......@@ -38,7 +38,7 @@ AVirtualRealityPawn::AVirtualRealityPawn(const FObjectInitializer& ObjectInitial
LeftHand->SetupAttachment(RootComponent);
}
void AVirtualRealityPawn::Tick(float DeltaSeconds)
void ARWTHVRPawn::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
......@@ -56,7 +56,7 @@ void AVirtualRealityPawn::Tick(float DeltaSeconds)
*/
// This pawn's controller has changed! This is called on both server and owning client. If we are the owning client
// and the master, request that the DCRA is attached to us.
void AVirtualRealityPawn::NotifyControllerChanged()
void ARWTHVRPawn::NotifyControllerChanged()
{
Super::NotifyControllerChanged();
......@@ -77,7 +77,7 @@ void AVirtualRealityPawn::NotifyControllerChanged()
}
}
void AVirtualRealityPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
void ARWTHVRPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
......@@ -127,7 +127,7 @@ void AVirtualRealityPawn::SetupPlayerInputComponent(UInputComponent* PlayerInput
}
}
void AVirtualRealityPawn::EvaluateLivelink() const
void ARWTHVRPawn::EvaluateLivelink() const
{
if (URWTHVRUtilities::IsRoomMountedMode() && IsLocallyControlled())
{
......@@ -158,7 +158,7 @@ void AVirtualRealityPawn::EvaluateLivelink() const
}
}
void AVirtualRealityPawn::UpdateRightHandForDesktopInteraction() const
void ARWTHVRPawn::UpdateRightHandForDesktopInteraction() const
{
if (const APlayerController* PC = Cast<APlayerController>(GetController()))
{
......@@ -181,7 +181,7 @@ void AVirtualRealityPawn::UpdateRightHandForDesktopInteraction() const
// Todo rewrite this in some other way or attach it differently, this is horrible
// Executed on the server only: Finds and attaches the CaveSetup Actor, which contains the DCRA to the Pawn.
// It is only executed on the server because attachments are synced to all clients, but not from client to server.
void AVirtualRealityPawn::AttachDCRAtoPawn()
void ARWTHVRPawn::AttachDCRAtoPawn()
{
if (!CaveSetupActorClass || !CaveSetupActorClass->IsValidLowLevelFast())
{
......@@ -208,7 +208,7 @@ void AVirtualRealityPawn::AttachDCRAtoPawn()
}
}
void AVirtualRealityPawn::SetupMotionControllerSources()
void ARWTHVRPawn::SetupMotionControllerSources()
{
// Setup Motion Controllers
......@@ -229,13 +229,13 @@ void AVirtualRealityPawn::SetupMotionControllerSources()
}
// Requests the server to perform the attachment, as only the server can sync this to all the other clients.
void AVirtualRealityPawn::ServerAttachDCRAtoPawnRpc_Implementation()
void ARWTHVRPawn::ServerAttachDCRAtoPawnRpc_Implementation()
{
// We're on the server here - attach the actor to the pawn.
AttachDCRAtoPawn();
}
void AVirtualRealityPawn::SetCameraOffset() const
void ARWTHVRPawn::SetCameraOffset() const
{
// this also incorporates the BaseEyeHeight, if set as static offset,
// rotations are still around the center of the pawn (on the floor), so pitch rotations look weird
......@@ -245,7 +245,7 @@ void AVirtualRealityPawn::SetCameraOffset() const
HeadCameraComponent->SetWorldLocationAndRotation(Location, Rotation);
}
void AVirtualRealityPawn::ApplyLiveLinkTransform(const FTransform& Transform,
void ARWTHVRPawn::ApplyLiveLinkTransform(const FTransform& Transform,
const FLiveLinkTransformStaticData& StaticData) const
{
if (StaticData.bIsLocationSupported)
......
......@@ -4,7 +4,7 @@
#include "GameFramework/FloatingPawnMovement.h"
#include "Components/CapsuleComponent.h"
#include "VRPawnMovement.generated.h"
#include "CollisionHandlingMovement.generated.h"
/*
* This Movement component is needed since in VR not only the pawn itself (UpdatedComponent) is moved but also the
......@@ -28,7 +28,7 @@ enum class EVRNavigationModes : uint8
};
UCLASS()
class RWTHVRTOOLKIT_API UVRPawnMovement : public UFloatingPawnMovement
class RWTHVRTOOLKIT_API UCollisionHandlingMovement : public UFloatingPawnMovement
{
GENERATED_UCLASS_BODY()
......
......@@ -3,7 +3,7 @@
#pragma once
#include "CoreMinimal.h"
#include "Pawn/VirtualRealityPawn.h"
#include "Pawn/RWTHVRPawn.h"
#include "Pawn/Navigation/MovementComponentBase.h"
#include "Components/ActorComponent.h"
#include "ContinuousMovementComponent.generated.h"
......
......@@ -7,7 +7,7 @@
#include "Pawn/InputExtensionInterface.h"
#include "MovementComponentBase.generated.h"
class AVirtualRealityPawn;
class ARWTHVRPawn;
/**
* Base component for specialized MovementComponents. Currently only saves pointers to pawn and input system.
* Might be used for common replication later on.
......@@ -23,7 +23,7 @@ public:
protected:
UPROPERTY()
AVirtualRealityPawn* VRPawn;
ARWTHVRPawn* VRPawn;
UPROPERTY()
UEnhancedInputLocalPlayerSubsystem* InputSubsystem;
......
......@@ -4,7 +4,7 @@
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "Pawn/VirtualRealityPawn.h"
#include "Pawn/RWTHVRPawn.h"
#include "NiagaraComponent.h"
#include "Kismet/GameplayStaticsTypes.h"
#include "Pawn/Navigation/MovementComponentBase.h"
......
......@@ -4,8 +4,8 @@
#include "CoreMinimal.h"
#include "LiveLinkRole.h"
#include "Pawn/Navigation/VRPawnMovement.h"
#include "VirtualRealityPawn.generated.h"
#include "Pawn/Navigation/CollisionHandlingMovement.h"
#include "RWTHVRPawn.generated.h"
class UInputMappingContext;
class UInputAction;
......@@ -17,12 +17,12 @@ struct FLiveLinkTransformStaticData;
* Pawn implementation with additional VR functionality, can be used in the Cave, with an HMD and on desktop.
*/
UCLASS(Abstract)
class RWTHVRTOOLKIT_API AVirtualRealityPawn : public APawn
class RWTHVRTOOLKIT_API ARWTHVRPawn : public APawn
{
GENERATED_BODY()
public:
AVirtualRealityPawn(const FObjectInitializer& ObjectInitializer);
ARWTHVRPawn(const FObjectInitializer& ObjectInitializer);
virtual void Tick(float DeltaSeconds) override;
......@@ -36,7 +36,7 @@ public:
/* Movement */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Pawn|Movement")
UVRPawnMovement* PawnMovement;
UCollisionHandlingMovement* PawnMovement;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Pawn|Desktop Movement")
bool bMoveRightHandWithMouse = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment