A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
PixoVRWristMenu.h
Go to the documentation of this file.
1// Copyright(c) Pixo Group. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Components/TimelineComponent.h"
8#include "Sound/SoundCue.h"
10#include "PixoVRWristMenu.generated.h"
11
12class UArrowComponent;
15class UStaticMesh;
16
17DECLARE_LOG_CATEGORY_EXTERN(LogPixoVRWristMenu, Log, All);
18
24UCLASS(Blueprintable)
25class PIXOCORE_API APixoVRWristMenu : public AActor
26{
27 GENERATED_BODY()
29public:
31
36 UFUNCTION(BlueprintCallable, NetMulticast, Reliable, Category = "PixoVR | Wrist Menu")
37 void ActivateWristMenu(bool InActivate);
38
43 UFUNCTION(BlueprintCallable, Category = "PixoVR | Wrist Menu")
44 bool IsActivated();
50 UFUNCTION(BlueprintCallable, Category = "PixoVR | Wrist Menu")
51 EWristMenuItemCategory SelectMenuItem();
52
58 UFUNCTION(BlueprintCallable, NetMulticast, Reliable, Category = "PixoVR | Wrist Menu")
59 void UpdateTrackpadPosition(const FVector2D& position);
60
66 UFUNCTION(BlueprintCallable, Category = "PixoVR | Wrist Menu")
67 void IncreaseSelectedItem(int Amount);
68
73 UFUNCTION(BlueprintCallable, Category = "PixoVR | Wrist Menu")
74 void SetEventHandlers(TArray<UObject*>& InEventHandleObjects);
75
80 UFUNCTION(BlueprintCallable, Category = "PixoVR | Wrist Menu")
81 void CalculateRotationByItemIndex(const int32 WristMenuItemIndex);
82
87 UFUNCTION(BlueprintCallable, Category = "PixoVR | Wrist Menu")
88 void AddIMenuItem(const FPixoVRWristMenuDataTableRow& InNewItemInfo);
89
90protected:
95 UFUNCTION(BlueprintCallable, Category = "PixoVR | Wrist Menu")
96 void RebuildWristMenu(UDataTable* NewWidgetDataTable);
97
101 UFUNCTION(BlueprintCallable, Category = "PixoVR | Wrist Menu")
102 void ResetToDefaultTable();
103
104private:
105 virtual void BeginPlay() override;
106 virtual void Tick(float DeltaTime) override;
107 void TickWristMenu(float DeltaTime);
108
112 void CreateAllWidgets();
116 void ClearAllWidgets();
117
122 void CalculateRotationFromInput(const FVector2D& Direction);
123
128 bool ParseWidgetDataTable();
133 bool ParseWidgetDataTableRows();
134
139 UFUNCTION()
140 void HandleTimeLineFloat(float Value);
144 UFUNCTION()
145 void HandleTimelineFinished();
146
147public:
148 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
149 USceneComponent* SceneComponent;
150
151 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
152 UStaticMeshComponent* RadialFloatingMesh;
153
154 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
155 UStaticMeshComponent* RadialArrowMesh;
156
157 UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
158 UAudioComponent* AudioComponent;
159
160 UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
161 UTimelineComponent* TimelineComponent;
162
163 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
164 UCurveFloat* Curve;
165
166 UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
167 bool bIsActivated;
168
169 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
170 float ThumbDeadZone;
171
172 UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
173 int CurrentNormalAngleIndex;
174 UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
175 int CurrentLargeAngleIndex;
176
177 UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
178 int PreviousNormalAngleIndex;
179 UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
180 int PreviousLargeAngleIndex;
181
182 UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
183 float AnglePerNormalItem;
184 UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
185 float AnglePerLargeItem;
186 UPROPERTY(BlueprintReadOnly, Transient, Category = "PixoVR | Wrist Menu")
187 float CurrentAngle;
188
189 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
190 float IconRadialDistance;
191 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
192 FVector IconRelativeScale;
193
194 FVector2D CurrentPadDirection;
195 FRotator CurrentArrowRotation;
196
197 UPROPERTY(Transient)
198 UDataTable* WidgetDataTableDefault;
199
200 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu", meta = (AllowPrivateAccess = "true"))
201 UDataTable* WidgetDataTable;
202
203 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu", meta = (AllowPrivateAccess = "true"))
204 TSubclassOf<class UUserWidget> WristMenuWidgetClass;
205 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu", meta = (AllowPrivateAccess = "true"))
206 TSubclassOf<class UUserWidget> WristMenuTitleWidgetClass;
207
208 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
209 TArray<UObject*> EventHandleObjects;
210
211 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
212 USoundCue* SelectAudioCue;
213 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
214 USoundCue* HoverAudioCue;
216 TArray<UWidgetComponent*> WidgetComponents;
217 TArray<UWidgetComponent*> LargeWidgetComponents;
218
219 TArray<FPixoVRWristMenuDataTableRow*> DataTableRows;
220 TArray<FPixoVRWristMenuDataTableRow*> DataTableRowsNormal;
221 TArray<FPixoVRWristMenuDataTableRow*> DataTableRowsLarge;
223 UPROPERTY()
224 UWidgetComponent* Title;
225
226 UPROPERTY()
227 UWidgetComponent* CurrentPointedWidgetComponent;
228 UPROPERTY()
229 UWidgetComponent* CurrentLargePointedWidgetComponent;
230
231 FOnTimelineFloat TimelinePostUpdate;
232 FOnTimelineEvent TimelineFinished;
233
234 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
235 float RotationSpeed;
236
237 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
238 bool bAlignToPlayerHead;
239
240private:
241 int MaxNumberOfNormalButtons;
242 int MaxNumberOfLargeButtons;
243};
DECLARE_LOG_CATEGORY_EXTERN(LogPixoVRWristMenu, Log, All)
EWristMenuItemCategory
Enum representing the category of a wrist menu item in PixoVR.
A actor class representing the PixoVR wrist menu. The wrist menu allows users to interact with menu i...
float IconRadialDistance
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
UDataTable * WidgetDataTable
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu", meta = (AllowPrivateAcc...
bool bAlignToPlayerHead
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
UWidgetComponent * Title
UPROPERTY()
UDataTable * WidgetDataTableDefault
UPROPERTY(Transient)
USceneComponent * SceneComponent
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
float CurrentAngle
UPROPERTY(BlueprintReadOnly, Transient, Category = "PixoVR | Wrist Menu")
float ThumbDeadZone
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
bool bIsActivated
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
FVector IconRelativeScale
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
UTimelineComponent * TimelineComponent
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
TArray< UObject * > EventHandleObjects
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
TArray< FPixoVRWristMenuDataTableRow * > DataTableRows
The rows from the data table for easier usage.
void ActivateWristMenu(bool InActivate)
Activate or deactivate the wrist menu.
TArray< FPixoVRWristMenuDataTableRow * > DataTableRowsNormal
The rows from the data table for easier usage.
FOnTimelineFloat TimelinePostUpdate
Delegate fired when the timeline has a new update.
int PreviousNormalAngleIndex
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
UWidgetComponent * CurrentPointedWidgetComponent
UPROPERTY()
TArray< UWidgetComponent * > WidgetComponents
The widget components used for rendering normal wrist menu items.
float RotationSpeed
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
UCurveFloat * Curve
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
FRotator CurrentArrowRotation
The current rotation of the arrow.
int PreviousLargeAngleIndex
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
int CurrentNormalAngleIndex
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
UStaticMeshComponent * RadialFloatingMesh
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
FOnTimelineEvent TimelineFinished
Delegate fired when the timeline reaches the end.
UAudioComponent * AudioComponent
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
float AnglePerNormalItem
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
TSubclassOf< class UUserWidget > WristMenuWidgetClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu", meta = (AllowPrivateAcc...
TArray< UWidgetComponent * > LargeWidgetComponents
The widget components used for rendering large wrist menu items.
void UpdateTrackpadPosition(const FVector2D &position)
Update the position of the trackpad. You need to call this method when the user moves his fingers (th...
TArray< FPixoVRWristMenuDataTableRow * > DataTableRowsLarge
The rows from the data table for easier usage.
UStaticMeshComponent * RadialArrowMesh
UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite)
USoundCue * HoverAudioCue
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
USoundCue * SelectAudioCue
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu")
TSubclassOf< class UUserWidget > WristMenuTitleWidgetClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR | Wrist Menu", meta = (AllowPrivateAcc...
FVector2D CurrentPadDirection
The current direction of the pad.
UWidgetComponent * CurrentLargePointedWidgetComponent
UPROPERTY()
float AnglePerLargeItem
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
int CurrentLargeAngleIndex
UPROPERTY(BlueprintReadOnly, Category = "PixoVR | Wrist Menu")
Struct representing a row in the PixoVR wrist menu data table. Each row contains information about a ...