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

add first test for an interaction ray

parent 73470627
Branches
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
...@@ -4,9 +4,18 @@ ...@@ -4,9 +4,18 @@
#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 "ConstructorHelpers.h"
#include "VirtualRealityPawn.h" #include "VirtualRealityPawn.h"
UVRWidgetInteractionComponent::UVRWidgetInteractionComponent() {}
UVRWidgetInteractionComponent::UVRWidgetInteractionComponent() {
InteractionRay = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Interaction Ray"));
auto MeshAsset = ConstructorHelpers::FObjectFinder<UStaticMesh>(TEXT("StaticMesh'/Engine/BasicShapes/Cone.Cone'"));
if (MeshAsset.Object != nullptr)
{
InteractionRay->SetStaticMesh(MeshAsset.Object);
}
}
void UVRWidgetInteractionComponent::Init() void UVRWidgetInteractionComponent::Init()
{ {
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Components/WidgetInteractionComponent.h" #include "Components/WidgetInteractionComponent.h"
#include "Components/StaticMeshComponent.h"
#include "VRWidgetInteractionComponent.generated.h" #include "VRWidgetInteractionComponent.generated.h"
/** /**
...@@ -23,5 +25,7 @@ public: ...@@ -23,5 +25,7 @@ public:
protected: protected:
void OnFire(bool val); void OnFire(bool val);
UPROPERTY(VisibleAnywhere) UStaticMeshComponent* InteractionRay;
DECLARE_DELEGATE_OneParam(FFireDelegate, bool); DECLARE_DELEGATE_OneParam(FFireDelegate, bool);
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment