87 FVRLeverStateChangedSignature OnLeverStateChanged;
89 UFUNCTION(BlueprintImplementableEvent, meta = (
DisplayName = "Lever State Changed"))
90 void ReceiveLeverStateChanged(
bool LeverStatus,
EVRInteractibleLeverEventType LeverStatusType,
float LeverAngleAtTime,
float FullLeverAngleAttime);
92 UPROPERTY(BlueprintAssignable, Category = "VRLeverComponent")
93 FVRLeverFinishedLerpingSignature OnLeverFinishedLerping;
95 UFUNCTION(BlueprintImplementableEvent, meta = (
DisplayName = "Lever Finished Lerping"))
96 void ReceiveLeverFinishedLerping(
float LeverFinalAngle);
99 UPROPERTY(BlueprintReadOnly, Category = "VRLeverComponent")
100 float CurrentLeverAngle;
103 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent")
104 FRotator AllCurrentLeverAngles;
107 UPROPERTY(BlueprintReadOnly, Category = "VRLeverComponent")
108 FVector CurrentLeverForwardVector;
110 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent")
111 bool bIsPhysicsLever;
113 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent")
114 bool bUngripAtTargetRotation;
117 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent")
121 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent", meta = (ClampMin = "0.01", ClampMax = "1.0", UIMin = "0.01", UIMax = "1.0"))
122 float LeverTogglePercentage;
125 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent", meta = (ClampMin = "0.0", ClampMax = "179.9", UIMin = "0.0", UIMax = "180.0"))
126 float LeverLimitPositive;
129 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent", meta = (ClampMin = "0.0", ClampMax = "179.9", UIMin = "0.0", UIMax = "180.0"))
130 float LeverLimitNegative;
133 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent|Flight Stick Settings", meta = (ClampMin = "0.0", ClampMax = "179.9", UIMin = "0.0", UIMax = "180.0"))
134 float FlightStickYawLimit;
137 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent")
141 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent")
142 bool bAutoDropWhenLocked;
145 UFUNCTION(BlueprintCallable, Category = "GripSettings")
146 void SetIsLocked(
bool bNewLockedState);
151 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent")
154 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent")
155 bool bSendLeverEventsDuringLerp;
157 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent")
158 float LeverReturnSpeed;
161 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent|Flight Stick Settings")
162 bool bBlendAxisValuesByAngleThreshold;
166 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent|Flight Stick Settings", meta = (ClampMin = "1.0", ClampMax = "360.0", UIMin = "1.0", UIMax = "360.0"))
167 float AngleThreshold;
170 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent|Momentum Settings", meta = (ClampMin = "0", ClampMax = "12", UIMin = "0", UIMax = "12"))
174 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent|Momentum Settings", meta = (ClampMin = "0.0", ClampMax = "180", UIMin = "0.0", UIMax = "180.0"))
175 float LeverMomentumFriction;
178 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent|Momentum Settings", meta = (ClampMin = "0.0", ClampMax = "1.0", UIMin = "0.0", UIMax = "1.0"))
179 float LeverRestitution;
182 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRLeverComponent|Momentum Settings", meta = (ClampMin = "0.0", UIMin = "0.0"))
183 float MaxLeverMomentum;
185 UPROPERTY(BlueprintReadOnly, Category = "VRLeverComponent")
188 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GripSettings")
189 float PrimarySlotRange;
191 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GripSettings")
192 float SecondarySlotRange;
194 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "GripSettings")
198 UFUNCTION(BlueprintCallable, Category = "GripSettings")
199 void SetGripPriority(
int NewGripPriority);
202 float FullCurrentAngle;
204 float LastDeltaAngle;
207 virtual
void OnRegister() override;
210 UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_InitialRelativeTransform, Category = "VRLeverComponent")
214 virtual
void OnRep_InitialRelativeTransform()
216 ReCalculateCurrentAngle();
220 FTransform InteractorOffsetTransform;
222 FVector InitialInteractorLocation;
223 FVector InitialInteractorDropLocation;
224 float InitialGripRot;
231 float MomentumAtDrop;
232 float LastLeverAngle;
236 void LerpAxis(
float CurrentAngle,
float DeltaTime);
238 void CalculateCurrentAngle(FTransform & CurrentTransform);
245 virtual void GetOwnedGameplayTags(FGameplayTagContainer& TagContainer)
const override
247 TagContainer = GameplayTags;
251 UPROPERTY(EditAnywhere, Replicated, BlueprintReadWrite, Category =
"GameplayTags")
252 FGameplayTagContainer GameplayTags;
256 virtual
void PreReplication(IRepChangedPropertyTracker & ChangedPropertyTracker) override;
260 UPROPERTY(EditAnywhere, Replicated, BlueprintReadWrite, Category = "VRGripInterface")
261 bool bRepGameplayTags;
264 UPROPERTY(EditAnywhere, Replicated, BlueprintReadWrite, Category = "VRGripInterface|Replication")
265 bool bReplicateMovement;
267 virtual
void TickComponent(
float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;
268 virtual
void BeginPlay() override;
270 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
273 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
276 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
280 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface")
284 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRGripInterface", meta = (ScriptName = "IsDenyGripping"))
287 UPROPERTY(BlueprintReadOnly, Category = "VRGripInterface", meta = (ScriptName = "IsCurrentlyHeld"))
290 UPROPERTY(BlueprintReadOnly, Category = "VRGripInterface")
292 bool bOriginalReplicatesMovement;
297 UFUNCTION(BlueprintCallable, Category = "VRLeverComponent")
298 void ResetInitialLeverLocation(
bool bAllowThrowingEvents = true);
305 UFUNCTION(BlueprintCallable, Category = "VRLeverComponent")
306 void SetLeverAngle(
float NewAngle, FVector DualAxisForwardVector,
bool bAllowThrowingEvents = true);
310 UFUNCTION(BlueprintCallable, Category = "VRLeverComponent")
311 float ReCalculateCurrentAngle(
bool bAllowThrowingEvents = true);
313 void ProccessCurrentState(
bool bWasLerping = false,
bool bThrowEvents = true,
bool bCheckAutoDrop = true);
315 virtual
void OnUnregister() override;
319 UPROPERTY(BlueprintAssignable, Category = "Grip Events")
320 FVROnGripSignature OnGripped;
324 UPROPERTY(BlueprintAssignable, Category = "Grip Events")
325 FVROnDropSignature OnDropped;
328 physx::PxD6Joint* HandleData;
332 bool DestroyConstraint();
333 bool SetupConstraint();
346 bool SimulateOnDrop_Implementation()
override;
361 void GetGripStiffnessAndDamping_Implementation(
float& GripStiffnessOut,
float& GripDampingOut)
override;
367 float GripBreakDistance_Implementation()
override;
370 void ClosestGripSlotInRange_Implementation(FVector WorldLocation,
bool bSecondarySlot,
bool& bHadSlotInRange, FTransform& SlotWorldTransform, FName& SlotName,
UGripMotionControllerComponent* CallingController =
nullptr, FName OverridePrefix = NAME_None)
override;
373 bool AllowsMultipleGrips_Implementation()
override;
376 void IsHeld_Implementation(TArray<FBPGripPair>& CurHoldingControllers,
bool& bCurIsHeld)
override;
388 bool GetGripScripts_Implementation(TArray<UVRGripScriptBase*>& ArrayReference)
override;
417 void OnUsed_Implementation()
override;
420 void OnEndUsed_Implementation()
override;
423 void OnSecondaryUsed_Implementation()
override;
426 void OnEndSecondaryUsed_Implementation()
override;
429 void OnInput_Implementation(FKey Key, EInputEvent KeyEvent)
override;