A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
PixoVRCharacter.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 "VRCharacter.h"
7#include "PixoVRHand.h"
9#include "PixoVRCharacter.generated.h"
10
15class UDataTable;
17class APixoVRLaser;
18class UPixoVRMotionControllerComponent;
20
21DECLARE_LOG_CATEGORY_EXTERN(LogPixoVRCharacter, Log, All);
22DECLARE_MULTICAST_DELEGATE_TwoParams(FOnTeleportationActivated, EControllerHand, bool);
23DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnWristMenuActivated, EControllerHand, Hand);
24DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnHandGrabAction, bool, Pressed, bool, RightGrab);
25
30UCLASS(Blueprintable)
31class PIXOCORE_API APixoVRCharacter : public AVRCharacter
32{
35public:
37
38 virtual void BeginPlay() override;
39 virtual void Tick(float DeltaTime) override;
40 virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
41 virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
42 virtual void PossessedBy(AController* NewController) override;
43
44 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "PixoVR")
45 float DefaultPlayerHeight;
46
47 /********************************* Teleport *********************************/
48 UFUNCTION(BlueprintCallable) void HandleTeleportLeftPressed();
49 UFUNCTION(BlueprintCallable) void HandleTeleportLeftReleased();
50 UFUNCTION(BlueprintCallable) void HandleTeleportRightPressed();
51 UFUNCTION(BlueprintCallable) void HandleTeleportRightReleased();
53 UFUNCTION(Server, Unreliable, WithValidation)
54 void HandleTeleportLeftUp(float Value);
55
56 UFUNCTION(Server, Unreliable, WithValidation)
57 void HandleTeleportLeftRight(float Value);
58
59 UFUNCTION(Server, Unreliable, WithValidation)
60 void HandleTeleportRightUp(float Value);
61
62 UFUNCTION(Server, Unreliable, WithValidation)
63 void HandleTeleportRightRight(float Value);
64
65 virtual bool CanTeleport() const;
66
67 UFUNCTION()
68 void ExecuteTeleportation(EControllerHand Hand);
69
71 UFUNCTION(BlueprintCallable, Category = "PixoVR")
72 void ActivateTeleporter(EControllerHand Hand, bool InActivate);
73
74 UFUNCTION(BlueprintCallable, Server, Reliable, WithValidation, Category = "PixoVR")
75 void NotifyActivateTeleporter(EControllerHand Hand, bool InActivate);
76
77 UFUNCTION(BlueprintCallable, NetMulticast, Reliable, Category = "PixoVR")
78 void MulticastActivateTeleporter(EControllerHand Hand, bool InActivate);
79
80 UFUNCTION()
81 void SpawnTeleporter(EControllerHand Hand, bool InActivate);
82
83 UPROPERTY(BlueprintReadWrite, Category = "PixoVR")
84 bool bLaserBeamActive;
85
86 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
87 FName LeftTeleporterSocket;
88
89 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
90 FName RightTeleporterSocket;
91
92 UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
93 APixoVRTeleporter* TeleportControllerLeft;
95 UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
96 APixoVRTeleporter* TeleportControllerRight;
97
98 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
99 TSubclassOf<APixoVRTeleporter> TeleportControllerClass;
100
102 UPROPERTY(EditAnywhere, Replicated, BlueprintReadWrite, Category = "PixoVR")
103 bool bTeleporterEnabled = true;
104
105 FOnTeleportationActivated& OnTeleportationActivated() { return OnTeleportationActivatedEvent; };
106
107 /****************************** Laser ****************************/
108 UFUNCTION(BlueprintCallable) void HandleLaserBeamLeftPressed();
109 UFUNCTION(BlueprintCallable) void HandleLaserBeamRightPressed();
110
111 UFUNCTION (BlueprintCallable, BlueprintPure)
112 void IsLaserActivated (bool& IsActivated, EControllerHand& Hand);
113
114 UFUNCTION(Server, Reliable, WithValidation)
115 void IsOverWidgetUse(EControllerHand Hand, bool InPressed);
116
117 UFUNCTION(Client, Reliable)
118 void PerformIsOverWidgetUse(EControllerHand Hand, bool InPressed);
119
120 UFUNCTION(Server, Reliable)
121 void HandleLaserSelectEvent(EControllerHand Hand, bool Pressed);
122 UFUNCTION(NetMulticast, Reliable)
123 void MultiHandleLaserSelectEvent(EControllerHand Hand, bool Pressed);
124 UFUNCTION()
125 void HandleLaserSelect(EControllerHand Hand, bool Pressed);
126
127 UFUNCTION()
128 void SpawnLaserBeam(EControllerHand Hand, bool InActivate);
129
130 //Laser Beam Select
131
132 void HandleLaserSelectLeft();
133 void HandleLaserReleaseLeft();
134 void HandleLaserSelectRight();
135 void HandleLaserReleaseRight();
136
138 UFUNCTION(BlueprintCallable, Server, Reliable, WithValidation, Category = "PixoVR")
139 void ActivateLaserBeam(EControllerHand Hand, bool InActivate);
140
141 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category ="PixoVR")
142 void HandleHandAnimationLaser(EControllerHand Hand);
143
144 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
145 FName LeftLaserBeamSocket;
146
147 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
148 FName RightLaserBeamSocket;
149
150 UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
151 APixoVRLaser* LaserControllerLeft;
152
153 UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
154 APixoVRLaser* LaserControllerRight;
155
156 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "PixoVR")
157 bool bLeftLaserBeamIsActiveOnStart;
159 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "PixoVR")
160 bool bRightLaserBeamIsActiveOnStart;
161
162 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
163 TSubclassOf<APixoVRLaser> LaserControllerClass;
164
165 UPROPERTY(BlueprintReadOnly, Replicated)
166 bool bActivateLeftLaser;
167
168 UPROPERTY(BlueprintReadOnly, Replicated)
169 bool bActivateRightLaser;
170
171 /********************************* WristMenu *********************************/
172 UFUNCTION(BlueprintCallable)
173 void HandleActivateWristMenuPressed();
174
175 UFUNCTION(BlueprintCallable)
176 void HandleSelectWristMenuItemPressed();
177
178 UFUNCTION(BlueprintCallable)
179 void SelectWristMenu(EControllerHand Hand);
180
181 UFUNCTION(BlueprintCallable)
182 void HandleActivateWristMenuPressedLeft();
183
184 UFUNCTION(BlueprintCallable)
185 void HandleActivateWristMenuPressedRight();
186
187 UFUNCTION(Server, Reliable, WithValidation)
188 void SpawnWristMenu();
189
190 UFUNCTION(Server, Reliable, WithValidation)
191 void SpawnProgressBar();
192
194 UFUNCTION(BlueprintCallable, Server, Reliable, WithValidation, Category = "PixoVR")
195 void ActivateWristMenu(EControllerHand Hand);
196
197 UFUNCTION(BlueprintCallable, Server, Reliable, WithValidation, Category = "PixoVR")
198 void ActivateProgressBar(EControllerHand Hand, bool InActivate);
199
200 virtual void HandleSelectWristMenuItemPressedLeft();
201 virtual void HandleSelectWristMenuItemPressedRight();
202
203 virtual void HandleWristMenuItem1Pressed();
204 virtual void HandleWristMenuItem2Pressed();
205 virtual void HandleWristMenuItem3Pressed();
206 virtual void HandleWristMenuItem4Pressed();
207 virtual void HandleWristMenuItem5Pressed();
208 virtual void HandleWristMenuItem6Pressed();
209 virtual void HandleWristMenuItem7Pressed();
210 virtual void HandleWristMenuItem8Pressed();
212 virtual void HandleWristMenuDoubleTap(FKey InputKey);
213
214 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR")
215 USceneComponent* WristMenuLoc;
216
217 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
218 TSubclassOf<APixoVRWristMenu> WristMenuClass;
219
220 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
221 TSubclassOf<APixoVRCircleProgress> ProgressBarClass;
222
223 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
224 FName WristMenuSocket;
226 UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR", meta = (AllowPrivateAccess = "true"))
227 APixoVRWristMenu* WristMenu;
228
229 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR", meta = (AllowPrivateAccess = "true"))
230 UPixoVRLongHoldComponent* LongHoldComponent;
232 UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR", meta = (AllowPrivateAccess = "true"))
233 APixoVRCircleProgress* ProgressBar;
234
235 FVector MirroredWristMenuScale;
236
237 UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Replicated, Category= "PixoVR")
238 EControllerHand CurrentWristMenuHand;
239
240 UPROPERTY(BlueprintAssignable)
241 FOnWristMenuActivated OnWristMenuActivated;
242
243 /****************************************************************/
244
245 virtual void TurnVRLeft();
246 virtual void TurnVRRight();
247
249 UFUNCTION(NetMulticast, Reliable)
250 void ActivateFPSMode(bool Enable);
251
252 void MoveForward(float Value);
253 void MoveRight(float Value);
254 void TurnAtRate(float Rate);
255 void LookUpAtRate(float Rate);
256
257 /****************************** Hands ****************************/
258 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hands")
259 TSubclassOf<APixoVRHand> VRHandClass;
260
261 UPROPERTY(BlueprintReadOnly, Category = "Hands")
262 APixoVRHand* VRHandLeft;
263 UPROPERTY(BlueprintReadOnly, Category = "Hands")
264 APixoVRHand* VRHandRight;
265
266 UFUNCTION(BlueprintCallable, Category = "Hands")
267 virtual void GrabRightPressed();
268 UFUNCTION(BlueprintCallable, Category = "Hands")
269 virtual void GrabLeftPressed();
270 UFUNCTION(BlueprintCallable, Category = "Hands")
271 virtual void GrabRightReleased();
272 UFUNCTION(BlueprintCallable, Category = "Hands")
273 virtual void GrabLeftReleased();
274
281 UFUNCTION(BlueprintCallable, Category = "Hands")
282 AActor* SpawnActorInHand(TSubclassOf<AActor> ActorClass, bool RightHand);
283
284 UFUNCTION(BlueprintCallable, Category = "Hands")
285 void ResetHandHoldingObject();
290 UFUNCTION(BlueprintCallable, Category = "Hands")
291 void ResetHand(bool RightHand);
292 bool HoldToolRight;
293 bool HoldToolLeft;
294
295 UFUNCTION(BlueprintCallable)
296 void ShowTool(EControllerHand Hand, AActor* Tool);
297
298 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
299 FName ToolSocket;
300
301 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Fade")
302 UStaticMeshComponent* FadeSphere;
303
304 UPROPERTY(BlueprintAssignable, Category = "Hands")
305 FOnHandGrabAction OnHandGrabAction;
307 /****************************** Hints ****************************/
308 UPROPERTY(BlueprintReadOnly)
309 UHintManager* HintManager;
310
311 UFUNCTION(BlueprintCallable, Category = "Hint")
312 void ActivateHint();
313 UFUNCTION(BlueprintCallable, Category = "Hint")
314 void DeactivateHint();
315
316 float BaseTurnRate;
317 float BaseLookUpRate;
318 float DeflectionAngle = 30.0f;
319
320 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="PixoVR", Meta=(Tooltip="If checked, Laser, Teleporter and Wrist Menu input handling will be disabled."))
321 bool bDisableToolsInputBindings;
322
323 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category="PixoVR")
324 UDataTable* InputsTable;
325
326 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR", meta = (AllowPrivateAccess = "true"))
328
329 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR", meta = (AllowPrivateAccess = "true"))
331
332 FVector2D LastTeleportLeftDirectionVector;
333 FVector2D LastTeleportRightDirectionVector;
334
335 FKey LastPressedKey;
336
337private:
338 UFUNCTION()
339 void PlayerDestroyed(AActor* Act);
340
341 UPROPERTY()
342 UPixoVRInputAdapter* InputAdapter;
343
344 bool bFPSMode;
345
346 FOnTeleportationActivated OnTeleportationActivatedEvent;
347
348 UPROPERTY(Replicated)
349 bool bIsOverWidgetUse = false;
350};
DECLARE_LOG_CATEGORY_EXTERN(LogPixoVRCharacter, Log, All)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnWristMenuActivated, EControllerHand, Hand)
DECLARE_MULTICAST_DELEGATE_TwoParams(FOnTeleportationActivated, EControllerHand, bool)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnHandGrabAction, bool, Pressed, bool, RightGrab)
Pixo VR Character This class represents the main character in the Pixo VR game. It extends the AVRCha...
FName LeftTeleporterSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
APixoVRCircleProgress * ProgressBar
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR", meta = (AllowPrivateAccess = "true"))
bool bActivateRightLaser
UPROPERTY(BlueprintReadOnly, Replicated)
float DefaultPlayerHeight
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "PixoVR")
bool bActivateLeftLaser
UPROPERTY(BlueprintReadOnly, Replicated)
bool bLeftLaserBeamIsActiveOnStart
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "PixoVR")
void HandleLaserSelectEvent(EControllerHand Hand, bool Pressed)
UFUNCTION(Server, Reliable)
EControllerHand CurrentWristMenuHand
UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Replicated, Category= "PixoVR")
FVector2D LastTeleportLeftDirectionVector
TSubclassOf< APixoVRCircleProgress > ProgressBarClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
APixoVRLaser * LaserControllerRight
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
void HandleTeleportLeftRight(float Value)
UFUNCTION(Server, Unreliable, WithValidation)
void IsOverWidgetUse(EControllerHand Hand, bool InPressed)
UFUNCTION(Server, Reliable, WithValidation)
FName LeftLaserBeamSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
FOnTeleportationActivated OnTeleportationActivatedEvent
APixoVRHand * VRHandLeft
UPROPERTY(BlueprintReadOnly, Category = "Hands")
void ActivateWristMenu(EControllerHand Hand)
Activate/Deactivate the Wrist Menu.
void HandleHandAnimationLaser(EControllerHand Hand)
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category ="PixoVR")
TSubclassOf< APixoVRWristMenu > WristMenuClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
TSubclassOf< APixoVRLaser > LaserControllerClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
UDataTable * InputsTable
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category="PixoVR")
APixoVRTeleporter * TeleportControllerLeft
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
void PerformIsOverWidgetUse(EControllerHand Hand, bool InPressed)
UFUNCTION(Client, Reliable)
FName RightLaserBeamSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
UHintManager * HintManager
UPROPERTY(BlueprintReadOnly)
FName RightTeleporterSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
FVector MirroredWristMenuScale
UStaticMeshComponent * Body
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR", meta = (AllowPrivateAccess = "tru...
TSubclassOf< APixoVRTeleporter > TeleportControllerClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
bool bRightLaserBeamIsActiveOnStart
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "PixoVR")
void HandleTeleportLeftUp(float Value)
UFUNCTION(Server, Unreliable, WithValidation)
FVector2D LastTeleportRightDirectionVector
UPixoVRLongHoldComponent * LongHoldComponent
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR", meta = (AllowPrivateAccess = "tru...
UStaticMeshComponent * Head
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR", meta = (AllowPrivateAccess = "tru...
void ActivateProgressBar(EControllerHand Hand, bool InActivate)
UFUNCTION(BlueprintCallable, Server, Reliable, WithValidation, Category = "PixoVR")
APixoVRHand * VRHandRight
UPROPERTY(BlueprintReadOnly, Category = "Hands")
APixoVRWristMenu * WristMenu
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR", meta = (AllowPrivateAccess = "true"))
void MultiHandleLaserSelectEvent(EControllerHand Hand, bool Pressed)
UFUNCTION(NetMulticast, Reliable)
APixoVRLaser * LaserControllerLeft
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
void MulticastActivateTeleporter(EControllerHand Hand, bool InActivate)
UFUNCTION(BlueprintCallable, NetMulticast, Reliable, Category = "PixoVR")
void ActivateLaserBeam(EControllerHand Hand, bool InActivate)
Activate/Deactivate the Laser-beam.
FOnTeleportationActivated & OnTeleportationActivated()
bool bDisableToolsInputBindings
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="PixoVR", Meta=(Tooltip="If checked,...
USceneComponent * WristMenuLoc
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "PixoVR")
bool bLaserBeamActive
UPROPERTY(BlueprintReadWrite, Category = "PixoVR")
UStaticMeshComponent * FadeSphere
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Fade")
void HandleTeleportRightRight(float Value)
UFUNCTION(Server, Unreliable, WithValidation)
UPixoVRInputAdapter * InputAdapter
UPROPERTY()
void ActivateFPSMode(bool Enable)
For Windows.
TSubclassOf< APixoVRHand > VRHandClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hands")
void HandleTeleportRightUp(float Value)
UFUNCTION(Server, Unreliable, WithValidation)
FName ToolSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
FName WristMenuSocket
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "PixoVR")
FOnHandGrabAction OnHandGrabAction
UPROPERTY(BlueprintAssignable, Category = "Hands")
FOnWristMenuActivated OnWristMenuActivated
UPROPERTY(BlueprintAssignable)
void NotifyActivateTeleporter(EControllerHand Hand, bool InActivate)
UFUNCTION(BlueprintCallable, Server, Reliable, WithValidation, Category = "PixoVR")
APixoVRTeleporter * TeleportControllerRight
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
void SpawnWristMenu()
UFUNCTION(Server, Reliable, WithValidation)
void SpawnProgressBar()
UFUNCTION(Server, Reliable, WithValidation)
Class representing a circular progress indicator in PixoVR. The circle progress can be updated to dis...
APixoVRHand is an actor class that represents a hand in the VR environment.
Definition PixoVRHand.h:99
Class for VR laser interaction. It can interact with widget buttons or actors derived from IPixoVRInt...
Definition PixoVRLaser.h:23
Class for VR teleporter functionality. It allows teleportation using visual indicators.
A actor class representing the PixoVR wrist menu. The wrist menu allows users to interact with menu i...
virtual void PossessedBy(AController *NewController)
UCLASS()
Definition VRCharacter.h:23
Manager that provides functionality for managing hint activation events.
Definition HintManager.h:19
A class for resolving and managing input mappings for different platforms.
Component for handling long hold functionality in PixoVR. Allows execution of a function when a butto...