From 3baf0639dfd854c6996dd7630c2660b275050fb2 Mon Sep 17 00:00:00 2001 From: David Gilbert <gilbert@vr.rwth-aachen.de> Date: Tue, 23 Jul 2024 15:25:45 +0200 Subject: [PATCH] style(interaction): Make clang format happy. --- .../Interaction/Interactables/GrabBehavior.cpp | 8 ++++---- .../Pawn/Navigation/CollisionHandlingMovement.cpp | 3 ++- .../Interaction/Interactables/GrabBehavior.h | 14 +++++++------- .../Interactors/UBaseInteractionComponent.h | 12 +++++++----- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Source/RWTHVRToolkit/Private/Interaction/Interactables/GrabBehavior.cpp b/Source/RWTHVRToolkit/Private/Interaction/Interactables/GrabBehavior.cpp index da279028..502a4be5 100644 --- a/Source/RWTHVRToolkit/Private/Interaction/Interactables/GrabBehavior.cpp +++ b/Source/RWTHVRToolkit/Private/Interaction/Interactables/GrabBehavior.cpp @@ -57,12 +57,13 @@ void UGrabBehavior::ReplicationOriginaterClientCallback(USceneComponent* Trigger HandleCollisionHandlingMovement(CurrentAttachParent, EventType); } -void UGrabBehavior::HandleCollisionHandlingMovement(const USceneComponent* CurrentAttachParent, const EInteractionEventType EventType) +void UGrabBehavior::HandleCollisionHandlingMovement(const USceneComponent* CurrentAttachParent, + const EInteractionEventType EventType) { auto CHM = CurrentAttachParent->GetOwner()->GetComponentByClass<UCollisionHandlingMovement>(); - if(!CHM) + if (!CHM) return; - + if (EventType == EInteractionEventType::InteractionStart) { // Add to ignore list for collision handling movement, if it exists @@ -79,7 +80,6 @@ void UGrabBehavior::HandleCollisionHandlingMovement(const USceneComponent* Curre CHM->RemoveActorFromIgnore(GetOwner()); } } - } void UGrabBehavior::OnActionEvent(USceneComponent* TriggerComponent, const EInteractionEventType EventType, const FInputActionValue& Value) diff --git a/Source/RWTHVRToolkit/Private/Pawn/Navigation/CollisionHandlingMovement.cpp b/Source/RWTHVRToolkit/Private/Pawn/Navigation/CollisionHandlingMovement.cpp index 454d6501..de761095 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/Navigation/CollisionHandlingMovement.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/Navigation/CollisionHandlingMovement.cpp @@ -88,7 +88,8 @@ void UCollisionHandlingMovement::TickComponent(float DeltaTime, enum ELevelTick // and gravity for walking only MoveByGravityOrStepUp(DeltaTime); - // if we physically (in the tracking space) walked into something, move the world away (by moving the pawn) + // if we physically (in the tracking space) walked into something, move the world away (by moving the + // pawn) CheckForPhysWalkingCollision(); } } diff --git a/Source/RWTHVRToolkit/Public/Interaction/Interactables/GrabBehavior.h b/Source/RWTHVRToolkit/Public/Interaction/Interactables/GrabBehavior.h index ba787527..65118646 100644 --- a/Source/RWTHVRToolkit/Public/Interaction/Interactables/GrabBehavior.h +++ b/Source/RWTHVRToolkit/Public/Interaction/Interactables/GrabBehavior.h @@ -20,15 +20,14 @@ class RWTHVRTOOLKIT_API UGrabBehavior : public UActionBehaviour GENERATED_BODY() public: - UGrabBehavior(); - + UPROPERTY(EditAnywhere, Category = "Grabbing") bool bBlockOtherInteractionsWhileGrabbed = true; UPROPERTY(EditAnywhere, Category = "Grabbing") bool bIgnoreGrabbedActorInCollisionMovement = true; - + /** * Called after the object was successfully attached to the hand */ @@ -40,7 +39,7 @@ public: */ UPROPERTY(BlueprintAssignable) FOnGrabEnd OnGrabEndEvent; - + UPROPERTY() UPrimitiveComponent* MyPhysicsComponent; @@ -54,12 +53,13 @@ public: UFUNCTION() void ReplicationOriginaterClientCallback(USceneComponent* TriggerComponent, const EInteractionEventType EventType, const FInputActionValue& Value); - - void HandleCollisionHandlingMovement(const USceneComponent* CurrentAttachParent, const EInteractionEventType EventType); + + void HandleCollisionHandlingMovement(const USceneComponent* CurrentAttachParent, + const EInteractionEventType EventType); virtual void OnActionEvent(USceneComponent* TriggerComponent, const EInteractionEventType EventType, const FInputActionValue& Value) override; - + UFUNCTION(BlueprintPure) bool IsObjectGrabbed() const { return bObjectGrabbed; } diff --git a/Source/RWTHVRToolkit/Public/Interaction/Interactors/UBaseInteractionComponent.h b/Source/RWTHVRToolkit/Public/Interaction/Interactors/UBaseInteractionComponent.h index ef7f9711..ca97fd7e 100644 --- a/Source/RWTHVRToolkit/Public/Interaction/Interactors/UBaseInteractionComponent.h +++ b/Source/RWTHVRToolkit/Public/Interaction/Interactors/UBaseInteractionComponent.h @@ -54,14 +54,16 @@ public: /** * This is only executed on the local client which processed the interaction and requested the replication process - * to be started. Can be used e.g. for local effects or things that should be done both on the server and local client. + * to be started. Can be used e.g. for local effects or things that should be done both on the server and local + * client. */ void HoverBehaviourReplicationOriginatorCallback(UHoverBehaviour* Behaviour, const EInteractionEventType EventType, - const FHitResult& Hit); + const FHitResult& Hit); /** - * Requests the start of the replication process for the given ActionBehaviour, EventType and the Value of the Input Action. - * Depending on authority, this executes the replication of the behaviour directly or requests it via a server RPC. + * Requests the start of the replication process for the given ActionBehaviour, EventType and the Value of the Input + * Action. Depending on authority, this executes the replication of the behaviour directly or requests it via a + * server RPC. */ void RequestActionBehaviourReplicationStart(UActionBehaviour* Behaviour, const EInteractionEventType EventType, const FInputActionValue& Value); @@ -72,7 +74,7 @@ public: */ void ActionBehaviourReplicationStart(UActionBehaviour* Behaviour, const EInteractionEventType EventType, const FInputActionValue& Value); - + // RPCs UFUNCTION(Server, Reliable) -- GitLab