5#include "CoreMinimal.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")
79 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
81 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
83 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
85 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
87 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
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;
111 void ReleaseObject();
118 void ManuallyPutActorToHand(
AActor* ActorRef);
124 UFUNCTION(BlueprintCallable, Category = "TouchWidget")
129 UFUNCTION(BlueprintCallable, Category = "TouchWidget")
130 void DeactivateTouchCooldown();
136 void ReleaseHeldObjectOnOtherHand(
AActor* HeldActor);
137 UPROPERTY(BlueprintReadOnly, Replicated, Category = "PixoVR")
144 UFUNCTION(BlueprintCallable)
145 void ToggleLaser(
bool Visible);
147 USoundCue* LaserSound;
156 UFUNCTION(BlueprintCallable, Category = "Animation")
157 TArray<FVector> GetRelativePointsArray(USplineComponent* FingerSpline,
float Precision);
164 UFUNCTION(BlueprintCallable, Category = "Animation")
165 float TraceFingerForObstacle(TArray<FVector> RelativePointsArray);
170 UFUNCTION(BlueprintCallable, Category = "Animation")
171 void SetupFingerTracePoints();
172 UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, Category = "Animation")
178 UFUNCTION(BlueprintCallable, Category = "Animation")
179 void UpdateFingerData();
181 UPROPERTY(BlueprintReadWrite, Category = "Animation")
182 bool UseCustomAnimation = false;
184 UPROPERTY(EditDefaultsOnly, Category = "Animation")
185 bool ChangeHandAnimationNearInteractableObject = false;
189 UPROPERTY(EditDefaultsOnly, Category = "Animation", meta = (EditCondition = "ChangeHandAnimationNearInteractableObject == true", EditConditionHides))
194 UPROPERTY(EditDefaultsOnly, Category = "Animation", meta = (EditCondition = "ChangeHandAnimationNearInteractableObject == true", EditConditionHides))
195 bool IsObjectHighlightActive = false;
196 bool InteractableObjectNearHand = false;
197 AActor* OverlapedActor =
nullptr;
199 TArray<FVector> ThumbPositionCache;
200 TArray<FVector> IndexPositionCache;
201 TArray<FVector> MiddlePositionCache;
202 TArray<FVector> RingPositionCache;
203 TArray<FVector> PinkyPositionCache;
207 virtual
void BeginPlay() override;
215 bool TouchComponentCooldownActive;
219 virtual
void Tick(
float DeltaTime) override;
222 void InitPixoVRHands(EControllerHand MotionSource,
APixoVRCharacter* Character);
224 UPROPERTY(BlueprintReadWrite, Category = "Init", meta = (ExposeOnSpawn = "true"))
225 EControllerHand HandMotionSource;
227 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()
TArray< FVector > RingPositionCache
UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent), ClassGroup = MotionController)
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