Unreal SDK  v1.3.0
Loading...
Searching...
No Matches
WeArtPhysicHandler.h
Go to the documentation of this file.
1
2#pragma once
3
4#include "CoreMinimal.h"
5#include "WeArtController.h"
7
8#include "Components/ActorComponent.h"
10
12
13
18UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
19class WEARTPLUGIN_API UWeArtPhysicHandler : public UActorComponent
20{
21 GENERATED_BODY()
22
23public:
24 // Sets default values for this component's properties
27 UFUNCTION(BlueprintCallable)
28 void UpdatePhysics();
30 UFUNCTION(BlueprintCallable)
31 void UpdatePhysicsWithDelay(float Delay);
33 float GetDistanceBetweenPhysAndPhantomHands();
35 USkeletalMeshComponent* PhysicalHand;
37 USkeletalMeshComponent* PhantomHand;
39 UPhysicsConstraintComponent* ConstraintComponent;
40
41protected:
42 // Called when the game starts
43 virtual void BeginPlay() override;
44
45 TArray<FVector> GetVertices(UStaticMeshComponent* MeshComponent) const;
46
47public:
48 // Called every frame
49 virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
50private:
51
53 UWeArtHandController* WeArtController;
55 void OnCooked();
57 UFUNCTION()
58 void UpdateGrabbedObjectPhysics();
60 void AddSpheresBodies(UBodySetup* BodySetup, FTransform RelativeTransform, FKAggregateGeom AggGeom, int startIndex);
62 void ResetBodies(UBodySetup* bodySetup);
64 void AddBoxBodies(UBodySetup* BodySetup, FTransform RelativeTransform, FKAggregateGeom AggGeom, int startIndex);
66 void AddCapsulesBodies(UBodySetup* BodySetup, FTransform RelativeTransform, FKAggregateGeom AggGeom, int startIndex);
68 void AddConvexBodies(UBodySetup* BodySetup, FTransform RelativeTransform);
70 float PhysicsUpdateTimerInterval = 0.1;
72 bool CanMove = true;
74 const int SpherePrimitiveCount = 30;
76 const int CapsulePrimitiveCount = 3;
77 const FName RootBoneName = "HandRig";
78 const FName ConstraintTag = "HandConstraint";
79 const FName PhantomHandTag = "PhantomHand";
80 const FName PhysicalHandTag = "HandMesh";
81};
#define WEARTPLUGIN_API
Definition: Definitions.WEARTPlugin.h:26
Controls hand interactions and haptic feedback.
Handles the physics interactions between physical and phantom hands.