5#include "CoreMinimal.h"
6#include "GripMotionControllerComponent.h"
8#include "GameFramework/Actor.h"
9#include "Components/SphereComponent.h"
10#include "Components/SplineComponent.h"
11#include "Components/WidgetComponent.h"
12#include "Components/WidgetInteractionComponent.h"
13#include "Sound/SoundCue.h"
14#include "PixoVRHand.generated.h"
37USTRUCT(BlueprintType, Category =
"Animation")
42 UPROPERTY(EditAnywhere, BlueprintReadWrite)
44 UPROPERTY(EditAnywhere, BlueprintReadWrite)
46 UPROPERTY(EditAnywhere, BlueprintReadWrite)
48 UPROPERTY(EditAnywhere, BlueprintReadWrite)
50 UPROPERTY(EditAnywhere, BlueprintReadWrite)
57UENUM(BlueprintType, Category = "Animation")
60 Default UMETA(DisplayName =
"No Checker"),
61 StoryObject UMETA(DisplayName =
"Object is using Story Object Interface"),
62 StoryActive UMETA(DisplayName =
"Object is using Is Object Active"),
63 VRGrip UMETA(DisplayName =
"Object is using VRGrip Interface"),
79 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
81 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
82 UGripMotionControllerComponent* MotionController;
83 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
84 USphereComponent* GrabSphere;
85 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
86 USkeletalMeshComponent* HandMesh;
87 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
88 UStaticMeshComponent* LaserMesh;
89 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
90 USplineComponent* ThumbSpline;
91 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
92 USplineComponent* IndexSpline;
93 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
94 USplineComponent* MiddleSpline;
95 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
96 USplineComponent* RingSpline;
97 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
98 USplineComponent* PinkySpline;
99 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
100 UWidgetInteractionComponent* TouchComponent;
101 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
102 UChildActorComponent* WristMenu;
104 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
105 bool IsWristMenuEnabled = false;
116 void ReleaseObject();
123 void ManuallyPutActorToHand(
AActor* ActorRef);
130 void OnObjectOutOfRange(const FBPActorGripInformation& GripInformation,
float Distance);
136 UFUNCTION(BlueprintCallable, Category = "TouchWidget")
137 void OnTouchWidget(UWidgetComponent* WidgetComponent, UWidgetComponent* PreviousWidgetComponent);
141 UFUNCTION(BlueprintCallable, Category = "TouchWidget")
142 void DeactivateTouchCooldown();
148 void ReleaseHeldObjectOnOtherHand(
AActor* HeldActor);
149 UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
156 UFUNCTION(BlueprintCallable)
157 void ToggleLaser(
bool Visible);
159 USoundCue* LaserSound;
168 UFUNCTION(BlueprintCallable, Category = "Animation")
169 TArray<FVector> GetRelativePointsArray(USplineComponent* FingerSpline,
float Precision);
176 UFUNCTION(BlueprintCallable, Category = "Animation")
177 float TraceFingerForObstacle(TArray<FVector> RelativePointsArray);
182 UFUNCTION(BlueprintCallable, Category = "Animation")
183 void SetupFingerTracePoints();
184 UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, Category = "Animation")
190 UFUNCTION(BlueprintCallable, Category = "Animation")
191 void UpdateFingerData();
193 UPROPERTY(BlueprintReadWrite, Category = "Animation")
194 bool UseCustomAnimation = false;
196 UPROPERTY(EditDefaultsOnly, Category = "Animation")
197 bool ChangeHandAnimationNearInteractableObject = false;
201 UPROPERTY(EditDefaultsOnly, Category = "Animation", meta = (EditCondition = "ChangeHandAnimationNearInteractableObject == true", EditConditionHides))
206 UPROPERTY(EditDefaultsOnly, Category = "Animation", meta = (EditCondition = "ChangeHandAnimationNearInteractableObject == true", EditConditionHides))
207 bool IsObjectHighlightActive = false;
208 bool InteractableObjectNearHand = false;
209 AActor* OverlapedActor =
nullptr;
211 TArray<FVector> ThumbPositionCache;
212 TArray<FVector> IndexPositionCache;
213 TArray<FVector> MiddlePositionCache;
214 TArray<FVector> RingPositionCache;
215 TArray<FVector> PinkyPositionCache;
224 virtual
void BeginPlay() override;
226 bool TouchComponentCooldownActive;
230 virtual
void Tick(
float DeltaTime) override;
233 void InitPixoVRHands(EControllerHand MotionSource,
APixoVRCharacter* Character);
239 UFUNCTION(BlueprintCallable, Category = "WristMenu")
240 void SetWristMenuEnabled(
bool Enabled);
242 UPROPERTY(BlueprintReadWrite, Category = "Init", meta = (ExposeOnSpawn = "true"))
243 EControllerHand HandMotionSource;
245 UPROPERTY(BlueprintReadWrite, Category = "Init")
EGrippableTypeChecker
EGrippableTypeChecker is an enumeration that represents what type of objects we can grip.
Pixo VR Character This class represents the main character in the Pixo VR game. It extends the AVRCha...
APixoVRHand is an actor class that represents a hand in the VR environment.
TArray< FVector > ThumbPositionCache
UWidgetInteractionComponent * TouchComponent
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
bool TouchComponentCooldownActive
FFingerData FingerData
UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, Category = "Animation")
UStaticMeshComponent * LaserMesh
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
USkeletalMeshComponent * HandMesh
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
APixoVRCharacter * OwningCharacter
UPROPERTY(BlueprintReadWrite, Category = "Init")
USplineComponent * RingSpline
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
USplineComponent * PinkySpline
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
TArray< FVector > MiddlePositionCache
UGripMotionControllerComponent * MotionController
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
USphereComponent * GrabSphere
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
USplineComponent * MiddleSpline
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
USceneComponent * Root
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
USplineComponent * ThumbSpline
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
TArray< FVector > PinkyPositionCache
EControllerHand HandMotionSource
UPROPERTY(BlueprintReadWrite, Category = "Init", meta = (ExposeOnSpawn = "true"))
USplineComponent * IndexSpline
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
TArray< FVector > IndexPositionCache
UObject * HandHoldingObject
UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
USoundCue * LaserSound
UPROPERTY()
UChildActorComponent * WristMenu
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
TArray< FVector > RingPositionCache
FFingerData is a structure that holds finger animation data.
float Middle
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float Pinky
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float Index
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float Ring
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float Thumb
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FOverlappingInfo is a structure that holds information about overlapping actors and components.
UPrimitiveComponent * OverlapComponent