Unreal SDK  v1.3.0
Loading...
Searching...
No Matches
WeArtHapticController.h
Go to the documentation of this file.
1
2#pragma once
3
4#include "CoreMinimal.h"
5#include "WeArtController.h"
7#include "WeArtHapticObject.h"
8#include "Components/ActorComponent.h"
11
18UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
19class WEARTPLUGIN_API UWeArtHapticController : public UActorComponent
20{
21 GENERATED_BODY()
22
23 int32 SurfaceExplorationHits = 1;
24
25public:
26 // Sets default values for this component's properties
28
29protected:
30 // Called when the game starts
31 virtual void BeginPlay() override;
33 void SetFingerForce(UWeArtHapticObject* HapticObject, UWeArtTouchEffect* TouchEffect, WeArtFingerType FingerType, FVector LastLoc, float
34 LastTime, UWeArtTouchableObject* ExploredTouchableObject = nullptr);
35 void ApplyFingerEffect(UWeArtTouchableObject* ContactObject, UWeArtTouchableObject* OverlapObject, UWeArtHapticObject* HapticObject, FVector
36 LastPos, float LastTime, WeArtFingerType FingerType);
37
38 bool HitObjectFromFinger(const FString& TraceSocket, const UWeArtTouchableObject* FingerObject) const;
39 bool IsEnoughHitForExploration() const;
41 void ApplySurfaceExplorationFingerEffect(UWeArtHapticObject* UWeArtHapticObject, UWeArtTouchableObject* OverlapObj, const FString& TraceSocket, const FVector&
42 LastPosition, float LastTime, WeArtFingerType FingerType);
43
45 UPROPERTY(EditAnywhere, BlueprintReadOnly)
46 float SurfaceExplorationLineLength = 1.f;
48 UWeArtTouchEffect* ThumbGraspEffect = nullptr;
50 UWeArtTouchEffect* IndexGraspEffect = nullptr;
52 UWeArtTouchEffect* MiddleGraspEffect = nullptr;
54 UWeArtHandController* HandController;
56 UWeArtPhysicHandler* PhysicHandler;
58 float DynamicForceByDistance = 0;
60 FVector LastIndexPosition;
62 float LastIndexTime;
63
65 void UpdateEffects();
67 void ApplyTextureVelocity(UWeArtTouchEffect* TouchEffect, UWeArtTouchableObject* TouchableObject, FVector LastLoc, float LastTime) const;
68public:
69 // Called every frame
70 virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
71
72
73};
#define WEARTPLUGIN_API
Definition: Definitions.WEARTPlugin.h:26
WeArtFingerType
Definition: WeArtFingerType.h:4
Controls hand interactions and haptic feedback.
Controls haptic feedback for the controller.
Handles the physics interactions between physical and phantom hands.
Effect to be applied to the thimble.
Definition: WeArtTouchEffect.h:30