58 void OnOverlapBegin(UPrimitiveComponent* OverlappedComp,
AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex,
bool bFromSweep, const FHitResult& SweepResult);
61 void OnOverlapEnd(UPrimitiveComponent* OverlappedComp,
AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);
63 virtual
void TickComponent(
float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;
64 virtual
void BeginPlay() override;
66 UFUNCTION(BlueprintPure, Category = "VRButtonComponent")
70 UFUNCTION(BlueprintCallable, Category = "VRButtonComponent")
71 void ResetInitialButtonLocation();
74 UFUNCTION(BlueprintCallable, Category = "VRButtonComponent")
75 void SetButtonState(
bool bNewButtonState,
bool bCallButtonChangedEvent = true,
bool bSnapIntoPosition = false);
78 UFUNCTION(BlueprintCallable, Category = "VRButtonComponent")
79 void SetButtonToRestingPosition(
bool bLerpToPosition = false);
82 UPROPERTY(BlueprintAssignable, Category = "VRButtonComponent")
83 FVRButtonStateChangedSignature OnButtonStateChanged;
86 UFUNCTION(BlueprintImplementableEvent, meta = (
DisplayName = "Button State Changed"))
87 void ReceiveButtonStateChanged(
bool bCurButtonState,
AActor * LastInteractingActor, UPrimitiveComponent * InteractingComponent);
90 UPROPERTY(BlueprintAssignable, Category = "VRButtonComponent")
91 FVRButtonStartedInteractionSignature OnButtonBeginInteraction;
94 UPROPERTY(BlueprintAssignable, Category = "VRButtonComponent")
95 FVRButtonStartedInteractionSignature OnButtonEndInteraction;
98 UFUNCTION(BlueprintImplementableEvent, meta = (
DisplayName = "Button Started Interaction"))
99 void ReceiveButtonBeginInteraction(
AActor * InteractingActor, UPrimitiveComponent * InteractingComponent);
102 UFUNCTION(BlueprintImplementableEvent, meta = (
DisplayName = "Button Ended Interaction"))
103 void ReceiveButtonEndInteraction(
AActor * LastInteractingActor, UPrimitiveComponent * LastInteractingComponent);
106 UPROPERTY(BlueprintReadOnly, Category = "VRButtonComponent")
107 TWeakObjectPtr<UPrimitiveComponent> LocalInteractingComponent;
109 UPROPERTY(BlueprintReadOnly, Category = "VRButtonComponent")
110 TWeakObjectPtr<
AActor> LocalLastInteractingActor;
112 UPROPERTY(BlueprintReadOnly, Category = "VRButtonComponent")
113 TWeakObjectPtr<UPrimitiveComponent> LocalLastInteractingComponent;
116 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRButtonComponent")
120 UPROPERTY(EditAnywhere,BlueprintReadWrite, Replicated, Category = "VRButtonComponent")
124 UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, Category = "VRButtonComponent|Replication")
128 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRButtonComponent")
132 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRButtonComponent")
133 float DepressDistance;
136 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRButtonComponent")
140 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRButtonComponent")
144 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRButtonComponent")
145 float ButtonEngageDepth;
148 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRButtonComponent")
149 float MinTimeBetweenEngaging;
152 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRButtonComponent")
153 bool bSkipOverlapFiltering;
155 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "VRButtonComponent")
156 bool IsValidOverlap(UPrimitiveComponent * OverlapComponent);
159 void SetLastInteractingActor();
161 virtual FVector GetTargetRelativeLocation();
164 UPROPERTY(EditAnywhere, Replicated, BlueprintReadWrite, Category = "VRGripInterface|Replication")
165 bool bReplicateMovement;
167 virtual
void PreReplication(IRepChangedPropertyTracker & ChangedPropertyTracker) override;
170 virtual
void OnRegister() override;
173 UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_InitialRelativeTransform, Category = "VRButtonComponent")
177 virtual
void OnRep_InitialRelativeTransform()
179 SetButtonToRestingPosition();
185 FVector InitialLocation;
186 bool bToggledThisTouch;
187 FVector InitialComponentLoc;
188 float LastToggleTime;
190 inline float GetAxisValue(FVector CheckLocation)
195 return CheckLocation.X;
break;
197 return CheckLocation.Y;
break;
199 return CheckLocation.Z;
break;
200 default:
return 0.0f;
break;
204 inline FVector SetAxisValue(
float SetValue)
206 FVector vec = FVector::ZeroVector;
211 vec.X = SetValue;
break;
213 vec.Y = SetValue;
break;
215 vec.Z = SetValue;
break;