feat: small camera movements
This commit is contained in:
parent
319e45e27b
commit
1845537987
|
|
@ -324,4 +324,13 @@ void UShootingComponent::TickComponent(float DeltaTime, ELevelTick TickType, FAc
|
||||||
float CurrentFOV = CameraManager->GetFOVAngle();
|
float CurrentFOV = CameraManager->GetFOVAngle();
|
||||||
float NewFOV = FMath::FInterpTo(CurrentFOV, TargetFOV, DeltaTime, AimingAnimationSpeed);
|
float NewFOV = FMath::FInterpTo(CurrentFOV, TargetFOV, DeltaTime, AimingAnimationSpeed);
|
||||||
CameraManager->SetFOV(NewFOV);
|
CameraManager->SetFOV(NewFOV);
|
||||||
|
|
||||||
|
BreathingTimer += DeltaTime;
|
||||||
|
|
||||||
|
float PitchOffset = FMath::Sin(2.0f * PI * PitchFrequency * BreathingTimer);
|
||||||
|
float YawOffset = FMath::Sin(2.0f * PI * YawFrequency * BreathingTimer + YawPhaseOffset);
|
||||||
|
|
||||||
|
// Dodanie inputów
|
||||||
|
PlayerCharacter->AddControllerPitchInput(PitchOffset * PitchAmplitude);
|
||||||
|
PlayerCharacter->AddControllerYawInput(YawOffset * YawAmplitude);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,4 +116,13 @@ private:
|
||||||
bool bIsFirstGunSelected = true;
|
bool bIsFirstGunSelected = true;
|
||||||
|
|
||||||
float MeleDamageValue = 50.f;
|
float MeleDamageValue = 50.f;
|
||||||
|
|
||||||
|
float BreathingTimer = 0.0f;
|
||||||
|
float PitchFrequency = 0.25f;
|
||||||
|
float YawFrequency = 0.22f;
|
||||||
|
|
||||||
|
float PitchAmplitude = 0.003f;
|
||||||
|
float YawAmplitude = 0.002f;
|
||||||
|
|
||||||
|
float YawPhaseOffset = PI / 3.0f;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user