Skip to content
Snippets Groups Projects
Commit 942e7a53 authored by Jonathan Wendt's avatar Jonathan Wendt
Browse files

renaming of class to VRWidgetInteractionComponent

parent b9536616
No related branches found
No related tags found
1 merge request!2Feature/update to new VRPawn structure and adding an interaction ray that is also available in shipping builds
// Fill out your copyright notice in the Description page of Project Settings. // Fill out your copyright notice in the Description page of Project Settings.
#include "RwthComponent.h" #include "VRWidgetInteractionComponent.h"
#include "Runtime/InputCore/Classes/InputCoreTypes.h" #include "Runtime/InputCore/Classes/InputCoreTypes.h"
#include "Runtime/Engine/Classes/Components/InputComponent.h" #include "Runtime/Engine/Classes/Components/InputComponent.h"
#include "VirtualRealityPawn.h" #include "VirtualRealityPawn.h"
URwthComponent::URwthComponent() UVRWidgetInteractionComponent::UVRWidgetInteractionComponent() {}
{
}
void URwthComponent::Init() void UVRWidgetInteractionComponent::Init()
{ {
SetVisibility(true); SetVisibility(true);
InteractionDistance = 1000000.0f; InteractionDistance = 1000000.0f;
auto input_cmp = dynamic_cast<UInputComponent*>(GetOwner()->GetComponentByClass(UInputComponent::StaticClass())); auto input_cmp = dynamic_cast<UInputComponent*>(GetOwner()->GetComponentByClass(UInputComponent::StaticClass()));
...@@ -23,11 +21,11 @@ void URwthComponent::Init() ...@@ -23,11 +21,11 @@ void URwthComponent::Init()
RegisterComponent(); RegisterComponent();
} }
void URwthComponent::SetVisibility(bool visible) { void UVRWidgetInteractionComponent::SetVisibility(bool visible) {
bShowDebug = visible; bShowDebug = visible;
} }
void URwthComponent::OnFire(bool val) void UVRWidgetInteractionComponent::OnFire(bool val)
{ {
if (val == true) if (val == true)
PressPointerKey(EKeys::LeftMouseButton); PressPointerKey(EKeys::LeftMouseButton);
......
...@@ -4,21 +4,21 @@ ...@@ -4,21 +4,21 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Components/WidgetInteractionComponent.h" #include "Components/WidgetInteractionComponent.h"
#include "RwthComponent.generated.h" #include "VRWidgetInteractionComponent.generated.h"
/** /**
* *
*/ */
UCLASS() UCLASS()
class WIDGETINTERACTION_API URwthComponent : public UWidgetInteractionComponent class WIDGETINTERACTION_API UVRWidgetInteractionComponent : public UWidgetInteractionComponent
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
URwthComponent(); UVRWidgetInteractionComponent();
void Init(); void Init();
void SetVisibility(bool visible); void SetVisibility(bool visible);
protected: protected:
void OnFire(bool val); void OnFire(bool val);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "VirtualRealityPawn.h" #include "VirtualRealityPawn.h"
#include "RwthComponent.h" #include "VRWidgetInteractionComponent.h"
#include "Modules/ModuleManager.h" #include "Modules/ModuleManager.h"
class WIDGETINTERACTION_API FWidgetInteractionModule : public IModuleInterface class WIDGETINTERACTION_API FWidgetInteractionModule : public IModuleInterface
...@@ -17,7 +17,7 @@ public: ...@@ -17,7 +17,7 @@ public:
UFUNCTION() void OnWorldTickStart(ELevelTick, float); UFUNCTION() void OnWorldTickStart(ELevelTick, float);
URwthComponent* GetWidgetInteractionComponent(); UVRWidgetInteractionComponent* GetWidgetInteractionComponent();
private: private:
void CreateWidgetInteraction(USceneComponent * parent, AVirtualRealityPawn* outer); void CreateWidgetInteraction(USceneComponent * parent, AVirtualRealityPawn* outer);
...@@ -25,6 +25,6 @@ private: ...@@ -25,6 +25,6 @@ private:
private: private:
TBaseDelegate<void, ELevelTick, float> on_world_tick_start_delegate_; TBaseDelegate<void, ELevelTick, float> on_world_tick_start_delegate_;
URwthComponent * widget_interaction_cmp_; UVRWidgetInteractionComponent * widget_interaction_cmp_;
UWorld* last_world; UWorld* last_world;
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment