Skip to content

Commit

Permalink
Temporary code for debugging ShadowfallStudios#258 shaking tool problem:
Browse files Browse the repository at this point in the history
    in order to get rid of the rotation noise from the build in system, I override UALSCharacterMovementComponent::SmoothCorrection to skip net correction BY DEFAULT, disable it with "Als.Debug.bSkipSmoothCorrection 0"
  • Loading branch information
ameaninglessname committed Oct 4, 2022
1 parent a204ebb commit d233e4b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,19 @@ float UALSCharacterMovementComponent::GetMaxBrakingDeceleration() const
return CurrentMovementSettings.MovementCurve->GetVectorValue(GetMappedSpeed()).Y;
}

void UALSCharacterMovementComponent::UpdateFromCompressedFlags(uint8 Flags) // Client only
bool bSkipSmoothCorrection = true;
FAutoConsoleVariableRef CVarRef_bSkipSmoothCorrection(TEXT("Als.Debug.bSkipSmoothCorrection"), bSkipSmoothCorrection, TEXT(""));

void UALSCharacterMovementComponent::SmoothCorrection(const FVector& OldLocation, const FQuat& OldRotation,
const FVector& NewLocation, const FQuat& NewRotation)
{
if (!bSkipSmoothCorrection)
{
Super::SmoothCorrection(OldLocation, OldRotation, NewLocation, NewRotation);
}
}

void UALSCharacterMovementComponent::UpdateFromCompressedFlags(const uint8 Flags) // Client only
{
Super::UpdateFromCompressedFlags(Flags);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class ALSV4_CPP_API UALSCharacterMovementComponent : public UCharacterMovementCo
virtual void PhysWalking(float DeltaTime, int32 Iterations) override;
virtual float GetMaxAcceleration() const override;
virtual float GetMaxBrakingDeceleration() const override;
virtual void SmoothCorrection(const FVector& OldLocation, const FQuat& OldRotation, const FVector& NewLocation, const FQuat& NewRotation) override;

// Movement Settings Variables
UPROPERTY()
Expand Down

0 comments on commit d233e4b

Please sign in to comment.