From 232b07716b517b6186794345ac901a5e0bc2f480 Mon Sep 17 00:00:00 2001 From: Timon Roemer <t.roemer@vis.rwth-aachen.de> Date: Wed, 8 May 2024 09:57:13 +0200 Subject: [PATCH] Change formatting --- RWTHVRToolkit.uplugin | 108 +++++++++--------- .../Private/Core/ReplicatedTransform.h | 22 ++-- .../IntenSelectableCircleScoring.cpp | 8 +- .../DirectInteractionComponent.cpp | 3 +- .../Private/Pawn/IntenSelectComponent.cpp | 2 +- .../RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp | 3 +- .../Pawn/ReplicatedCameraComponent.cpp | 2 +- Source/RWTHVRToolkit/RWTHVRToolkit.Build.cs | 44 +++---- ...IntenSelectableCircleScoringVisualizer.cpp | 44 ++++--- .../RWTHVRToolkitEditor.Build.cs | 66 +++++------ 10 files changed, 148 insertions(+), 154 deletions(-) diff --git a/RWTHVRToolkit.uplugin b/RWTHVRToolkit.uplugin index 4827226d..22649239 100644 --- a/RWTHVRToolkit.uplugin +++ b/RWTHVRToolkit.uplugin @@ -1,56 +1,56 @@ { - "FileVersion": 3, - "Version": 1, - "VersionName": "1.0", - "FriendlyName": "RWTH VR Toolkit", - "Description": "", - "Category": "Other", - "CreatedBy": "", - "CreatedByURL": "", - "DocsURL": "", - "MarketplaceURL": "", - "SupportURL": "", - "CanContainContent": true, - "IsBetaVersion": false, - "Installed": false, - "EnabledByDefault": true, - "Modules": [ - { - "Name": "RWTHVRToolkit", - "Type": "Runtime", - "LoadingPhase": "Default" - }, - { - "Name": "RWTHVRToolkitEditor", - "Type": "Editor", - "LoadingPhase": "PostEngineInit" - } - ], - "Plugins": [ - { - "Name": "RWTHVRCluster", - "Enabled": true, - "Optional": true, - "SupportedTargetPlatforms": [ - "Win64", - "Linux" - ] - }, - { - "Name": "LiveLink", - "Enabled": true - }, - { - "Name": "EnhancedInput", - "Enabled": true - }, - { - "Name": "Niagara", - "Enabled": true - }, - { - "Name": "XRBase", - "Enabled": true - } - ] + "FileVersion": 3, + "Version": 1, + "VersionName": "1.0", + "FriendlyName": "RWTH VR Toolkit", + "Description": "", + "Category": "Other", + "CreatedBy": "", + "CreatedByURL": "", + "DocsURL": "", + "MarketplaceURL": "", + "SupportURL": "", + "CanContainContent": true, + "IsBetaVersion": false, + "Installed": false, + "EnabledByDefault": true, + "Modules": [ + { + "Name": "RWTHVRToolkit", + "Type": "Runtime", + "LoadingPhase": "Default" + }, + { + "Name": "RWTHVRToolkitEditor", + "Type": "Editor", + "LoadingPhase": "PostEngineInit" + } + ], + "Plugins": [ + { + "Name": "RWTHVRCluster", + "Enabled": true, + "Optional": true, + "SupportedTargetPlatforms": [ + "Win64", + "Linux" + ] + }, + { + "Name": "LiveLink", + "Enabled": true + }, + { + "Name": "EnhancedInput", + "Enabled": true + }, + { + "Name": "Niagara", + "Enabled": true + }, + { + "Name": "XRBase", + "Enabled": true + } + ] } diff --git a/Source/RWTHVRToolkit/Private/Core/ReplicatedTransform.h b/Source/RWTHVRToolkit/Private/Core/ReplicatedTransform.h index 17953b8f..9eb6a4fc 100644 --- a/Source/RWTHVRToolkit/Private/Core/ReplicatedTransform.h +++ b/Source/RWTHVRToolkit/Private/Core/ReplicatedTransform.h @@ -23,16 +23,18 @@ public: } /** - * @param Ar FArchive to read or write from. - * @param Map PackageMap used to resolve references to UObject* - * @param bOutSuccess return value to signify if the serialization was succesfull (if false, an error will be logged by the calling function) - * - * @return return true if the serialization was fully mapped. If false, the property will be considered 'dirty' and will replicate again on the next update. - * This is needed for UActor* properties. If an actor's Actorchannel is not fully mapped, properties referencing it must stay dirty. - * Note that UPackageMap::SerializeObject returns false if an object is unmapped. Generally, you will want to return false from your ::NetSerialize - * if you make any calls to ::SerializeObject that return false. - * - */ + * @param Ar FArchive to read or write from. + * @param Map PackageMap used to resolve references to UObject* + * @param bOutSuccess return value to signify if the serialization was succesfull (if false, an error will be logged + * by the calling function) + * + * @return return true if the serialization was fully mapped. If false, the property will be considered 'dirty' and + * will replicate again on the next update. This is needed for UActor* properties. If an actor's Actorchannel is not + * fully mapped, properties referencing it must stay dirty. Note that UPackageMap::SerializeObject returns false if + * an object is unmapped. Generally, you will want to return false from your ::NetSerialize if you make any calls to + * ::SerializeObject that return false. + * + */ bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess) { bOutSuccess = true; diff --git a/Source/RWTHVRToolkit/Private/Interaction/Interactables/IntenSelect/IntenSelectableCircleScoring.cpp b/Source/RWTHVRToolkit/Private/Interaction/Interactables/IntenSelect/IntenSelectableCircleScoring.cpp index 9e4a0b22..9f17dc81 100644 --- a/Source/RWTHVRToolkit/Private/Interaction/Interactables/IntenSelect/IntenSelectableCircleScoring.cpp +++ b/Source/RWTHVRToolkit/Private/Interaction/Interactables/IntenSelect/IntenSelectableCircleScoring.cpp @@ -7,8 +7,8 @@ UIntenSelectableCircleScoring::UIntenSelectableCircleScoring() { PrimaryComponen TPair<FHitResult, float> UIntenSelectableCircleScoring::GetBestPointScorePair(const FVector& ConeOrigin, const FVector& ConeForwardDirection, - const float ConeBackwardShiftDistance, const float ConeAngle, - const float LastValue, const float DeltaTime) + const float ConeBackwardShiftDistance, const float ConeAngle, + const float LastValue, const float DeltaTime) { const FVector Point = GetClosestSelectionPointTo(ConeOrigin, ConeForwardDirection); float Score = @@ -27,8 +27,8 @@ FVector UIntenSelectableCircleScoring::GetClosestSelectionPointTo(const FVector& FVector IntersectionPoint; constexpr float MaxDistance = 100000; if (!UKismetMathLibrary::LinePlaneIntersection_OriginNormal(Point, Point + Direction * MaxDistance, CenterWorld, - CircleNormalWorld, IntersectionRatio, - IntersectionPoint)) + CircleNormalWorld, IntersectionRatio, + IntersectionPoint)) { return CenterWorld; } diff --git a/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp b/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp index c8cf9ce3..5de410ff 100644 --- a/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp @@ -112,8 +112,7 @@ void UDirectInteractionComponent::OnBeginInteraction(const FInputActionValue& Va if (bOnlyInteractWithClosestActor) { auto MinElement = *Algo::MinElementBy( - CurrentInteractableComponentsInRange, - [&](auto Element) + CurrentInteractableComponentsInRange, [&](auto Element) { return FVector(Element->GetOwner()->GetActorLocation() - InteractionLocation).Size(); }); MinElement->HandleOnActionStartEvents(this, InteractionInputAction, Value, EInteractorType::Direct); CurrentlyInteractedComponents = {MinElement}; diff --git a/Source/RWTHVRToolkit/Private/Pawn/IntenSelectComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/IntenSelectComponent.cpp index 83ca45a1..d89669e4 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/IntenSelectComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/IntenSelectComponent.cpp @@ -63,7 +63,7 @@ void UIntenSelectComponent::InitInputBindings() const FString Message = "Could not get PlayerInputComponent for IntenSelect Input Assignment!"; UE_LOG(LogTemp, Error, TEXT("%s"), *Message); - //Deactivate + // Deactivate Super::SetActive(false, true); return; diff --git a/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp b/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp index 1de02ebf..7c91f2f1 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp @@ -80,7 +80,8 @@ void ARWTHVRPawn::NotifyControllerChanged() Super::NotifyControllerChanged(); - UE_LOG(Toolkit, Display, TEXT("ARWTHVRPawn: Player Controller has changed, trying to change DCRA attachment if possible...")); + UE_LOG(Toolkit, Display, + TEXT("ARWTHVRPawn: Player Controller has changed, trying to change DCRA attachment if possible...")); // Only do this for all local controlled pawns diff --git a/Source/RWTHVRToolkit/Private/Pawn/ReplicatedCameraComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/ReplicatedCameraComponent.cpp index 970b6503..43d052d0 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/ReplicatedCameraComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/ReplicatedCameraComponent.cpp @@ -47,7 +47,7 @@ void UReplicatedCameraComponent::UpdateState(float DeltaTime) } void UReplicatedCameraComponent::TickComponent(float DeltaTime, ELevelTick TickType, - FActorComponentTickFunction* ThisTickFunction) + FActorComponentTickFunction* ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); UpdateState(DeltaTime); diff --git a/Source/RWTHVRToolkit/RWTHVRToolkit.Build.cs b/Source/RWTHVRToolkit/RWTHVRToolkit.Build.cs index a949553a..a425ce8a 100644 --- a/Source/RWTHVRToolkit/RWTHVRToolkit.Build.cs +++ b/Source/RWTHVRToolkit/RWTHVRToolkit.Build.cs @@ -5,33 +5,33 @@ public class RWTHVRToolkit : ModuleRules public RWTHVRToolkit(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - + PublicIncludePaths.AddRange( - new string[]{} + new string[] { } ); PrivateIncludePaths.AddRange( - new string[]{} + new string[] { } ); PublicDependencyModuleNames.AddRange( new string[] { - "Core", - "CoreUObject", - "Engine", - "HeadMountedDisplay", - "InputCore", - "UMG", - "Slate", - "SlateCore", - "DeveloperSettings", - "HTTP", - "LiveLink", - "LiveLinkInterface", - "EnhancedInput", - "Niagara", - "NavigationSystem" + "Core", + "CoreUObject", + "Engine", + "HeadMountedDisplay", + "InputCore", + "UMG", + "Slate", + "SlateCore", + "DeveloperSettings", + "HTTP", + "LiveLink", + "LiveLinkInterface", + "EnhancedInput", + "Niagara", + "NavigationSystem" } ); @@ -47,7 +47,7 @@ public class RWTHVRToolkit : ModuleRules } DynamicallyLoadedModuleNames.AddRange( - new string[]{} + new string[] { } ); if (IsPluginEnabledForTarget("RWTHVRCluster", base.Target)) @@ -57,15 +57,15 @@ public class RWTHVRToolkit : ModuleRules PublicDefinitions.Add("PLATFORM_SUPPORTS_CLUSTER=1"); } else - { + { PublicDefinitions.Add("PLATFORM_SUPPORTS_CLUSTER=0"); } } - + private static bool IsPluginEnabledForTarget(string PluginName, ReadOnlyTargetRules Target) { var PL = Plugins.GetPlugin(PluginName); return PL != null && Target.ProjectFile != null && Plugins.IsPluginEnabledForTarget(PL, ProjectDescriptor.FromFile(Target.ProjectFile), Target.Platform, Target.Configuration, Target.Type); } -} +} \ No newline at end of file diff --git a/Source/RWTHVRToolkitEditor/Private/Interaction/IntenSelectableCircleScoringVisualizer.cpp b/Source/RWTHVRToolkitEditor/Private/Interaction/IntenSelectableCircleScoringVisualizer.cpp index e2531b10..a5d0ba77 100644 --- a/Source/RWTHVRToolkitEditor/Private/Interaction/IntenSelectableCircleScoringVisualizer.cpp +++ b/Source/RWTHVRToolkitEditor/Private/Interaction/IntenSelectableCircleScoringVisualizer.cpp @@ -10,12 +10,10 @@ IMPLEMENT_HIT_PROXY(FCircleProxy, HComponentVisProxy); FIntenSelectableCircleScoringVisualizer::FIntenSelectableCircleScoringVisualizer() { PointsProperty = FindFProperty<FProperty>(UIntenSelectableCircleScoring::StaticClass(), - GET_MEMBER_NAME_CHECKED(UIntenSelectableCircleScoring, Radius)); + GET_MEMBER_NAME_CHECKED(UIntenSelectableCircleScoring, Radius)); } -FIntenSelectableCircleScoringVisualizer::~FIntenSelectableCircleScoringVisualizer() -{ -} +FIntenSelectableCircleScoringVisualizer::~FIntenSelectableCircleScoringVisualizer() {} FVector FIntenSelectableCircleScoringVisualizer::GetCurrentVectorWorld() const { @@ -24,16 +22,16 @@ FVector FIntenSelectableCircleScoringVisualizer::GetCurrentVectorWorld() const case 0: return GetEditedScoringComponent()->GetComponentLocation(); case 1: - { - const FVector CenterWorld = GetEditedScoringComponent()->GetComponentLocation(); - const FVector NormalWorldPoint = - GetEditedScoringComponent()->GetComponentTransform().TransformPosition(FVector::ForwardVector); - const FVector WorldNormalDir = NormalWorldPoint - CenterWorld; - const FVector Y = - WorldNormalDir.RotateAngleAxis(90, GetEditedScoringComponent()->GetRightVector()).GetSafeNormal() * - GetEditedScoringComponent()->Radius; - return CenterWorld + Y; - } + { + const FVector CenterWorld = GetEditedScoringComponent()->GetComponentLocation(); + const FVector NormalWorldPoint = + GetEditedScoringComponent()->GetComponentTransform().TransformPosition(FVector::ForwardVector); + const FVector WorldNormalDir = NormalWorldPoint - CenterWorld; + const FVector Y = + WorldNormalDir.RotateAngleAxis(90, GetEditedScoringComponent()->GetRightVector()).GetSafeNormal() * + GetEditedScoringComponent()->Radius; + return CenterWorld + Y; + } default: return FVector::ZeroVector; } @@ -58,8 +56,8 @@ bool FIntenSelectableCircleScoringVisualizer::ShouldShowForSelectedSubcomponents } bool FIntenSelectableCircleScoringVisualizer::VisProxyHandleClick(FEditorViewportClient* InViewportClient, - HComponentVisProxy* VisProxy, - const FViewportClick& Click) + HComponentVisProxy* VisProxy, + const FViewportClick& Click) { bool bEditing = false; @@ -90,7 +88,7 @@ bool FIntenSelectableCircleScoringVisualizer::VisProxyHandleClick(FEditorViewpor } void FIntenSelectableCircleScoringVisualizer::DrawVisualization(const UActorComponent* Component, - const FSceneView* View, FPrimitiveDrawInterface* PDI) + const FSceneView* View, FPrimitiveDrawInterface* PDI) { const UIntenSelectableCircleScoring* ComponentCasted = Cast<UIntenSelectableCircleScoring>(Component); @@ -109,15 +107,13 @@ void FIntenSelectableCircleScoringVisualizer::DrawVisualization(const UActorComp const FVector Y = WorldNormalDir.RotateAngleAxis(90, ComponentCasted->GetRightVector()); const FVector Z = FVector::CrossProduct(Y.GetSafeNormal(), WorldNormalDir); DrawCircle(PDI, CenterWorld, Y.GetSafeNormal(), Z.GetSafeNormal(), FColor::Green, ComponentCasted->Radius, 100, - SDPG_Foreground, 2); + SDPG_Foreground, 2); PDI->SetHitProxy(nullptr); } } -void FIntenSelectableCircleScoringVisualizer::EndEditing() -{ -} +void FIntenSelectableCircleScoringVisualizer::EndEditing() {} UActorComponent* FIntenSelectableCircleScoringVisualizer::GetEditedComponent() const { @@ -125,8 +121,8 @@ UActorComponent* FIntenSelectableCircleScoringVisualizer::GetEditedComponent() c } bool FIntenSelectableCircleScoringVisualizer::HandleInputDelta(FEditorViewportClient* ViewportClient, - FViewport* Viewport, FVector& DeltaTranslate, - FRotator& DeltaRotate, FVector& DeltaScale) + FViewport* Viewport, FVector& DeltaTranslate, + FRotator& DeltaRotate, FVector& DeltaScale) { bool bHandled = false; @@ -167,7 +163,7 @@ bool FIntenSelectableCircleScoringVisualizer::HandleInputDelta(FEditorViewportCl } bool FIntenSelectableCircleScoringVisualizer::GetWidgetLocation(const FEditorViewportClient* ViewportClient, - FVector& OutLocation) const + FVector& OutLocation) const { if (CurrentSelectionIndex != INDEX_NONE) { diff --git a/Source/RWTHVRToolkitEditor/RWTHVRToolkitEditor.Build.cs b/Source/RWTHVRToolkitEditor/RWTHVRToolkitEditor.Build.cs index a1e2b6c3..b94cb6db 100644 --- a/Source/RWTHVRToolkitEditor/RWTHVRToolkitEditor.Build.cs +++ b/Source/RWTHVRToolkitEditor/RWTHVRToolkitEditor.Build.cs @@ -2,15 +2,15 @@ using UnrealBuildTool; public class RWTHVRToolkitEditor : ModuleRules { - public RWTHVRToolkitEditor(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicDependencyModuleNames.AddRange( - new string[] - { - "Core", - "CoreUObject", + public RWTHVRToolkitEditor(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "CoreUObject", "Engine", "UnrealEd", "ComponentVisualizers", @@ -19,33 +19,29 @@ public class RWTHVRToolkitEditor : ModuleRules "RWTHVRToolkit" - // ... add public dependencies that you statically link with here ... - } - ); - - PrivateDependencyModuleNames.AddRange( - new string[] - { - + // ... add public dependencies that you statically link with here ... + } + ); - // ... add private dependencies that you statically link with here ... - } - ); + PrivateDependencyModuleNames.AddRange( + new string[] + { + // ... add private dependencies that you statically link with here ... + } + ); - PublicIncludePaths.AddRange( - new string[] - { - - // ... add private dependencies that you statically link with here ... - } - ); + PublicIncludePaths.AddRange( + new string[] + { + // ... add private dependencies that you statically link with here ... + } + ); - PrivateIncludePaths.AddRange( - new string[] - { - - // ... add private dependencies that you statically link with here ... - } - ); - } + PrivateIncludePaths.AddRange( + new string[] + { + // ... add private dependencies that you statically link with here ... + } + ); + } } \ No newline at end of file -- GitLab