From 71767c39226a11231a444d674bf196a533453aaa Mon Sep 17 00:00:00 2001 From: Timon Roemer <t.roemer@vis.rwth-aachen.de> Date: Tue, 10 Oct 2023 10:24:32 +0200 Subject: [PATCH] Updates source code --- .../Private/Interaction/GrabbingBehaviorComponent.cpp | 6 +++--- .../Private/Interaction/GrabbingBehaviorOnLineComponent.cpp | 2 +- .../Interaction/GrabbingBehaviorOnPlaneComponent.cpp | 2 +- .../Private/Pawn/BasicVRInteractionComponent.cpp | 4 ++-- .../Public/Interaction/GrabbingBehaviorComponent.h | 6 +++--- .../Public/Interaction/GrabbingBehaviorOnLineComponent.h | 2 +- .../Public/Interaction/GrabbingBehaviorOnPlaneComponent.h | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorComponent.cpp b/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorComponent.cpp index 0d325cb2..25683cfd 100644 --- a/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorComponent.cpp @@ -38,12 +38,12 @@ UPrimitiveComponent* UGrabbingBehaviorComponent::GetHighestParentSimulatingPhysi } } -void UGrabbingBehaviorComponent::HandleNewPositionAndDirection(FVector Position, FQuat Orientation) +void UGrabbingBehaviorComponent::HandleGrabHold(FVector Position, FQuat Orientation) { } -void UGrabbingBehaviorComponent::HandleBeginGrab(AActor* GrabbedBy) +void UGrabbingBehaviorComponent::HandleGrabStart(AActor* GrabbedBy) { USceneComponent* RightHand = Cast<USceneComponent>(GrabbedBy->GetDefaultSubobjectByName("Right Hand")); @@ -55,7 +55,7 @@ void UGrabbingBehaviorComponent::HandleBeginGrab(AActor* GrabbedBy) OnBeginGrab.Broadcast(GrabbedBy); } -void UGrabbingBehaviorComponent::HandleEndGrab() +void UGrabbingBehaviorComponent::HandleGrabEnd() { //GetOwner()->GetRootComponent()->DetachFromComponent(FDetachmentTransformRules::KeepWorldTransform); GetOwner()->GetRootComponent()->DetachFromComponent(FDetachmentTransformRules::KeepWorldTransform); diff --git a/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorOnLineComponent.cpp b/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorOnLineComponent.cpp index e84d2138..43827e34 100644 --- a/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorOnLineComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorOnLineComponent.cpp @@ -35,7 +35,7 @@ void UGrabbingBehaviorOnLineComponent::SetDiscreteNumberOfPoints(int Num) } -void UGrabbingBehaviorOnLineComponent::HandleNewPositionAndDirection(FVector Position, FQuat Orientation) +void UGrabbingBehaviorOnLineComponent::HandleGrabHold(FVector Position, FQuat Orientation) { FVector AttachmentPoint = this->GetRelativeLocation(); FVector ConstraintAxis = this->GetComponentQuat().GetUpVector(); diff --git a/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorOnPlaneComponent.cpp b/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorOnPlaneComponent.cpp index 1c581c6a..10a5e554 100644 --- a/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorOnPlaneComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorOnPlaneComponent.cpp @@ -24,7 +24,7 @@ float UGrabbingBehaviorOnPlaneComponent::GetDistance() const } -void UGrabbingBehaviorOnPlaneComponent::HandleNewPositionAndDirection(FVector Position, FQuat Orientation) +void UGrabbingBehaviorOnPlaneComponent::HandleGrabHold(FVector Position, FQuat Orientation) { FVector AttachmentPoint = this->GetRelativeLocation(); FVector PlaneNormal = this->GetComponentQuat().GetUpVector(); diff --git a/Source/RWTHVRToolkit/Private/Pawn/BasicVRInteractionComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/BasicVRInteractionComponent.cpp index eaf5a577..e51a2f08 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/BasicVRInteractionComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/BasicVRInteractionComponent.cpp @@ -56,7 +56,7 @@ void UBasicVRInteractionComponent::BeginInteraction() return; AActor* HitActor = Hit->GetActor(); - + //trigger interaction of WidgetInteractionComponent SetCustomHitResult(Hit.GetValue()); //if !bCanRaytraceEveryTick, you have to click twice, since the first tick it only highlights and can't directly click @@ -128,7 +128,7 @@ void UBasicVRInteractionComponent::TickComponent(float DeltaTime, ELevelTick Tic const FVector HandPos = InteractionRayEmitter->GetComponentLocation(); const FQuat HandQuat = InteractionRayEmitter->GetComponentQuat(); - Behavior->HandleNewPositionAndDirection(HandPos, HandQuat); + Behavior->HandleGrabHold(HandPos, HandQuat); } // only raytrace for targetable objects if bool user wants to enable this feature diff --git a/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorComponent.h b/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorComponent.h index f73c04d4..b13884ee 100644 --- a/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorComponent.h +++ b/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorComponent.h @@ -29,11 +29,11 @@ public: public: // takes the hand ray and moves the parent actor to a new possible position, also might change rotation - virtual void HandleNewPositionAndDirection(FVector Position, FQuat Orientation); + virtual void HandleGrabHold(FVector Position, FQuat Orientation); - virtual void HandleBeginGrab(AActor* GrabbedBy); + virtual void HandleGrabStart(AActor* GrabbedBy); - virtual void HandleEndGrab(); + virtual void HandleGrabEnd(); // Called every frame virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; diff --git a/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorOnLineComponent.h b/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorOnLineComponent.h index 0e470126..9488b25f 100644 --- a/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorOnLineComponent.h +++ b/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorOnLineComponent.h @@ -21,7 +21,7 @@ public: UFUNCTION(BlueprintCallable) float GetDistance() const; UFUNCTION(BlueprintCallable) void SetDiscreteNumberOfPoints(int Num); - virtual void HandleNewPositionAndDirection(FVector position, FQuat orientation) override; + virtual void HandleGrabHold(FVector position, FQuat orientation) override; protected: // Called when the game starts diff --git a/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorOnPlaneComponent.h b/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorOnPlaneComponent.h index 80a52f34..6f74eb4f 100644 --- a/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorOnPlaneComponent.h +++ b/Source/RWTHVRToolkit/Public/Interaction/GrabbingBehaviorOnPlaneComponent.h @@ -20,7 +20,7 @@ public: UFUNCTION(BlueprintCallable) void SetDistance(float Dist); UFUNCTION(BlueprintCallable) float GetDistance() const; - virtual void HandleNewPositionAndDirection(FVector position, FQuat orientation) override; + virtual void HandleGrabHold(FVector position, FQuat orientation) override; protected: // Called when the game starts -- GitLab