5#include "Net/UnrealNetwork.h"
9 : Super(ObjectInitializer)
11 this->SetGenerateOverlapEvents(
true);
12 this->PrimaryComponentTick.bStartWithTickEnabled =
false;
13 PrimaryComponentTick.bCanEverTick =
true;
59void UVRDialComponent::GetLifetimeReplicatedProps(TArray< class FLifetimeProperty > & OutLifetimeProps)
const
61 Super::GetLifetimeReplicatedProps(OutLifetimeProps);
73 Super::PreReplication(ChangedPropertyTracker);
117 this->SetComponentTickEnabled(
false);
125 this->SetComponentTickEnabled(
false);
133 float DeltaRot = 0.0f;
138 FVector CurInteractorLocation = CurrentRelativeTransform.InverseTransformPosition(GrippingController->
GetPivotLocation());
171 FRotator curRotation = GrippingController->GetComponentRotation();
183 uint8 GripID = GripInformation.
GripID;
199 FTransform ReversedRelativeTransform = FTransform(GripInformation.
RelativeTransform.ToInverseMatrixWithScale());
200 FTransform CurrentTransform = this->GetComponentTransform();
201 FTransform RelativeToGripTransform = ReversedRelativeTransform * CurrentTransform;
216 LastRotation = RelativeToGripTransform.GetRotation().Rotator();
228 float closestAngle = 0.f;
230 float closestValt = 0.f;
234 if (closestValt < closestVal)
237 closestVal = closestValt;
272 this->SetComponentTickEnabled(
true);
275 this->SetComponentTickEnabled(
false);
354 GripStiffnessOut = 0.0f;
355 GripDampingOut = 0.0f;
380 if (OverridePrefix.IsNone())
381 bSecondarySlot ? OverridePrefix =
"VRGripS" : OverridePrefix =
"VRGripP";
393 CurHoldingControllers.Empty();
464 float DeltaRot = DialAngleDelta;
481 CurRotBackEnd = FMath::Clamp(360.0f + DeltaRot, MaxCheckValue, 360.0f);
503 else if (tempCheck < MaxCheckValue)
519 float closestAngle = 0.f;
522 float closestValt = 0.f;
526 if (closestValt < closestVal)
529 closestVal = closestValt;
535 if (!bSkipSettingRot)
550 if (!bSkipSettingRot)
564 if (!bSkipSettingRot)
EGripMovementReplicationSettings
UENUM(Blueprintable)
@ ForceClientSideMovement
@ ForceServerSideMovement
ESecondaryGripType
UENUM(Blueprintable)
EGripCollisionType
UENUM(Blueprintable)
EGripLateUpdateSettings
UENUM(Blueprintable)
EGripInterfaceTeleportBehavior
UENUM(Blueprintable)
UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent), ClassGroup = MotionController)
bool HasGripAuthority(const FBPActorGripInformation &Grip)
FORCEINLINE FVector GetPivotLocation()
FVRGripControllerOnGripOutOfRange OnGripOutOfRange
UPROPERTY(BlueprintAssignable, Category = "GripMotionController")
bool DropObjectByInterface(UObject *ObjectToDrop=nullptr, uint8 GripIDToDrop=0, FVector OptionalAngularVelocity=FVector::ZeroVector, FVector OptionalLinearVelocity=FVector::ZeroVector)
UFUNCTION(BlueprintCallable, Category = "GripMotionController")
UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent), ClassGroup = (VRExpansionPlugin))
void IsHeld_Implementation(TArray< FBPGripPair > &CurHoldingControllers, bool &bCurIsHeld) override
EGripMovementReplicationSettings MovementReplicationSetting
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
float SnapAngleThreshold
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent", meta = (editcondition = "!...
bool SimulateOnDrop_Implementation() override
void AddDialAngle(float DialAngleDelta, bool bCallEvents=false, bool bSkipSettingRot=false)
UFUNCTION(BlueprintCallable, Category = "VRLeverComponent")
void ResetInitialDialLocation()
UFUNCTION(BlueprintCallable, Category = "VRLeverComponent")
float CClockwiseMaximumDialAngle
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent")
void GetGripStiffnessAndDamping_Implementation(float &GripStiffnessOut, float &GripDampingOut) override
virtual void Native_NotifyThrowGripDelegates(UGripMotionControllerComponent *Controller, bool bGripped, const FBPActorGripInformation &GripInformation, bool bWasSocketed=false) override
void CalculateDialProgress()
FVROnGripSignature OnGripped
UPROPERTY(BlueprintAssignable, Category = "Grip Events")
void OnSecondaryGrip_Implementation(UGripMotionControllerComponent *GripOwningController, USceneComponent *SecondaryGripComponent, const FBPActorGripInformation &GripInformation) override
bool bIsHeld
UPROPERTY(BlueprintReadOnly, Category = "VRGripInterface", meta = (ScriptName = "IsCurrentlyHeld"))
void OnEndUsed_Implementation() override
virtual void BeginPlay() override
void TickGrip_Implementation(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation, float DeltaTime) override
void SetHeld_Implementation(UGripMotionControllerComponent *NewHoldingController, uint8 GripID, bool bNewIsHeld) override
bool GetGripScripts_Implementation(TArray< UVRGripScriptBase * > &ArrayReference) override
void SetGripPriority(int NewGripPriority)
UFUNCTION(BlueprintCallable, Category = "GripSettings")
FVROnDropSignature OnDropped
UPROPERTY(BlueprintAssignable, Category = "Grip Events")
void ReceiveDialFinishedLerping()
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "Dial Finished Lerping"))
void OnGrip_Implementation(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation) override
void OnUsed_Implementation() override
bool bDialUseSnapAngleList
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent")
bool bSendDialEventsDuringLerp
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent|Lerping")
FVector InitialInteractorLocation
int GripPriority
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GripSettings")
bool AllowsMultipleGrips_Implementation() override
void OnEndSecondaryUsed_Implementation() override
float ClockwiseMaximumDialAngle
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent")
bool bLerpBackOnRelease
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent|Lerping")
virtual void PreReplication(IRepChangedPropertyTracker &ChangedPropertyTracker) override
void OnChildGrip_Implementation(UGripMotionControllerComponent *GrippingController, const FBPActorGripInformation &GripInformation) override
virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override
TArray< float > DialSnapAngleList
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent", meta = (editcondition = "bD...
bool bRepGameplayTags
UPROPERTY(EditAnywhere, Replicated, BlueprintReadWrite, Category = "VRGripInterface")
bool bUseRollover
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent")
float GripBreakDistance_Implementation() override
EVRInteractibleAxis InteractorRotationAxis
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent", meta = (editcondition = "bD...
EVRInteractibleAxis DialRotationAxis
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent")
float SnapAngleIncrement
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent", meta = (editcondition = "!...
bool bDialUsesAngleSnap
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent")
void OnSecondaryUsed_Implementation() override
ESecondaryGripType SecondaryGripType_Implementation() override
EGripCollisionType GetPrimaryGripType_Implementation(bool bIsSlot) override
virtual void OnRegister() override
EGripLateUpdateSettings GripLateUpdateSetting_Implementation() override
void OnSecondaryGripRelease_Implementation(UGripMotionControllerComponent *GripOwningController, USceneComponent *ReleasingSecondaryGripComponent, const FBPActorGripInformation &GripInformation) override
bool bReplicateMovement
UPROPERTY(EditAnywhere, Replicated, BlueprintReadWrite, Category = "VRGripInterface|Replication")
FGameplayTagContainer GameplayTags
UPROPERTY(EditAnywhere, Replicated, BlueprintReadWrite, Category = "GameplayTags")
void ReceiveDialHitSnapAngle(float DialMilestoneAngle)
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "Dial Hit Snap Angle"))
FBPAdvGripSettings AdvancedGripSettings_Implementation() override
FTransform_NetQuantize InitialRelativeTransform
UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_InitialRelativeTransform, Category = "VRDialComp...
bool DenyGripping_Implementation(UGripMotionControllerComponent *GripInitiator=nullptr) override
void OnInput_Implementation(FKey Key, EInputEvent KeyEvent) override
UVRDialComponent(const FObjectInitializer &ObjectInitializer)
EGripInterfaceTeleportBehavior TeleportBehavior_Implementation() override
bool bDialUseDirectHandRotation
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent")
FVRDialStateChangedSignature OnDialHitSnapAngle
UPROPERTY(BlueprintAssignable, Category = "VRDialComponent")
FVRDialFinishedLerpingSignature OnDialFinishedLerping
UPROPERTY(BlueprintAssignable, Category = "VRDialComponent|Lerping")
void OnGripRelease_Implementation(UGripMotionControllerComponent *ReleasingController, const FBPActorGripInformation &GripInformation, bool bWasSocketed=false) override
FVector InitialDropLocation
float RotationScaler
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent", meta = (ClampMin = "0....
bool bIsLerping
UPROPERTY(BlueprintReadOnly, Category = "VRDialComponent|Lerping")
float BreakDistance
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
void ClosestGripSlotInRange_Implementation(FVector WorldLocation, bool bSecondarySlot, bool &bHadSlotInRange, FTransform &SlotWorldTransform, FName &SlotName, UGripMotionControllerComponent *CallingController=nullptr, FName OverridePrefix=NAME_None) override
float SecondarySlotRange
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GripSettings")
void SetDialAngle(float DialAngle, bool bCallEvents=false)
UFUNCTION(BlueprintCallable, Category = "VRLeverComponent")
float PrimarySlotRange
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GripSettings")
bool bDenyGripping
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface", meta = (ScriptName = "IsDen...
EGripMovementReplicationSettings GripMovementReplicationType_Implementation() override
bool RequestsSocketing_Implementation(USceneComponent *&ParentToSocketTo, FName &OptionalSocketName, FTransform_NetQuantize &RelativeTransform) override
FBPGripPair HoldingGrip
UPROPERTY(BlueprintReadOnly, Category = "VRGripInterface")
bool bOriginalReplicatesMovement
float CurrentDialAngle
UPROPERTY(BlueprintReadOnly, Category = "VRDialComponent")
float DialReturnSpeed
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRDialComponent|Lerping")
void OnChildGripRelease_Implementation(UGripMotionControllerComponent *ReleasingController, const FBPActorGripInformation &GripInformation, bool bWasSocketed=false) override
static void GetGripSlotInRangeByTypeName_Component(FName SlotType, USceneComponent *Component, FVector WorldLocation, float MaxRange, bool &bHadSlotInRange, FTransform &SlotWorldTransform, FName &SlotName, UGripMotionControllerComponent *QueryController=nullptr)
UFUNCTION(BlueprintPure, Category = "VRGrip", meta = (bIgnoreSelf = "true", DisplayName = "GetGripSlo...
static float GetDeltaAngleFromTransforms(EVRInteractibleAxis RotAxis, FTransform &InitialRelativeTransform, FTransform &CurrentRelativeTransform)
static float GetAxisValue(EVRInteractibleAxis RotAxis, FRotator CheckRotation)
static FRotator SetAxisValueRot(EVRInteractibleAxis RotAxis, float SetValue)
static float GetAtan2Angle(EVRInteractibleAxis AxisToCalc, FVector CurInteractorLocation, float OptionalInitialRotation=0.0f)
static FTransform Interactible_GetCurrentParentTransform(USceneComponent *SceneComponentToCheck)
UFUNCTION(BlueprintPure, Category = "VRInteractibleFunctions", meta = (bIgnoreSelf = "true"))
USTRUCT(BlueprintType, Category = "VRExpansionLibrary")
USTRUCT(BlueprintType, Category = "VRExpansionLibrary")
uint8 GripID
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GripPair")