7#include "Kismet/GameplayStatics.h"
68 if (FMath::IsNearlyEqual(GetVelocity().Size(), 0.0f))
82 Super::ObjectActivated_Implementation();
88 Super::ObjectDeactivated_Implementation();
89 if (IPixoVRStoryObject::Execute_CouldBeGrabbedByOtherHand(
this))
106 OnGripped.Broadcast(GrippingController, GripInformation);
118 OnGripped.Broadcast(GrippingController, GripInformation);
121 OnGripped.Broadcast(GrippingController, GripInformation);
143 OnDropped.Broadcast(ReleasingController, GripInformation, bWasSocketed);
226 if (OverridePrefix.IsNone())
227 bSecondarySlot ? OverridePrefix =
"VRGripS" : OverridePrefix =
"VRGripP";
268 DisableComponentsSimulatePhysics();
281 OnGripped.Broadcast(GrippingController, GripInformation);
286 FDetachmentTransformRules DetachmentTransformRules(EDetachmentRule::KeepWorld,
false);
287 DetachFromActor(DetachmentTransformRules);
288 if (IVRGripInterface::Execute_SimulateOnDrop(
this))
292 if (UPrimitiveComponent* PrimComp = Cast<UPrimitiveComponent>(Component))
294 PrimComp->SetSimulatePhysics(
true);
319 APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0);
321 if (PixoVRPlayerController)
323 EControllerHand Hand;
EHandGripLogic
Enum representing the different hand grip logic options.
@ AttachToHandWithCustomTransform
EGripMovementReplicationSettings
UENUM(Blueprintable)
@ ForceClientSideMovement
ESecondaryGripType
UENUM(Blueprintable)
EGripCollisionType
UENUM(Blueprintable)
@ InteractiveCollisionWithPhysics
EGripLateUpdateSettings
UENUM(Blueprintable)
@ NotWhenCollidingOrDoubleGripping
EGripInterfaceTeleportBehavior
UENUM(Blueprintable)
void StopVelocityCheckTimer()
Stopping the current velocity check timer.
FTimerHandle VelocityCheckTimer
Internal timer for checking object's velocity in a given time.
virtual void OnGripRelease_Implementation(UGripMotionControllerComponent *ReleasingController, const FBPActorGripInformation &GripInformation, bool bWasSocketed) override
Implementation of the OnGripRelease function from the IVRGripInterface interface. Event triggered on ...
void PlayHapticFeedbackEffect(UGripMotionControllerComponent *GripMotionControllerComponent) const
Plays haptic feedback on specific controller.
virtual EGripMovementReplicationSettings GripMovementReplicationType_Implementation() override
Implementation of the GripMovementReplicationType function from the IVRGripInterface interface....
virtual void GetGripStiffnessAndDamping_Implementation(float &GripStiffnessOut, float &GripDampingOut) override
Implementation of the GetGripStiffnessAndDamping function from the IVRGripInterface interface....
float HapticStrength
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Feedback Effect", meta=(EditCondition = "bFee...
void UpdateHandGripLogic(EHandGripLogic NewHandGripLogic)
Updates the hand grip logic.
FVROnGripSignature OnSecondaryGripAdded
UPROPERTY(BlueprintAssignable, Category = "Grip Events")
virtual void ClosestGripSlotInRange_Implementation(FVector WorldLocation, bool bSecondarySlot, bool &bHadSlotInRange, FTransform &SlotWorldTransform, FName &SlotName, UGripMotionControllerComponent *CallingController=nullptr, FName OverridePrefix=NAME_None) override
Implementation of the ClosestGripSlotInRange function from the IVRGripInterface interface....
void AttachToHandObject(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation)
Attaches the object to a hand.
FTransform ResetTransform
UPROPERTY(BlueprintReadOnly, Category = "GrippableObject")
virtual ESecondaryGripType SecondaryGripType_Implementation() override
Implementation of the SecondaryGripType function from the IVRGripInterface interface....
bool bSaveResetTransformOnGrip
Flag for preventing this objet from saving ResetTransform.
virtual void OnSecondaryGripRelease_Implementation(UGripMotionControllerComponent *GripOwningController, USceneComponent *ReleasingSecondaryGripComponent, const FBPActorGripInformation &GripInformation) override
Implementation of the OnSecondaryGripRelease function from the IVRGripInterface interface....
EHandGripLogic HandGripLogic
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "GrippableObject")
void DetachObjectFromHand()
Detaches the object from the hand.
FTransform ObjectTransformInRightHand
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GrippableObject")
FVROnGripSignature OnSecondaryGripRemoved
UPROPERTY(BlueprintAssignable, Category = "Grip Events")
float HapticDuration
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Feedback Effect", meta=(EditCondition = "bFee...
FVROnDropSignature OnDropped
UPROPERTY(BlueprintAssignable, Category = "Grip Events")
virtual void SetHeld_Implementation(UGripMotionControllerComponent *HoldingController, uint8 GripID, bool bIsHeld) override
Implementation of the SetHeld function from the IVRGripInterface interface. Sets is held,...
virtual EGripInterfaceTeleportBehavior TeleportBehavior_Implementation() override
Implementation of the TeleportBehavior function from the IVRGripInterface interface....
virtual float GripBreakDistance_Implementation() override
Implementation of the GripBreakDistance function from the IVRGripInterface interface....
virtual void IsHeld_Implementation(TArray< FBPGripPair > &HoldingControllers, bool &bIsHeld) override
Implementation of the IsHeld function from the IVRGripInterface interface. Returns if the object is h...
UStaticMeshComponent * StaticMeshComponent
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
FVROnGripSignature OnGripped
UPROPERTY(BlueprintAssignable, Category = "Grip Events")
virtual EGripLateUpdateSettings GripLateUpdateSetting_Implementation() override
Implementation of the GripLateUpdateSetting function from the IVRGripInterface interface....
bool bDisablePhysicsOnCustomTransformAttach
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "GrippableObject", meta=(EditCondition = "...
void OnGrippedEvent(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation)
Event triggered when the object is gripped.
bool bActivateLocationResetAfterDrop
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "GrippableObject")
virtual void OnSecondaryGrip_Implementation(UGripMotionControllerComponent *GripOwningController, USceneComponent *SecondaryGripComponent, const FBPActorGripInformation &GripInformation) override
Implementation of the OnSecondaryGrip function from the IVRGripInterface interface....
float VelocityCheckRate
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GrippableObject")
virtual bool DenyGripping_Implementation(UGripMotionControllerComponent *GripInitiator=nullptr) override
Implementation of the DenyGripping function from the IVRGripInterface interface. Set up as deny inste...
APixoVRHand * CurrentHoldingHand
UPROPERTY(VisibleInstanceOnly, BlueprintReadWrite, Category = "GrippableObject")
ABaseGrippableStoryActor()
virtual void UpdateObjectHighlight_Implementation(bool Activate) override
Implementation of the UpdateObjectHighlight function from the IPixoVRStoryObject interface.
void ResetPosition()
Resetting object to the position it has ben grabbed off.
bool bCanResetPosition
UPROPERTY(BlueprintReadWrite, Category = "GrippableObject")
virtual bool SimulateOnDrop_Implementation() override
Implementation of the SimulateOnDrop function from the IVRGripInterface interface....
virtual void ObjectActivated_Implementation() override
Implementation of the ObjectActivated function from the IPixoVRStoryObject interface.
void CheckVelocity()
Checking if this object has stopped.
FBPInterfaceProperties VRGripInterfaceSettings
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
void StartVelocityCheckTimer()
Stopping new velocity check timer.
FOnActorStopped OnActorStoppedDelegate
UPROPERTY(BlueprintReadWrite, BlueprintCallable, BlueprintAssignable)
FOnActorStopped OnActorPositionResetDelegate
UPROPERTY(BlueprintReadWrite, BlueprintCallable, BlueprintAssignable)
FTransform ObjectTransformInLeftHand
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GrippableObject")
virtual void OnGrip_Implementation(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation) override
Implementation of the OnGrip function from the IVRGripInterface interface. Event triggered on the int...
bool bFeedbackEnabled
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Feedback Effect")
virtual FBPAdvGripSettings AdvancedGripSettings_Implementation() override
Implementation of the AdvancedGripSettings function from the IVRGripInterface interface....
void OnReleasedEvent(UGripMotionControllerComponent *ReleasingController, const FBPActorGripInformation &GripInformation, bool bWasSocketed)
Event triggered when the object is released from the grip.
virtual void BeginPlay() override
virtual EGripCollisionType GetPrimaryGripType_Implementation(bool bIsSlot) override
Implementation of the GetPrimaryGripType function from the IVRGripInterface interface....
virtual bool AllowsMultipleGrips_Implementation() override
Implementation of the AllowsMultipleGrips function from the IVRGripInterface interface....
virtual void ObjectDeactivated_Implementation() override
Implementation of the ObjectDeactivated function from the IPixoVRStoryObject interface.
UHighlightComponent * HighlightComponent
UPROPERTY(EditAnywhere, BlueprintReadWrite)
UGripMotionControllerComponent * MotionController
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
EControllerHand HandMotionSource
UPROPERTY(BlueprintReadWrite, Category = "Init", meta = (ExposeOnSpawn = "true"))
A custom player controller class for PixoVR.
void PlayHapticFeedback(bool RightHand, float Duration, float Strength)
UFUNCTION(BlueprintCallable, Category = "Haptic")
UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent), ClassGroup = MotionController)
void GetHandType(EControllerHand &Hand)
UFUNCTION(BlueprintPure, Category = "VRExpansionFunctions", meta = (bIgnoreSelf = "true",...
FTimerHandle PulseHighlightTimerHandle
UPROPERTY(BlueprintReadWrite)
void UpdateHighlightValue(EHighlightColor HighlightColor)
Updates the highlight color of the object.
static void GetGripSlotInRangeByTypeName(FName SlotType, AActor *Actor, FVector WorldLocation, float MaxRange, bool &bHadSlotInRange, FTransform &SlotWorldTransform, FName &SlotName, UGripMotionControllerComponent *QueryController=nullptr)
UFUNCTION(BlueprintPure, Category = "VRGrip", meta = (bIgnoreSelf = "true", DisplayName = "GetGripSlo...
USTRUCT(BlueprintType, Category = "VRExpansionLibrary")
USTRUCT(BlueprintType, Category = "VRExpansionLibrary")
ESecondaryGripType SecondaryGripType
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
bool bDenyGripping
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
EGripCollisionType FreeDefaultGripType
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
float ConstraintBreakDistance
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
bool bAllowMultipleGrips
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
float SecondarySlotRange
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
EGripLateUpdateSettings LateUpdateSetting
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
EGripCollisionType SlotDefaultGripType
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
EGripInterfaceTeleportBehavior OnTeleportBehavior
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
float ConstraintStiffness
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
float PrimarySlotRange
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
bool bIsHeld
UPROPERTY(BlueprintReadWrite, NotReplicated, Category = "VRGripInterface")
TArray< FBPGripPair > HoldingControllers
UPROPERTY(BlueprintReadWrite, NotReplicated, Category = "VRGripInterface")
float ConstraintDamping
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
FBPAdvGripSettings AdvancedGripSettings
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface|AdvancedGripSettings")
EGripMovementReplicationSettings MovementReplicationType
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
bool bSimulateOnDrop
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")