Unreal SDK  v1.1
Loading...
Searching...
No Matches
WeArtHandController.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Components/ActorComponent.h"
8#include "WeArtHapticObject.h"
10#include "WeArtGraspEvents.h"
11#include "WeArtHandController.generated.h"
12
13UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
14class WEARTPLUGIN_API UWeArtHandController : public UActorComponent
15{
16 GENERATED_BODY()
17
18public:
19 // Sets default values for this component's properties
20 UWeArtHandController();
21
22 UPROPERTY(EditAnywhere)
23 bool IsHandGrabInvisible = true;
24
25 UPROPERTY(BlueprintReadWrite)
26 TEnumAsByte<HandSide> handSide;
27
28 UFUNCTION(BlueprintCallable, Category = "WEART HandController")
29 void SetIsHandGrabInvisible(bool value);
30
31 UFUNCTION(BlueprintCallable, Category = "WEART HandController")
32 bool GetIsHandGrabInvisible();
33
34protected:
35 // Called when the game starts
36 virtual void BeginPlay() override;
37
38 UFUNCTION(BlueprintCallable)
39 void Init(UWeArtThimbleTrackingObject* thumbTracking, UWeArtThimbleTrackingObject* indexTracking, UWeArtThimbleTrackingObject* middleTracking,
40 UWeArtHapticObject* thumbHaptic, UWeArtHapticObject* indexHaptic, UWeArtHapticObject* middleHaptic);
41
42 // Overlap handlers. Unity's equivalent of "StayOverlapped" is handled by the tick event.
43 // Hit events are not currently handled at all, being more specific than their Unity counterparts
44 // and not really suitable for our use.
45 UFUNCTION()
46 void BeginOverlap(AActor* MyOverlappedActor, AActor* OtherActor);
47 UFUNCTION()
48 void EndOverlap(AActor* MyOverlappedActor, AActor* OtherActor);
49
50 void CheckHandClosingState(void);
51 void HandleGraspingState(void);
52
53 UWeArtThimbleTrackingObject* thumbTrackingObject;
54 UWeArtThimbleTrackingObject* indexTrackingObject;
55 UWeArtThimbleTrackingObject* middleTrackingObject;
56 UWeArtHapticObject* thumbHapticObject;
57 UWeArtHapticObject* indexHapticObject;
58 UWeArtHapticObject* middleHapticObject;
59
60 UWeArtTouchableObject* touchedObjectByThumb;
61 UWeArtTouchableObject* touchedObjectByIndex;
62 UWeArtTouchableObject* touchedObjectByMiddle;
63 UWeArtTouchableObject* touchedObject;
64
66 GraspingState graspingState = GraspingState::Released;
67 bool initialized = false;
68
69public:
70 // Called every frame
71 virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
72 AWeArtGraspEvents* weArtGraspEvents;
73 bool foundGraspEvents;
74
75
76};
GraspingState
Definition: WeArtCommon.h:40
@ Released
Definition: WeArtCommon.h:42
HandSide
Definition: WeArtCommon.h:7
HandClosingState
Definition: WeArtCommon.h:32
@ Open
Definition: WeArtCommon.h:33
Definition: WeArtGraspEvents.h:16