diff --git a/Content/Blueprints/OptiXVRPawnStandaloneBP.uasset b/Content/Blueprints/OptiXVRPawnStandaloneBP.uasset index d37d2415028b05b115ea4d76f6804914868a3096..976c08a4b696753b8e65698c8b9d9c4376a41f3c 100644 Binary files a/Content/Blueprints/OptiXVRPawnStandaloneBP.uasset and b/Content/Blueprints/OptiXVRPawnStandaloneBP.uasset differ diff --git a/Content/UI/HandSlider.uasset b/Content/UI/HandSlider.uasset index c7ba2b93e5d2a1200090d0737c81ba4706489878..62f123a005a98d7acead0bea754856062955c2b1 100644 Binary files a/Content/UI/HandSlider.uasset and b/Content/UI/HandSlider.uasset differ diff --git a/Content/UI/SupportSwapWidget2.uasset b/Content/UI/SupportSwapWidget2.uasset index 208fb5a1146c4682f3a0738a29a497170e8e3996..92868e77f3fc8567e5fdb46418ee34da544c83c5 100644 Binary files a/Content/UI/SupportSwapWidget2.uasset and b/Content/UI/SupportSwapWidget2.uasset differ diff --git a/Source/OptiX/Private/SelectableActorBase.cpp b/Source/OptiX/Private/SelectableActorBase.cpp index 00d91345ab26139ca0efb225123fb6284623529a..1ad61d9c6c8bf22860c71594ca7947e759f3ac5f 100644 --- a/Source/OptiX/Private/SelectableActorBase.cpp +++ b/Source/OptiX/Private/SelectableActorBase.cpp @@ -7,6 +7,8 @@ #include "Blueprint/UserWidget.h" #include "Runtime/Engine/Classes/Materials/MaterialInstanceDynamic.h" +#include "OptiXVRPawn.h" + ASelectableActorBase::ASelectableActorBase(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { @@ -37,7 +39,7 @@ ASelectableActorBase::ASelectableActorBase(const FObjectInitializer& ObjectIniti SupportWidget->SetDrawSize(FVector2D(800, 2300)); SupportWidget->SetGenerateOverlapEvents(false); SupportWidget->SetHiddenInGame(true); - //SupportWidget->SetTwoSided(true); + SupportWidget->SetTwoSided(true); UE_LOG(LogTemp, Display, TEXT("OptiX ASelectableActorBase Constructor 1/4")); @@ -412,6 +414,13 @@ void ASelectableActorBase::EnableTranslation() ArrowX->SetGenerateOverlapEvents(true); ArrowY->SetGenerateOverlapEvents(true); ArrowZ->SetGenerateOverlapEvents(true); + + AOptiXVRPawn* OptiXVRPawn = Cast<AOptiXVRPawn>(UGameplayStatics::GetPlayerPawn(GetWorld(), 0)); + if (OptiXVRPawn) + { + OptiXVRPawn->UIEventTranslation(); + } + } void ASelectableActorBase::EnableRotation() @@ -424,8 +433,35 @@ void ASelectableActorBase::EnableRotation() ArrowX->SetGenerateOverlapEvents(false); ArrowY->SetGenerateOverlapEvents(false); ArrowZ->SetGenerateOverlapEvents(false); + + AOptiXVRPawn* OptiXVRPawn = Cast<AOptiXVRPawn>(UGameplayStatics::GetPlayerPawn(GetWorld(), 0)); + if (OptiXVRPawn) + { + OptiXVRPawn->UIEventRotation(); + } } +void ASelectableActorBase::DeselectActor() +{ + AOptiXVRPawn* OptiXVRPawn = Cast<AOptiXVRPawn>(UGameplayStatics::GetPlayerPawn(GetWorld(), 0)); + if (OptiXVRPawn) + { + OptiXVRPawn->UIEventDeselect(); + } + Deselect(); +} + +void ASelectableActorBase::DeleteActor() +{ + AOptiXVRPawn* OptiXVRPawn = Cast<AOptiXVRPawn>(UGameplayStatics::GetPlayerPawn(GetWorld(), 0)); + if (OptiXVRPawn) + { + OptiXVRPawn->UIEventDelete(); + } + Destroy(); +} + + void ASelectableActorBase::SetRodPosition(FVector TablePosition) { FVector TableZero = TablePosition + FVector(0, 0, 98); // Table Height diff --git a/Source/OptiX/Public/OptiXVRPawn.h b/Source/OptiX/Public/OptiXVRPawn.h index de5d28eaf69eec250a1da0314aa0ba01a55a93a6..0278cb9f6e14e19e6c22715be87b36ded1d9c85a 100644 --- a/Source/OptiX/Public/OptiXVRPawn.h +++ b/Source/OptiX/Public/OptiXVRPawn.h @@ -40,6 +40,17 @@ public: UFUNCTION(BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor") AActor* GetActorNearHand(UPrimitiveComponent* Hand); + UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor") + void UIEventTranslation(); + + UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor") + void UIEventRotation(); + + UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor") + void UIEventDeselect(); + + UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor") + void UIEventDelete(); public: diff --git a/Source/OptiX/Public/SelectableActorBase.h b/Source/OptiX/Public/SelectableActorBase.h index 3d7185d75b6df53dc0b935204df75486cf022f2f..90bb3f830b2011b758baa6ab4015651402676361 100644 --- a/Source/OptiX/Public/SelectableActorBase.h +++ b/Source/OptiX/Public/SelectableActorBase.h @@ -39,6 +39,12 @@ public: UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor") void Deselect(); + UFUNCTION(BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor") + void DeselectActor(); + + UFUNCTION(BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor") + void DeleteActor(); + UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor") void RequestRemoval();