A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
VRDialComponent.cpp
Go to the documentation of this file.
1// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
2
5#include "Net/UnrealNetwork.h"
6
7 //=============================================================================
8UVRDialComponent::UVRDialComponent(const FObjectInitializer& ObjectInitializer)
9 : Super(ObjectInitializer)
10{
11 this->SetGenerateOverlapEvents(true);
12 this->PrimaryComponentTick.bStartWithTickEnabled = false;
13 PrimaryComponentTick.bCanEverTick = true;
14
15 bRepGameplayTags = false;
16
17 // Defaulting these true so that they work by default in networked environments
18 bReplicateMovement = true;
19
22
23 bDialUsesAngleSnap = false;
25 SnapAngleThreshold = 45.0f;
26 SnapAngleIncrement = 45.0f;
27 LastSnapAngle = 0.0f;
28 RotationScaler = 1.0f;
29
32 bDenyGripping = false;
33
34 PrimarySlotRange = 100.f;
35 SecondarySlotRange = 100.f;
36 GripPriority = 1;
37
39 BreakDistance = 100.0f;
40
41 bLerpBackOnRelease = false;
43 DialReturnSpeed = 90.0f;
44 bIsLerping = false;
45
47 LastGripRot = 0.0f;
48 InitialGripRot = 0.f;
50 bUseRollover = false;
51}
52
53//=============================================================================
57
58
59void UVRDialComponent::GetLifetimeReplicatedProps(TArray< class FLifetimeProperty > & OutLifetimeProps) const
60{
61 Super::GetLifetimeReplicatedProps(OutLifetimeProps);
62
64 //DOREPLIFETIME_CONDITION(UVRDialComponent, bIsLerping, COND_InitialOnly);
65
66 DOREPLIFETIME(UVRDialComponent, bRepGameplayTags);
68 DOREPLIFETIME_CONDITION(UVRDialComponent, GameplayTags, COND_Custom);
69}
70
71void UVRDialComponent::PreReplication(IRepChangedPropertyTracker & ChangedPropertyTracker)
72{
73 Super::PreReplication(ChangedPropertyTracker);
74
75 // Don't replicate if set to not do it
76 DOREPLIFETIME_ACTIVE_OVERRIDE(UVRDialComponent, GameplayTags, bRepGameplayTags);
77
78 DOREPLIFETIME_ACTIVE_OVERRIDE_PRIVATE_PROPERTY(USceneComponent, RelativeLocation, bReplicateMovement);
79 DOREPLIFETIME_ACTIVE_OVERRIDE_PRIVATE_PROPERTY(USceneComponent, RelativeRotation, bReplicateMovement);
80 DOREPLIFETIME_ACTIVE_OVERRIDE_PRIVATE_PROPERTY(USceneComponent, RelativeScale3D, bReplicateMovement);
81}
82
84{
85 Super::OnRegister();
86 ResetInitialDialLocation(); // Load the original dial location
87}
88
90{
91 // Call the base class
92 Super::BeginPlay();
94
96}
97
98void UVRDialComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
99{
100 if (bIsLerping)
101 {
102 if (bUseRollover)
103 {
104 this->SetDialAngle(FMath::FInterpConstantTo(CurRotBackEnd, 0.f, DeltaTime, DialReturnSpeed), bSendDialEventsDuringLerp);
105 }
106 else
107 {
108 // Flip lerp direction if we are on the other side
110 this->SetDialAngle(FMath::FInterpConstantTo(CurRotBackEnd, 360.f, DeltaTime, DialReturnSpeed), bSendDialEventsDuringLerp);
111 else
112 this->SetDialAngle(FMath::FInterpConstantTo(CurRotBackEnd, 0.f, DeltaTime, DialReturnSpeed), bSendDialEventsDuringLerp);
113 }
114
115 if (CurRotBackEnd == 0.f)
116 {
117 this->SetComponentTickEnabled(false);
118 bIsLerping = false;
119 OnDialFinishedLerping.Broadcast();
121 }
122 }
123 else
124 {
125 this->SetComponentTickEnabled(false);
126 }
127}
128
129void UVRDialComponent::TickGrip_Implementation(UGripMotionControllerComponent * GrippingController, const FBPActorGripInformation & GripInformation, float DeltaTime)
130{
131
132 // #TODO: Should this use a pivot rotation? it wouldn't make that much sense to me?
133 float DeltaRot = 0.0f;
134
136 {
138 FVector CurInteractorLocation = CurrentRelativeTransform.InverseTransformPosition(GrippingController->GetPivotLocation());
139
140 float NewRot = FRotator::ClampAxis(UVRInteractibleFunctionLibrary::GetAtan2Angle(DialRotationAxis, CurInteractorLocation));
141 //DeltaRot = RotationScaler * ( NewRot - LastGripRot);
142
143 DeltaRot = RotationScaler * FMath::FindDeltaAngleDegrees(LastGripRot, NewRot);
144
145 float LimitTest = FRotator::ClampAxis(((NewRot - InitialGripRot) + InitialRotBackEnd));
146 float MaxCheckValue = bUseRollover ? -CClockwiseMaximumDialAngle : 360.0f - CClockwiseMaximumDialAngle;
147
148 if (FMath::IsNearlyZero(CClockwiseMaximumDialAngle))
149 {
151 {
152 DeltaRot = 0.f;
153 }
154 }
155 else if (FMath::IsNearlyZero(ClockwiseMaximumDialAngle))
156 {
157 if (LimitTest < MaxCheckValue && (CurRotBackEnd == MaxCheckValue || CurRotBackEnd == 0.f))
158 {
159 DeltaRot = 0.f;
160 }
161 }
162 else if (LimitTest > ClockwiseMaximumDialAngle && LimitTest < MaxCheckValue && (CurRotBackEnd == ClockwiseMaximumDialAngle || CurRotBackEnd == MaxCheckValue))
163 {
164 DeltaRot = 0.f;
165 }
166
167 LastGripRot = NewRot;
168 }
169 else
170 {
171 FRotator curRotation = GrippingController->GetComponentRotation();
173 LastRotation = curRotation;
174 }
175
176 AddDialAngle(DeltaRot, true);
177
178 // Handle the auto drop
179 if (BreakDistance > 0.f && GrippingController->HasGripAuthority(GripInformation) && FVector::DistSquared(InitialDropLocation, this->GetComponentTransform().InverseTransformPosition(GrippingController->GetPivotLocation())) >= FMath::Square(BreakDistance))
180 {
181 if (GrippingController->OnGripOutOfRange.IsBound())
182 {
183 uint8 GripID = GripInformation.GripID;
184 GrippingController->OnGripOutOfRange.Broadcast(GripInformation, GripInformation.GripDistance);
185 }
186 else
187 {
188 GrippingController->DropObjectByInterface(this, HoldingGrip.GripID);
189 }
190 return;
191 }
192}
193
195{
197
198 // This lets me use the correct original location over the network without changes
199 FTransform ReversedRelativeTransform = FTransform(GripInformation.RelativeTransform.ToInverseMatrixWithScale());
200 FTransform CurrentTransform = this->GetComponentTransform();
201 FTransform RelativeToGripTransform = ReversedRelativeTransform * CurrentTransform;
202
203 //FTransform InitialTrans = RelativeToGripTransform.GetRelativeTransform(CurrentRelativeTransform);
204
205 InitialInteractorLocation = CurrentRelativeTransform.InverseTransformPosition(RelativeToGripTransform.GetTranslation());
206 InitialDropLocation = ReversedRelativeTransform.GetTranslation();
207
209 {
213 }
214 else
215 {
216 LastRotation = RelativeToGripTransform.GetRotation().Rotator(); // Forcing into world space now so that initial can be correct over the network
217 }
218
219 bIsLerping = false;
220
221 //OnGripped.Broadcast(GrippingController, GripInformation);
222}
223
224void UVRDialComponent::OnGripRelease_Implementation(UGripMotionControllerComponent * ReleasingController, const FBPActorGripInformation & GripInformation, bool bWasSocketed)
225{
227 {
228 float closestAngle = 0.f;
229 float closestVal = FMath::Abs(closestAngle - CurRotBackEnd);
230 float closestValt = 0.f;
231 for (float val : DialSnapAngleList)
232 {
233 closestValt = FMath::Abs(val - CurRotBackEnd);
234 if (closestValt < closestVal)
235 {
236 closestAngle = val;
237 closestVal = closestValt;
238 }
239 }
240
241 if (closestAngle != LastSnapAngle)
242 {
243 this->SetRelativeRotation((FTransform(UVRInteractibleFunctionLibrary::SetAxisValueRot(DialRotationAxis, FMath::UnwindDegrees(closestAngle), FRotator::ZeroRotator)) * InitialRelativeTransform).Rotator());
244 CurrentDialAngle = FMath::RoundToFloat(closestAngle);
246
247 if (!FMath::IsNearlyEqual(LastSnapAngle, CurrentDialAngle))
248 {
252 }
253 }
254 }
255 else if (bDialUsesAngleSnap && SnapAngleIncrement > 0.f && FMath::Abs(FMath::Fmod(CurRotBackEnd, SnapAngleIncrement)) <= FMath::Min(SnapAngleIncrement, SnapAngleThreshold))
256 {
257 this->SetRelativeRotation((FTransform(UVRInteractibleFunctionLibrary::SetAxisValueRot(DialRotationAxis, FMath::GridSnap(CurRotBackEnd, SnapAngleIncrement), FRotator::ZeroRotator)) * InitialRelativeTransform).Rotator());
259 CurrentDialAngle = FRotator::ClampAxis(FMath::RoundToFloat(CurRotBackEnd));
260
261 if (!FMath::IsNearlyEqual(LastSnapAngle, CurrentDialAngle))
262 {
266 }
267 }
268
270 {
271 bIsLerping = true;
272 this->SetComponentTickEnabled(true);
273 }
274 else
275 this->SetComponentTickEnabled(false);
276
277 //OnDropped.Broadcast(ReleasingController, GripInformation, bWasSocketed);
278}
279
280void UVRDialComponent::SetGripPriority(int NewGripPriority)
281{
282 GripPriority = NewGripPriority;
283}
284
286void UVRDialComponent::OnChildGripRelease_Implementation(UGripMotionControllerComponent * ReleasingController, const FBPActorGripInformation & GripInformation, bool bWasSocketed) {}
287void UVRDialComponent::OnSecondaryGrip_Implementation(UGripMotionControllerComponent * GripOwningController, USceneComponent * SecondaryGripComponent, const FBPActorGripInformation & GripInformation) {}
288void UVRDialComponent::OnSecondaryGripRelease_Implementation(UGripMotionControllerComponent * GripOwningController, USceneComponent * ReleasingSecondaryGripComponent, const FBPActorGripInformation & GripInformation) {}
293void UVRDialComponent::OnInput_Implementation(FKey Key, EInputEvent KeyEvent) {}
294bool UVRDialComponent::RequestsSocketing_Implementation(USceneComponent *& ParentToSocketTo, FName & OptionalSocketName, FTransform_NetQuantize & RelativeTransform) { return false; }
295
300
305
307{
308 return false;
309}
310
311/*EGripCollisionType UVRDialComponent::SlotGripType_Implementation()
312{
313 return EGripCollisionType::CustomGrip;
314}
315
316EGripCollisionType UVRDialComponent::FreeGripType_Implementation()
317{
318 return EGripCollisionType::CustomGrip;
319}*/
320
325
330
331
336
341
342/*float UVRDialComponent::GripStiffness_Implementation()
343{
344 return 1500.0f;
345}
346
347float UVRDialComponent::GripDamping_Implementation()
348{
349 return 200.0f;
350}*/
351
352void UVRDialComponent::GetGripStiffnessAndDamping_Implementation(float &GripStiffnessOut, float &GripDampingOut)
353{
354 GripStiffnessOut = 0.0f;
355 GripDampingOut = 0.0f;
356}
357
362
367
368/*void UVRDialComponent::ClosestSecondarySlotInRange_Implementation(FVector WorldLocation, bool & bHadSlotInRange, FTransform & SlotWorldTransform, UGripMotionControllerComponent * CallingController, FName OverridePrefix)
369{
370 bHadSlotInRange = false;
371}
372
373void UVRDialComponent::ClosestPrimarySlotInRange_Implementation(FVector WorldLocation, bool & bHadSlotInRange, FTransform & SlotWorldTransform, UGripMotionControllerComponent * CallingController, FName OverridePrefix)
374{
375 bHadSlotInRange = false;
376}*/
377
378void UVRDialComponent::ClosestGripSlotInRange_Implementation(FVector WorldLocation, bool bSecondarySlot, bool & bHadSlotInRange, FTransform & SlotWorldTransform, FName & SlotName, UGripMotionControllerComponent * CallingController, FName OverridePrefix)
379{
380 if (OverridePrefix.IsNone())
381 bSecondarySlot ? OverridePrefix = "VRGripS" : OverridePrefix = "VRGripP";
382
383 UVRExpansionFunctionLibrary::GetGripSlotInRangeByTypeName_Component(OverridePrefix, this, WorldLocation, bSecondarySlot ? SecondarySlotRange : PrimarySlotRange, bHadSlotInRange, SlotWorldTransform, SlotName, CallingController);
384}
385
390
391void UVRDialComponent::IsHeld_Implementation(TArray<FBPGripPair> & CurHoldingControllers, bool & bCurIsHeld)
392{
393 CurHoldingControllers.Empty();
394 if (HoldingGrip.IsValid())
395 {
396 CurHoldingControllers.Add(HoldingGrip);
397 bCurIsHeld = bIsHeld;
398 }
399 else
400 {
401 bCurIsHeld = false;
402 }
403}
404
406{
407 if (bGripped)
408 {
409 OnGripped.Broadcast(Controller, GripInformation);
410 }
411 else
412 {
413 OnDropped.Broadcast(Controller, GripInformation, bWasSocketed);
414 }
415}
416
417void UVRDialComponent::SetHeld_Implementation(UGripMotionControllerComponent * NewHoldingController, uint8 GripID, bool bNewIsHeld)
418{
419 if (bNewIsHeld)
420 {
421 HoldingGrip = FBPGripPair(NewHoldingController, GripID);
423 {
424 if(!bIsHeld)
426 bReplicateMovement = false;
427 }
428 }
429 else
430 {
433 {
435 }
436 }
437
438 bIsHeld = bNewIsHeld;
439}
440
441/*FBPInteractionSettings UVRDialComponent::GetInteractionSettings_Implementation()
442{
443 return FBPInteractionSettings();
444}*/
445
446bool UVRDialComponent::GetGripScripts_Implementation(TArray<UVRGripScriptBase*> & ArrayReference)
447{
448 return false;
449}
450
451void UVRDialComponent::SetDialAngle(float DialAngle, bool bCallEvents)
452{
453 CurRotBackEnd = DialAngle;
454 AddDialAngle(0.0f, bCallEvents);
455}
456
457void UVRDialComponent::AddDialAngle(float DialAngleDelta, bool bCallEvents, bool bSkipSettingRot)
458{
459 //FindDeltaAngleDegrees
461//static float UnwindDegrees(float A)
462 float MaxCheckValue = bUseRollover ? -CClockwiseMaximumDialAngle : 360.0f - CClockwiseMaximumDialAngle;
463
464 float DeltaRot = DialAngleDelta;
465 float tempCheck = bUseRollover ? CurRotBackEnd + DeltaRot : FRotator::ClampAxis(CurRotBackEnd + DeltaRot);
466
467 // Clamp it to the boundaries
468 if (FMath::IsNearlyZero(CClockwiseMaximumDialAngle))
469 {
470 CurRotBackEnd = FMath::Clamp(CurRotBackEnd + DeltaRot, 0.0f, ClockwiseMaximumDialAngle);
471 }
472 else if (FMath::IsNearlyZero(ClockwiseMaximumDialAngle))
473 {
474 if (bUseRollover)
475 {
476 CurRotBackEnd = FMath::Clamp(CurRotBackEnd + DeltaRot, -CClockwiseMaximumDialAngle, 0.0f);
477 }
478 else
479 {
480 if (CurRotBackEnd < MaxCheckValue)
481 CurRotBackEnd = FMath::Clamp(360.0f + DeltaRot, MaxCheckValue, 360.0f);
482 else
483 CurRotBackEnd = FMath::Clamp(CurRotBackEnd + DeltaRot, MaxCheckValue, 360.0f);
484 }
485 }
486 else if(!bUseRollover && tempCheck > ClockwiseMaximumDialAngle && tempCheck < MaxCheckValue)
487 {
488 if (CurRotBackEnd < MaxCheckValue)
489 {
491 }
492 else
493 {
494 CurRotBackEnd = MaxCheckValue;
495 }
496 }
497 else if (bUseRollover)
498 {
499 if (tempCheck > ClockwiseMaximumDialAngle)
500 {
502 }
503 else if (tempCheck < MaxCheckValue)
504 {
505 CurRotBackEnd = MaxCheckValue;
506 }
507 else
508 {
509 CurRotBackEnd = tempCheck;
510 }
511 }
512 else
513 {
514 CurRotBackEnd = tempCheck;
515 }
516
518 {
519 float closestAngle = 0.f;
520 // Always default 0.0f to the list
521 float closestVal = FMath::Abs(closestAngle - CurRotBackEnd);
522 float closestValt = 0.f;
523 for (float val : DialSnapAngleList)
524 {
525 closestValt = FMath::Abs(val - CurRotBackEnd);
526 if (closestValt < closestVal)
527 {
528 closestAngle = val;
529 closestVal = closestValt;
530 }
531 }
532
533 if (closestAngle != LastSnapAngle)
534 {
535 if (!bSkipSettingRot)
536 this->SetRelativeRotation((FTransform(UVRInteractibleFunctionLibrary::SetAxisValueRot(DialRotationAxis, FMath::UnwindDegrees(closestAngle), FRotator::ZeroRotator)) * InitialRelativeTransform).Rotator());
537 CurrentDialAngle = FMath::RoundToFloat(closestAngle);
538
539 if (bCallEvents && !FMath::IsNearlyEqual(LastSnapAngle, CurrentDialAngle))
540 {
543 }
544
546 }
547 }
548 else if (bDialUsesAngleSnap && SnapAngleIncrement > 0.f && FMath::Abs(FMath::Fmod(CurRotBackEnd, SnapAngleIncrement)) <= FMath::Min(SnapAngleIncrement, SnapAngleThreshold))
549 {
550 if (!bSkipSettingRot)
551 this->SetRelativeRotation((FTransform(UVRInteractibleFunctionLibrary::SetAxisValueRot(DialRotationAxis, FMath::UnwindDegrees(FMath::GridSnap(CurRotBackEnd, SnapAngleIncrement)), FRotator::ZeroRotator)) * InitialRelativeTransform).Rotator());
552 CurrentDialAngle = FMath::RoundToFloat(FMath::GridSnap(CurRotBackEnd, SnapAngleIncrement));
553
554 if (bCallEvents && !FMath::IsNearlyEqual(LastSnapAngle, CurrentDialAngle))
555 {
558 }
559
561 }
562 else
563 {
564 if (!bSkipSettingRot)
565 this->SetRelativeRotation((FTransform(UVRInteractibleFunctionLibrary::SetAxisValueRot(DialRotationAxis, FMath::UnwindDegrees(CurRotBackEnd), FRotator::ZeroRotator)) * InitialRelativeTransform).Rotator());
566 CurrentDialAngle = FMath::RoundToFloat(CurRotBackEnd);
567 }
568
569}
570
572{
573 // Get our initial relative transform to our parent (or not if un-parented).
574 InitialRelativeTransform = this->GetRelativeTransform();
575 CurRotBackEnd = 0.0f;
577}
578
580{
581 FTransform CurRelativeTransform = this->GetComponentTransform().GetRelativeTransform(UVRInteractibleFunctionLibrary::Interactible_GetCurrentParentTransform(this));
584 AddDialAngle(0.0f, false, true);
585}
EGripMovementReplicationSettings
UENUM(Blueprintable)
ESecondaryGripType
UENUM(Blueprintable)
EGripCollisionType
UENUM(Blueprintable)
EGripLateUpdateSettings
UENUM(Blueprintable)
EGripInterfaceTeleportBehavior
UENUM(Blueprintable)
UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent), ClassGroup = MotionController)
bool HasGripAuthority(const FBPActorGripInformation &Grip)
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
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
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")
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")
FTransform_NetQuantize RelativeTransform
UPROPERTY(BlueprintReadWrite, Category = "Settings")
uint8 GripID
UPROPERTY(BlueprintReadOnly, Category = "Settings")
float GripDistance
UPROPERTY(BlueprintReadOnly, NotReplicated, Category = "Settings")
USTRUCT(BlueprintType, Category = "VRExpansionLibrary")
USTRUCT(BlueprintType, Category = "VRExpansionLibrary")
uint8 GripID
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GripPair")
USTRUCT(BlueprintType, Category = "VRExpansionLibrary|TransformNetQuantize", meta = (HasNativeMake = ...