Skip to content
Snippets Groups Projects
Commit e5cd1006 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

Finally got it working, be wary of weird circular dependencies

parent 57cbb901
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include "Blueprint/UserWidget.h" #include "Blueprint/UserWidget.h"
#include "Runtime/Engine/Classes/Materials/MaterialInstanceDynamic.h" #include "Runtime/Engine/Classes/Materials/MaterialInstanceDynamic.h"
#include "OptiXVRPawn.h"
ASelectableActorBase::ASelectableActorBase(const FObjectInitializer& ObjectInitializer) ASelectableActorBase::ASelectableActorBase(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer) : Super(ObjectInitializer)
{ {
...@@ -37,7 +39,7 @@ ASelectableActorBase::ASelectableActorBase(const FObjectInitializer& ObjectIniti ...@@ -37,7 +39,7 @@ ASelectableActorBase::ASelectableActorBase(const FObjectInitializer& ObjectIniti
SupportWidget->SetDrawSize(FVector2D(800, 2300)); SupportWidget->SetDrawSize(FVector2D(800, 2300));
SupportWidget->SetGenerateOverlapEvents(false); SupportWidget->SetGenerateOverlapEvents(false);
SupportWidget->SetHiddenInGame(true); SupportWidget->SetHiddenInGame(true);
//SupportWidget->SetTwoSided(true); SupportWidget->SetTwoSided(true);
UE_LOG(LogTemp, Display, TEXT("OptiX ASelectableActorBase Constructor 1/4")); UE_LOG(LogTemp, Display, TEXT("OptiX ASelectableActorBase Constructor 1/4"));
...@@ -412,6 +414,13 @@ void ASelectableActorBase::EnableTranslation() ...@@ -412,6 +414,13 @@ void ASelectableActorBase::EnableTranslation()
ArrowX->SetGenerateOverlapEvents(true); ArrowX->SetGenerateOverlapEvents(true);
ArrowY->SetGenerateOverlapEvents(true); ArrowY->SetGenerateOverlapEvents(true);
ArrowZ->SetGenerateOverlapEvents(true); ArrowZ->SetGenerateOverlapEvents(true);
AOptiXVRPawn* OptiXVRPawn = Cast<AOptiXVRPawn>(UGameplayStatics::GetPlayerPawn(GetWorld(), 0));
if (OptiXVRPawn)
{
OptiXVRPawn->UIEventTranslation();
}
} }
void ASelectableActorBase::EnableRotation() void ASelectableActorBase::EnableRotation()
...@@ -424,8 +433,35 @@ void ASelectableActorBase::EnableRotation() ...@@ -424,8 +433,35 @@ void ASelectableActorBase::EnableRotation()
ArrowX->SetGenerateOverlapEvents(false); ArrowX->SetGenerateOverlapEvents(false);
ArrowY->SetGenerateOverlapEvents(false); ArrowY->SetGenerateOverlapEvents(false);
ArrowZ->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) void ASelectableActorBase::SetRodPosition(FVector TablePosition)
{ {
FVector TableZero = TablePosition + FVector(0, 0, 98); // Table Height FVector TableZero = TablePosition + FVector(0, 0, 98); // Table Height
......
...@@ -40,6 +40,17 @@ public: ...@@ -40,6 +40,17 @@ public:
UFUNCTION(BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor") UFUNCTION(BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor")
AActor* GetActorNearHand(UPrimitiveComponent* Hand); 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: public:
......
...@@ -39,6 +39,12 @@ public: ...@@ -39,6 +39,12 @@ public:
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor") UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor")
void Deselect(); 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") UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, /*meta = (BlueprintProtected)*/ Category = "OptiXActor")
void RequestRemoval(); void RequestRemoval();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment