38 bool bNotifyTeleported;
41 UPROPERTY(Transient, DuplicateTransient)
46 virtual
void MoveAutonomous(
float ClientTimeStamp,
float DeltaTime, uint8 CompressedFlags, const FVector& NewAccel) override;
47 virtual
void PerformMovement(
float DeltaSeconds) override;
51 virtual
void TickComponent(
float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;
54 virtual
bool ForcePositionUpdate(
float DeltaTime) override;
58 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRBaseCharacterMovementComponent")
59 bool bUseClientControlRotation;
62 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRBaseCharacterMovementComponent|Smoothing")
63 bool bDisableSimulatedTickWhenSmoothingMovement;
66 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement")
67 bool bCapHMDMovementToMaxMovementSpeed;
70 void OnMovementModeChanged(EMovementMode PreviousMovementMode, uint8 PreviousCustomMode) override;
73 UPROPERTY(BlueprintAssignable, Category = "VRMovement")
74 FVROnPerformClimbingStepUp OnPerformClimbingStepUp;
76 virtual
void OnMoveCompleted(FAIRequestID RequestID, const FPathFollowingResult& Result);
79 FVector GetActorFeetLocationVR() const;
81 FORCEINLINE
bool HasRequestedVelocity()
83 return bHasRequestedVelocity;
86 void SetHasRequestedVelocity(
bool bNewHasRequestedVelocity);
87 bool IsClimbing()
const;
90 UFUNCTION(BlueprintCallable, Category =
"VRMovement")
91 void SetCrouchedHalfHeight(
float NewCrouchedHalfHeight);
94 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement", meta = (ClampMin = "0.0", UIMin = "0", ClampMax = "5.0", UIMax = "5"))
95 float VRWallSlideScaler;
98 virtual
float SlideAlongSurface(const FVector& Delta,
float Time, const FVector& Normal, FHitResult& Hit,
bool bHandleImpact) override;
102 UFUNCTION(BlueprintCallable, Category = "BaseVRCharacterMovementComponent|VRLocations")
103 void AddCustomReplicatedMovement(FVector Movement);
106 UFUNCTION(BlueprintCallable, Category = "BaseVRCharacterMovementComponent|VRLocations")
107 void ClearCustomReplicatedMovement();
111 void CheckServerAuthedMoveAction();
114 UFUNCTION(BlueprintCallable, Category = "VRMovement")
115 void PerformMoveAction_SetTrackingPaused(
bool bNewTrackingPaused);
116 virtual
void StoreSetTrackingPaused(
bool bNewTrackingPaused);
119 UFUNCTION(BlueprintCallable, Category = "VRMovement")
124 UFUNCTION(BlueprintCallable, Category = "VRMovement")
128 UFUNCTION(BlueprintCallable, Category = "VRMovement")
132 UFUNCTION(BlueprintCallable, Category = "VRMovement")
133 void PerformMoveAction_StopAllMovement();
138 UFUNCTION(BlueprintCallable, Category = "VRMovement")
139 void PerformMoveAction_Custom(
EVRMoveAction MoveActionToPerform,
EVRMoveActionDataReq DataRequirementsForMoveAction, FVector MoveActionVector, FRotator MoveActionRotator, uint8 MoveActionFlags = 0);
143 bool CheckForMoveAction();
150 FVector CustomVRInputVector;
151 FVector AdditionalVRInputVector;
152 FVector LastPreAdditiveVRVelocity;
153 bool bHadExtremeInput;
154 bool bApplyAdditionalVRInputVectorAsNegative;
157 inline
void RewindVRRelativeMovement()
159 if (bApplyAdditionalVRInputVectorAsNegative)
162 MoveUpdatedComponent(-AdditionalVRInputVector, UpdatedComponent->GetComponentQuat(),
false);
169 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"VRMovement", meta = (ClampMin =
"0.0", UIMin =
"0"))
170 float TrackingLossThreshold;
174 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement")
175 bool bHoldPositionOnTrackingLossThresholdHit;
179 UFUNCTION(BlueprintCallable, Category = "VRMovement")
180 FVector RewindVRMovement();
183 UFUNCTION(BlueprintCallable, Category = "VRMovement")
184 FVector GetCustomInputVector();
188 void StartPushBackNotification(FHitResult HitResult);
189 void EndPushBackNotification();
197 inline
void ApplyVRMotionToVelocity(
float deltaTime)
199 bHadExtremeInput =
false;
201 if (AdditionalVRInputVector.IsNearlyZero() && CustomVRInputVector.IsNearlyZero())
203 LastPreAdditiveVRVelocity = FVector::ZeroVector;
207 LastPreAdditiveVRVelocity = (AdditionalVRInputVector / deltaTime);
209 if (LastPreAdditiveVRVelocity.SizeSquared() > FMath::Square(TrackingLossThreshold))
211 bHadExtremeInput =
true;
212 if (bHoldPositionOnTrackingLossThresholdHit)
214 LastPreAdditiveVRVelocity = FVector::ZeroVector;
219 LastPreAdditiveVRVelocity += (CustomVRInputVector / deltaTime);
221 Velocity += LastPreAdditiveVRVelocity;
225 if (IsExceedingMaxSpeed(GetMaxSpeed()))
228 Velocity = Velocity.GetSafeNormal() * GetMaxSpeed();
234 inline void RestorePreAdditiveVRMotionVelocity()
236 if (!LastPreAdditiveVRVelocity.IsNearlyZero())
238 if (bHadExtremeInput)
241 Velocity = FVector::ZeroVector;
256 Velocity -= LastPreAdditiveVRVelocity;
260 LastPreAdditiveVRVelocity = FVector::ZeroVector;
263 virtual void PhysCustom(
float deltaTime, int32 Iterations)
override;
264 virtual void PhysCustom_Climbing(
float deltaTime, int32 Iterations);
265 virtual void PhysCustom_LowGrav(
float deltaTime, int32 Iterations);
268 virtual void OnClientCorrectionReceived(
class FNetworkPredictionData_Client_Character& ClientData,
float TimeStamp, FVector NewLocation, FVector NewVelocity, UPrimitiveComponent* NewBase, FName NewBaseBoneName,
bool bHasBase,
bool bBaseRelativePosition, uint8 ServerMovementMode)
override;
271 virtual void SimulatedTick(
float DeltaSeconds)
override;
274 virtual void SmoothCorrection(
const FVector& OldLocation,
const FQuat& OldRotation,
const FVector& NewLocation,
const FQuat& NewRotation)
override;
282 virtual void SmoothClientPosition(
float DeltaSeconds)
override;
285 void SmoothClientPosition_UpdateVRVisuals();
293 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"VRMovement")
294 bool bIgnoreSimulatingComponentsInFloorCheck;
298 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement")
299 bool bRunControlRotationInMovementComponent;
313 virtual
void ComputeFloorDist(const FVector& CapsuleLocation,
float LineDistance,
float SweepDistance, FFindFloorResult& OutFloorResult,
float SweepRadius, const FHitResult* DownwardSweepResult = NULL) const override;
316 virtual
bool VRClimbStepUp(const FVector& GravDir, const FVector& Delta, const FHitResult &InHit, FStepDownResult* OutStepDownResult =
nullptr);
319 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement|Climbing")
320 float VRClimbingStepHeight;
327 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement|Climbing")
328 float VRClimbingEdgeRejectDistance;
331 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement|Climbing")
332 float VRClimbingStepUpMultiplier;
335 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement|Climbing")
336 bool bClampClimbingStepUp;
339 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement|Climbing")
340 float VRClimbingStepUpMaxSize;
343 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement|Climbing")
344 bool SetDefaultPostClimbMovementOnStepUp;
347 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement|Climbing")
348 float VRClimbingMaxReleaseVelocitySize;
355 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement")
356 float VREdgeRejectDistance;
358 UFUNCTION(BlueprintCallable, Category = "VRMovement|Climbing")
359 void SetClimbingMode(
bool bIsClimbing);
362 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement|Climbing")
366 virtual
void ApplyNetworkMovementMode(const uint8 ReceivedMode) override;
375 UFUNCTION(BlueprintCallable, Category = "VRMovement")
385 UFUNCTION(BlueprintPure, Category = "VRMovement")
391 FORCEINLINE
void ApplyReplicatedMovementMode(
EVRConjoinedMovementModes &NewMovementMode,
bool bClearMovementMode = false)
398 SetMovementMode((EMovementMode)NewMovementMode);
408 if(bClearMovementMode)
413 void UpdateFromCompressedFlags(uint8 Flags)
override;
415 FVector RoundDirectMovement(FVector InMovement)
const;
418 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"VRMovement|LowGrav", meta = (ClampMin =
"0.0", UIMin =
"0", ClampMax =
"5.0", UIMax =
"5"))
419 float VRLowGravWallFrictionScaler;
422 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRMovement|LowGrav")
423 bool VRLowGravIgnoresDefaultFluidFriction;