48 virtual void ObjectActivated_Implementation()
override;
52 virtual void ObjectDeactivated_Implementation()
override;
56 virtual void UpdateObjectHighlight_Implementation(
bool Activate)
override;
61 virtual void OnGrip_Implementation(UGripMotionControllerComponent* GrippingController,
62 const FBPActorGripInformation& GripInformation)
override;
66 virtual void OnGripRelease_Implementation(UGripMotionControllerComponent* ReleasingController,
67 const FBPActorGripInformation& GripInformation,
68 bool bWasSocketed)
override;
72 virtual void OnSecondaryGrip_Implementation(UGripMotionControllerComponent* GripOwningController,
74 const FBPActorGripInformation& GripInformation)
override;
78 virtual void OnSecondaryGripRelease_Implementation(UGripMotionControllerComponent* GripOwningController,
80 const FBPActorGripInformation& GripInformation)
override;
84 virtual void IsHeld_Implementation(TArray<FBPGripPair>& HoldingControllers,
bool& bIsHeld)
override;
88 virtual void SetHeld_Implementation(UGripMotionControllerComponent* HoldingController, uint8 GripID,
89 bool bIsHeld)
override;
94 virtual bool DenyGripping_Implementation(UGripMotionControllerComponent* GripInitiator =
nullptr)
override;
98 virtual EGripInterfaceTeleportBehavior TeleportBehavior_Implementation()
override;
102 virtual bool SimulateOnDrop_Implementation()
override;
106 virtual EGripCollisionType GetPrimaryGripType_Implementation(
bool bIsSlot)
override;
110 virtual ESecondaryGripType SecondaryGripType_Implementation()
override;
114 virtual EGripMovementReplicationSettings GripMovementReplicationType_Implementation()
override;
118 virtual EGripLateUpdateSettings GripLateUpdateSetting_Implementation()
override;
122 virtual void GetGripStiffnessAndDamping_Implementation(
float& GripStiffnessOut,
float& GripDampingOut)
override;
126 virtual FBPAdvGripSettings AdvancedGripSettings_Implementation()
override;
130 virtual float GripBreakDistance_Implementation()
override;
134 virtual void ClosestGripSlotInRange_Implementation(FVector WorldLocation,
bool bSecondarySlot,
135 bool& bHadSlotInRange, FTransform& SlotWorldTransform,
137 UGripMotionControllerComponent* CallingController =
nullptr,
138 FName OverridePrefix = NAME_None)
override;
142 virtual bool AllowsMultipleGrips_Implementation()
override;
147 virtual bool IsGrabbingWrongActorActive_Implementation()
override;
152 virtual void SendWrongGrabbingNotification_Implementation()
override;
157 virtual FTransform GetObjectGrabTransform_Implementation(
APixoVRHand* GrabbedHand)
override;
159 UPROPERTY(BlueprintAssignable, Category =
"Grip Events")
160 FVROnGripSignature OnGripped;
161 UPROPERTY(BlueprintAssignable, Category = "Grip Events")
162 FVROnDropSignature OnDropped;
164 UPROPERTY(BlueprintAssignable, Category = "Grip Events")
165 FVROnGripSignature OnSecondaryGripAdded;
167 UPROPERTY(BlueprintAssignable, Category = "Grip Events")
168 FVROnGripSignature OnSecondaryGripRemoved;
170 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
171 FBPInterfaceProperties VRGripInterfaceSettings;
178 UFUNCTION(BlueprintImplementableEvent, Category = "Grip Events")
179 void OnGrippedEvent(UGripMotionControllerComponent* GrippingController,
180 const FBPActorGripInformation& GripInformation);
187 UFUNCTION(BlueprintImplementableEvent, Category = "Grip Events")
188 void OnReleasedEvent(UGripMotionControllerComponent* ReleasingController,
189 const FBPActorGripInformation& GripInformation,
bool bWasSocketed);
196 UFUNCTION(BlueprintCallable, Category = "GrippableObject")
203 UFUNCTION(BlueprintCallable, Category = "GrippableObject")
204 void AttachToHandObject(UGripMotionControllerComponent* GrippingController,
205 const FBPActorGripInformation& GripInformation);
209 UFUNCTION(BlueprintCallable, Category = "GrippableObject")
210 void DetachObjectFromHand();
215 virtual
void GrabWithTwoHands_Implementation(UMotionControllerComponent* GrabbingController) override;
216 virtual
void ReleaseTwoHands_Implementation(UMotionControllerComponent* ReleasingController) override;
217 virtual
bool IsObjectHeldWithTwoHands_Implementation() override;
218 virtual
void ResetTwoHandsHoldingFunctionality_Implementation() override;
219 virtual
void EnableOnePressDetach_Implementation(
bool Enable) override;
221 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Two Hands Grip")
222 bool ObjectHeldWithTwoHands = false;
224 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "GrippableObject")
226 UPROPERTY(VisibleInstanceOnly, BlueprintReadWrite, Category = "GrippableObject")
228 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GrippableObject")
229 FTransform ObjectTransformInLeftHand;
230 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GrippableObject")
231 FTransform ObjectTransformInRightHand;
233 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
234 UStaticMeshComponent* StaticMeshComponent;
236 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Feedback Effect")
237 bool bGripSoundsEnabled;
239 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Feedback Effect", meta = (EditCondition = "bGripSoundsEnabled", EditConditionHides))
240 USoundCue* GripSoundCue;
242 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Feedback Effect")
243 bool bReleaseSoundsEnabled;
245 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Feedback Effect", meta = (EditCondition = "bReleaseSoundsEnabled", EditConditionHides))
246 USoundCue* ReleaseSoundCue;
248 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Feedback Effect")
249 bool bFeedbackEnabled;
251 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Feedback Effect", meta=(EditCondition = "bFeedbackEnabled", EditConditionHides))
252 float HapticDuration;
254 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Feedback Effect", meta=(EditCondition = "bFeedbackEnabled", EditConditionHides))
255 float HapticStrength;
257 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GrippableObject")
258 bool StoryActivationAffectsDenyGripping {
true };
260 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"GrippableObject")
261 bool bActivateLocationResetAfterDrop {
false };
263 UPROPERTY(BlueprintReadWrite, Category =
"GrippableObject")
264 bool bCanResetPosition {
true };
266 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category =
"GrippableObject")
267 bool bDestroyActorAfterFailedDrop {
false };
269 UPROPERTY(BlueprintReadOnly, Category =
"GrippableObject")
270 FTransform ResetTransform;
272 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GrippableObject")
273 float PositionResetCheckRate { 0.1f };
275 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"GrippableObject")
276 float PositionResetMaximumDelay { 5.0f };
278 UPROPERTY(BlueprintReadWrite, BlueprintCallable, BlueprintAssignable)
279 FOnActorStopped OnActorStoppedDelegate;
281 UPROPERTY(BlueprintReadWrite, BlueprintCallable, BlueprintAssignable)
282 FOnActorStopped OnActorPositionResetDelegate;
284 UPROPERTY(BlueprintReadWrite, BlueprintCallable, BlueprintAssignable)
285 FOnDroppedActorDeleted OnDroppedActorDeleted;
290 UFUNCTION(BlueprintCallable, Category = "GrippableObject")
291 void ResetPosition();
296 UFUNCTION(BlueprintCallable, Category = "GrippableObject")
297 void StartPositionResetTimer();
302 UFUNCTION(BlueprintCallable, Category = "GrippableObject")
303 void StopPositionResetTimer();
309 void CheckPositionResetConditions();
313 bool bSaveResetTransformOnGrip {
true };
315 float TimeSinceResetTimerStarted { 0.0f };
317 FTimerHandle PositionResetTimer;
323 void PlayHapticFeedbackEffect(UGripMotionControllerComponent* GripMotionControllerComponent)
const;
325 void PlayGripSound()
const;
327 void PlayReleaseSound()
const;
330 void HandCrossDetection(
float CurrentPitch,
float RightLeftHandVPitch);
333 float PitchBeforeCross = 0;
334 float MoveBackPitchDelta = 0;
335 float ResultedPitch = 0;
336 TWeakObjectPtr<APixoVRHand> PixoVRHandLeft;
337 TWeakObjectPtr<APixoVRHand> PixoVRHandRight;
338 float TwoHandZAxisValue = 0.0;
339 FTimerHandle TwoHandTimer;
340 TWeakObjectPtr<UMotionControllerComponent> TwoHandMainGrabController;