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

allow to set the interaction ray invisible

parent e468f586
Branches
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ URwthComponent::URwthComponent() ...@@ -12,7 +12,7 @@ URwthComponent::URwthComponent()
void URwthComponent::Init() void URwthComponent::Init()
{ {
bShowDebug = 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,6 +23,10 @@ void URwthComponent::Init() ...@@ -23,6 +23,10 @@ void URwthComponent::Init()
RegisterComponent(); RegisterComponent();
} }
void URwthComponent::SetVisibility(bool visible) {
bShowDebug = visible;
}
void URwthComponent::OnFire(bool val) void URwthComponent::OnFire(bool val)
{ {
if (val == true) if (val == true)
......
...@@ -89,6 +89,10 @@ void FWidgetInteractionModule::OnWorldTickStart(ELevelTick level_tick, float val ...@@ -89,6 +89,10 @@ void FWidgetInteractionModule::OnWorldTickStart(ELevelTick level_tick, float val
} }
} }
URwthComponent* FWidgetInteractionModule::GetWidgetInteractionComponent() {
return widget_interaction_cmp_;
}
void FWidgetInteractionModule::CreateWidgetInteraction(USceneComponent * parent, AVirtualRealityPawn* outer) void FWidgetInteractionModule::CreateWidgetInteraction(USceneComponent * parent, AVirtualRealityPawn* outer)
{ {
widget_interaction_cmp_ = NewObject<URwthComponent>(outer, URwthComponent::StaticClass()); widget_interaction_cmp_ = NewObject<URwthComponent>(outer, URwthComponent::StaticClass());
......
...@@ -18,6 +18,8 @@ public: ...@@ -18,6 +18,8 @@ public:
void Init(); void Init();
void SetVisibility(bool visible);
protected: protected:
void OnFire(bool val); void OnFire(bool val);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "RwthComponent.h" #include "RwthComponent.h"
#include "Modules/ModuleManager.h" #include "Modules/ModuleManager.h"
class FWidgetInteractionModule : public IModuleInterface class WIDGETINTERACTION_API FWidgetInteractionModule : public IModuleInterface
{ {
public: public:
...@@ -18,6 +18,8 @@ public: ...@@ -18,6 +18,8 @@ public:
UFUNCTION() UFUNCTION()
void OnWorldTickStart(ELevelTick, float); void OnWorldTickStart(ELevelTick, float);
URwthComponent* GetWidgetInteractionComponent();
private: private:
void CreateWidgetInteraction(USceneComponent * parent, AVirtualRealityPawn* outer); void CreateWidgetInteraction(USceneComponent * parent, AVirtualRealityPawn* outer);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment