A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
VRGripInterface.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#include "CoreMinimal.h"
5#include "UObject/ObjectMacros.h"
6#include "UObject/ScriptMacros.h"
7#include "VRBPDatatypes.h"
9#include "UObject/Interface.h"
10
11#include "VRGripInterface.generated.h"
12
13// Forward declare
15
16UINTERFACE(Blueprintable)
17class VREXPANSIONPLUGIN_API UVRGripInterface: public UInterface
18{
19 GENERATED_UINTERFACE_BODY()
20};
21
24DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FVROnGripSignature, UGripMotionControllerComponent *, GrippingController, const FBPActorGripInformation&, GripInformation);
25
27DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FVROnDropSignature, UGripMotionControllerComponent*, GrippingController, const FBPActorGripInformation&, GripInformation, bool, bWasSocketed);
28
29class VREXPANSIONPLUGIN_API IVRGripInterface
31 GENERATED_IINTERFACE_BODY()
33public:
35 // Set up as deny instead of allow so that default allows for gripping
36 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface", meta = (DisplayName = "IsDenyingGrips"))
37 bool DenyGripping(UGripMotionControllerComponent * GripInitiator = nullptr);
38
39 // How an interfaced object behaves when teleporting
40 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
41 EGripInterfaceTeleportBehavior TeleportBehavior();
42
43 // Should this object simulate on drop
44 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
45 bool SimulateOnDrop();
46
47 // Grip type to use
48 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
49 EGripCollisionType GetPrimaryGripType(bool bIsSlot);
50
51 // Double Grip Type
52 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
53 ESecondaryGripType SecondaryGripType();
54
55 // Define the late update setting
56 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
57 EGripLateUpdateSettings GripLateUpdateSetting();
58
59 // Define which movement repliation setting to use
60 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
61 EGripMovementReplicationSettings GripMovementReplicationType();
62
63 // What grip stiffness and damping to use if using a physics constraint
64 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
65 void GetGripStiffnessAndDamping(float &GripStiffnessOut, float &GripDampingOut);
66
67 // Get the advanced physics settings for this grip
68 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
69 FBPAdvGripSettings AdvancedGripSettings();
70
71 // What distance to break a grip at (only relevent with physics enabled grips
72 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
73 float GripBreakDistance();
74
82 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
83 void ClosestGripSlotInRange(FVector WorldLocation, bool bSecondarySlot, bool & bHadSlotInRange, FTransform & SlotWorldTransform, FName & SlotName, UGripMotionControllerComponent * CallingController = nullptr, FName OverridePrefix = NAME_None);
85 // Events that can be called for interface inheriting actors
86
87 // Event triggered each tick on the interfaced object when gripped, can be used for custom movement or grip based logic
88 UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
89 void TickGrip(UGripMotionControllerComponent * GrippingController, const FBPActorGripInformation & GripInformation, float DeltaTime);
90
91 // Event triggered on the interfaced object when gripped
92 UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
93 void OnGrip(UGripMotionControllerComponent * GrippingController, const FBPActorGripInformation & GripInformation);
94
95 // Event triggered on the interfaced object when grip is released
96 UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
97 void OnGripRelease(UGripMotionControllerComponent * ReleasingController, const FBPActorGripInformation & GripInformation, bool bWasSocketed = false);
98
99 virtual void Native_NotifyThrowGripDelegates(UGripMotionControllerComponent* Controller, bool bGripped, const FBPActorGripInformation& GripInformation, bool bWasSocketed = false);
101 // Event triggered on the interfaced object when child component is gripped
102 UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
103 void OnChildGrip(UGripMotionControllerComponent * GrippingController, const FBPActorGripInformation & GripInformation);
104
105 // Event triggered on the interfaced object when child component is released
106 UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
107 void OnChildGripRelease(UGripMotionControllerComponent * ReleasingController, const FBPActorGripInformation & GripInformation, bool bWasSocketed = false);
109 // Event triggered on the interfaced object when secondary gripped
110 UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
111 void OnSecondaryGrip(UGripMotionControllerComponent * GripOwningController, USceneComponent * SecondaryGripComponent, const FBPActorGripInformation & GripInformation);
112
113 // Event triggered on the interfaced object when secondary grip is released
114 UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
115 void OnSecondaryGripRelease(UGripMotionControllerComponent * GripOwningController, USceneComponent * ReleasingSecondaryGripComponent, const FBPActorGripInformation & GripInformation);
117 // Interaction Functions
118
119 // Call to use an object
120 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
121 void OnUsed();
122
123 // Call to stop using an object
124 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
125 void OnEndUsed();
126
127 // Call to use an object
128 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
129 void OnSecondaryUsed();
131 // Call to stop using an object
132 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
133 void OnEndSecondaryUsed();
134
135 // Call to send an action event to the object
136 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
137 void OnInput(FKey Key, EInputEvent KeyEvent);
138
139 // Check if an object allows multiple grips at one time
140 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
141 bool AllowsMultipleGrips();
142
143 // Returns if the object is held and if so, which controllers are holding it
144 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
145 void IsHeld(TArray<FBPGripPair> & HoldingControllers, bool & bIsHeld);
147 // Sets is held, used by the plugin
148 UFUNCTION(BlueprintNativeEvent, /*BlueprintCallable,*/ Category = "VRGripInterface")
149 void SetHeld(UGripMotionControllerComponent * HoldingController, uint8 GripID, bool bIsHeld);
150
151 // Returns if the object requests to be socketed to something
152 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
153 bool RequestsSocketing(USceneComponent *& ParentToSocketTo, FName & OptionalSocketName, FTransform_NetQuantize & RelativeTransform);
154
155 // Get grip scripts
156 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
157 bool GetGripScripts(TArray<UVRGripScriptBase*>& ArrayReference);
158};
EGripMovementReplicationSettings
UENUM(Blueprintable)
ESecondaryGripType
UENUM(Blueprintable)
EGripCollisionType
UENUM(Blueprintable)
EGripLateUpdateSettings
UENUM(Blueprintable)
EGripInterfaceTeleportBehavior
UENUM(Blueprintable)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FVROnGripSignature, UGripMotionControllerComponent *, GrippingController, const FBPActorGripInformation &, GripInformation)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FVROnDropSignature, UGripMotionControllerComponent *, GrippingController, const FBPActorGripInformation &, GripInformation, bool, bWasSocketed)
void OnGripRelease(UGripMotionControllerComponent *ReleasingController, const FBPActorGripInformation &GripInformation, bool bWasSocketed=false)
UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
bool AllowsMultipleGrips()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
ESecondaryGripType SecondaryGripType()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
bool SimulateOnDrop()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void OnUsed()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void OnChildGrip(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation)
UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
void OnEndSecondaryUsed()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void TickGrip(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation, float DeltaTime)
UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
EGripMovementReplicationSettings GripMovementReplicationType()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void OnSecondaryUsed()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
EGripInterfaceTeleportBehavior TeleportBehavior()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void OnSecondaryGripRelease(UGripMotionControllerComponent *GripOwningController, USceneComponent *ReleasingSecondaryGripComponent, const FBPActorGripInformation &GripInformation)
UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
bool RequestsSocketing(USceneComponent *&ParentToSocketTo, FName &OptionalSocketName, FTransform_NetQuantize &RelativeTransform)
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void IsHeld(TArray< FBPGripPair > &HoldingControllers, bool &bIsHeld)
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void OnInput(FKey Key, EInputEvent KeyEvent)
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void GetGripStiffnessAndDamping(float &GripStiffnessOut, float &GripDampingOut)
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
bool GetGripScripts(TArray< UVRGripScriptBase * > &ArrayReference)
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void ClosestGripSlotInRange(FVector WorldLocation, bool bSecondarySlot, bool &bHadSlotInRange, FTransform &SlotWorldTransform, FName &SlotName, UGripMotionControllerComponent *CallingController=nullptr, FName OverridePrefix=NAME_None)
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
bool DenyGripping(UGripMotionControllerComponent *GripInitiator=nullptr)
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface", meta = (DisplayName ...
FBPAdvGripSettings AdvancedGripSettings()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void OnGrip(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation)
UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
EGripLateUpdateSettings GripLateUpdateSetting()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void OnEndUsed()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void OnChildGripRelease(UGripMotionControllerComponent *ReleasingController, const FBPActorGripInformation &GripInformation, bool bWasSocketed=false)
UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
EGripCollisionType GetPrimaryGripType(bool bIsSlot)
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
float GripBreakDistance()
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRGripInterface")
void OnSecondaryGrip(UGripMotionControllerComponent *GripOwningController, USceneComponent *SecondaryGripComponent, const FBPActorGripInformation &GripInformation)
UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
void SetHeld(UGripMotionControllerComponent *HoldingController, uint8 GripID, bool bIsHeld)
UFUNCTION(BlueprintNativeEvent, Category = "VRGripInterface")
UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent), ClassGroup = MotionController)
UINTERFACE(Blueprintable)
UCLASS(NotBlueprintable, BlueprintType, EditInlineNew, DefaultToInstanced, Abstract,...
USTRUCT(BlueprintType, Category = "VRExpansionLibrary")
USTRUCT(BlueprintType, Category = "VRExpansionLibrary")
USTRUCT(BlueprintType, Category = "VRExpansionLibrary")
USTRUCT(BlueprintType, Category = "VRExpansionLibrary|TransformNetQuantize", meta = (HasNativeMake = ...