Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
BaseWristMenu.h
Go to the documentation of this file.
1// Copyright(c) 2018 PixoVR, LLC. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "PixoVRHand.h"
7#include "Components/WidgetComponent.h"
8#include "GameFramework/Actor.h"
9#include "BaseWristMenu.generated.h"
10
12
13DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnWristMenuButtonPressedDelegate);
14
15UCLASS()
16class PIXOCORE_API ABaseWristMenu : public AActor
17{
19
20public:
22
23 virtual void Tick(float DeltaTime) override;
24
25 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "WristMenu")
26 UWidgetComponent* WristMenuWidget;
27
28 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "WristMenu")
29 UChildActorComponent* WristMenuButton;
30
31 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "WristMenu")
32 float WristAngleTolerance { 25.0f };
33
37 UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
38 UBoxComponent* PointingFingerCollisionComp;
40 APlayerCameraManager* CameraManagerRef;
41
42 UPROPERTY(BlueprintAssignable, Category = "WristMenu")
43 FOnWristMenuButtonPressedDelegate OnWristMenuButtonPressedDelegate;
44
45protected:
46 virtual void BeginPlay() override;
47
48 static bool bCanOpenWristMenu;
49
50 UFUNCTION(BlueprintCallable, Category = "WristMenu")
51 void SetButtonVisibility(bool IsVisible);
52
53 UFUNCTION(BlueprintCallable, Category = "WristMenu")
54 void SetUIVisibility(bool IsVisible);
55
56 UFUNCTION(BlueprintCallable, Category = "WristMenu")
59 UFUNCTION(BlueprintCallable, Category = "WristMenu")
60 void HideWristMenu();
61
62 UFUNCTION(BlueprintCallable, Category = "WristMenu")
63 bool IsWristMenuOpened();
65public:
69 UFUNCTION()
70 void OnBeginOverlapPointingFingerCollision(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
71 UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep,
72 const FHitResult& SweepResult);
73
77 UFUNCTION()
78 void OnEndOverlapPointingFingerCollision(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
79 UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);
80private:
84 void OnPointingFingerCollisionOverlapChange(AActor* OtherActor, bool IsBeginOverlap) const;
85
86
87};
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnWristMenuButtonPressedDelegate)
Represents a wrist menu button actor.
FOnWristMenuButtonPressed OnWristMenuButtonPressed
UPROPERTY(BlueprintCallable)
void OnEndOverlapPointingFingerCollision(UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex)
Change hand animation to default.
void OnBeginOverlapPointingFingerCollision(UPrimitiveComponent *OverlappedComponent, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
Change hand animation to pointing finger.
void OnPointingFingerCollisionOverlapChange(AActor *OtherActor, bool IsBeginOverlap) const
Change hand animation.
UBoxComponent * PointingFingerCollisionComp
UPROPERTY(EditDefaultsOnly)
APlayerCameraManager * CameraManagerRef
FOnWristMenuButtonPressedDelegate OnWristMenuButtonPressedDelegate
UPROPERTY(BlueprintAssignable, Category = "WristMenu")
UChildActorComponent * WristMenuButton
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "WristMenu")
static bool bCanOpenWristMenu
UWidgetComponent * WristMenuWidget
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "WristMenu")
UBoxComponent * PointingFingerCollisionComp
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)