Skip to content
Snippets Groups Projects
Commit 71767c39 authored by Timon Römer's avatar Timon Römer
Browse files

Updates source code

parent f5ca8a12
No related tags found
No related merge requests found
...@@ -38,12 +38,12 @@ UPrimitiveComponent* UGrabbingBehaviorComponent::GetHighestParentSimulatingPhysi ...@@ -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")); USceneComponent* RightHand = Cast<USceneComponent>(GrabbedBy->GetDefaultSubobjectByName("Right Hand"));
...@@ -55,7 +55,7 @@ void UGrabbingBehaviorComponent::HandleBeginGrab(AActor* GrabbedBy) ...@@ -55,7 +55,7 @@ void UGrabbingBehaviorComponent::HandleBeginGrab(AActor* GrabbedBy)
OnBeginGrab.Broadcast(GrabbedBy); OnBeginGrab.Broadcast(GrabbedBy);
} }
void UGrabbingBehaviorComponent::HandleEndGrab() void UGrabbingBehaviorComponent::HandleGrabEnd()
{ {
//GetOwner()->GetRootComponent()->DetachFromComponent(FDetachmentTransformRules::KeepWorldTransform); //GetOwner()->GetRootComponent()->DetachFromComponent(FDetachmentTransformRules::KeepWorldTransform);
GetOwner()->GetRootComponent()->DetachFromComponent(FDetachmentTransformRules::KeepWorldTransform); GetOwner()->GetRootComponent()->DetachFromComponent(FDetachmentTransformRules::KeepWorldTransform);
......
...@@ -35,7 +35,7 @@ void UGrabbingBehaviorOnLineComponent::SetDiscreteNumberOfPoints(int Num) ...@@ -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 AttachmentPoint = this->GetRelativeLocation();
FVector ConstraintAxis = this->GetComponentQuat().GetUpVector(); FVector ConstraintAxis = this->GetComponentQuat().GetUpVector();
......
...@@ -24,7 +24,7 @@ float UGrabbingBehaviorOnPlaneComponent::GetDistance() const ...@@ -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 AttachmentPoint = this->GetRelativeLocation();
FVector PlaneNormal = this->GetComponentQuat().GetUpVector(); FVector PlaneNormal = this->GetComponentQuat().GetUpVector();
......
...@@ -128,7 +128,7 @@ void UBasicVRInteractionComponent::TickComponent(float DeltaTime, ELevelTick Tic ...@@ -128,7 +128,7 @@ void UBasicVRInteractionComponent::TickComponent(float DeltaTime, ELevelTick Tic
const FVector HandPos = InteractionRayEmitter->GetComponentLocation(); const FVector HandPos = InteractionRayEmitter->GetComponentLocation();
const FQuat HandQuat = InteractionRayEmitter->GetComponentQuat(); 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 // only raytrace for targetable objects if bool user wants to enable this feature
......
...@@ -29,11 +29,11 @@ public: ...@@ -29,11 +29,11 @@ public:
public: public:
// takes the hand ray and moves the parent actor to a new possible position, also might change rotation // 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 // Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
......
...@@ -21,7 +21,7 @@ public: ...@@ -21,7 +21,7 @@ public:
UFUNCTION(BlueprintCallable) float GetDistance() const; UFUNCTION(BlueprintCallable) float GetDistance() const;
UFUNCTION(BlueprintCallable) void SetDiscreteNumberOfPoints(int Num); UFUNCTION(BlueprintCallable) void SetDiscreteNumberOfPoints(int Num);
virtual void HandleNewPositionAndDirection(FVector position, FQuat orientation) override; virtual void HandleGrabHold(FVector position, FQuat orientation) override;
protected: protected:
// Called when the game starts // Called when the game starts
......
...@@ -20,7 +20,7 @@ public: ...@@ -20,7 +20,7 @@ public:
UFUNCTION(BlueprintCallable) void SetDistance(float Dist); UFUNCTION(BlueprintCallable) void SetDistance(float Dist);
UFUNCTION(BlueprintCallable) float GetDistance() const; UFUNCTION(BlueprintCallable) float GetDistance() const;
virtual void HandleNewPositionAndDirection(FVector position, FQuat orientation) override; virtual void HandleGrabHold(FVector position, FQuat orientation) override;
protected: protected:
// Called when the game starts // Called when the game starts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment