diff --git a/Source/RWTHVRToolkit/Private/Interaction/Interactables/GrabBehavior.cpp b/Source/RWTHVRToolkit/Private/Interaction/Interactables/GrabBehavior.cpp index da27902821fc1a16eeaabfa5b959d82eff6d3a9d..502a4be532df57e6f3214e859db8eb4729b15482 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 454d65015669bf9d1e6b1b480f2199862579cc44..de761095cc544cdbcb4f084120b1e3e0961fe0f9 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 ba787527e2c9976069613d1e38e377c1a8791ccc..65118646b4ca6edae19772cb3d5bf1df875534ee 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 ef7f971164e1cc6301afadc5b3d3e9f61fe2403a..ca97fd7e36f1359273734f7b88da77777fdfa7b0 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)