Unreal SDK  v1.2.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;
40protected:
41 // Called when the game starts
42 virtual void BeginPlay() override;
43
44public:
45 // Called every frame
46 virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
47private:
48
50 UWeArtHandController* WeArtController;
52 void OnCooked();
54 UFUNCTION()
55 void UpdateGrabbedObjectPhysics();
57 void AddSpheresBodies(UBodySetup* BodySetup, FTransform RelativeTransform, UStaticMeshComponent* mesh, int startIndex);
59 void ResetBodies(UBodySetup* bodySetup);
61 void AddBoxBodies(UBodySetup* BodySetup, FTransform RelativeTransform, UStaticMeshComponent* mesh, int startIndex);
63 void AddCapsulesBodies(UBodySetup* BodySetup, FTransform RelativeTransform, UStaticMeshComponent* mesh, int startIndex);
65 void AddConvexBodies(UBodySetup* BodySetup, FTransform RelativeTransform, UStaticMeshComponent* mesh, int startIndex);
67 float PhysicsUpdateTimerInterval = 0.1;
69 bool CanMove = true;
71 const int SpherePrimitiveCount = 30;
73 const int CapsulePrimitiveCount = 3;
74 const FName RootBoneName = "HandRig";
75 const FName ConstraintTag = "HandConstraint";
76 const FName PhantomHandTag = "PhantomHand";
77 const FName PhysicalHandTag = "HandMesh";
78};
#define WEARTPLUGIN_API
Definition: Definitions.WEARTPlugin.h:292
Controls hand interactions and haptic feedback.
Handles the physics interactions between physical and phantom hands.