diff --git a/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorComponent.cpp b/Source/RWTHVRToolkit/Private/Interaction/GrabbingBehaviorComponent.cpp index 0d325cb2f89a146e5d764ac0fbb18932881b04b4..25683cfdb5234921401dd9bd3eedeca52ae45396 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 e84d2138562958034cb9a4918c9af008abe161bd..43827e344112fcde444837d97bdbde86061c514a 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 1c581c6a120510280e0c833555e6f85142953642..10a5e554d88d5decaa84efe469f44873ba22f235 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 eaf5a577b1b779fc40e23858a9e8d0fc28581e49..e51a2f086f9b55d65b57a62f71680b105dbb896b 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 f73c04d465484f6f8576339c99b32c3de296b656..b13884ee755f1d898974305051294ce11f1a06e8 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 0e470126884bd3c69107499fb328d94579771f8d..9488b25f6015069c2a5a0035c2be4452e8adb16c 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 80a52f34e7eb5ede13c2ab721589c58a701402a8..6f74eb4fda19727b40b8217aef6aa88c6e75072d 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