Skip to content
Snippets Groups Projects
Commit 08ffc1aa authored by Kris Tabea Helwig's avatar Kris Tabea Helwig
Browse files

refactoring of CameraRideSecondsToUpdates; Documentation updates

parent 6f0f32a4
Branches 5.4
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ void APointOfInterestManager::ResetToPlayerStart()
UGameplayStatics::GetAllActorsOfClass(GetWorld(), APlayerStart::StaticClass(), AllPlayerStarts);
if (AllPlayerStarts.IsEmpty())
{
UE_LOGFMT(POIManagerLog, Warning, "Attempted to move player pawn to PlayerStart but no PlayerStart found to move.");
UE_LOGFMT(POIManagerLog, Warning, "Attempted to move player pawn to PlayerStart but no PlayerStart found to move to.");
return;
}
AActor* PlayerStart = AllPlayerStarts[0];
......@@ -121,7 +121,7 @@ void APointOfInterestManager::StartCameraRide()
CameraRideStart = UGameplayStatics::GetTimeSeconds(this);
CameraRideEnd = CameraRideStart + SplineComponent->Duration;
CurrentUpdate = 0;
DurationInUpdates = static_cast<int>(SplineComponent->Duration * CameraRideSecondsToUpdates);
DurationInUpdates = static_cast<int>(SplineComponent->Duration * CameraRideTicksToDistancePerSecond);
IsRidingCamera = true;
}
......@@ -196,7 +196,7 @@ void APointOfInterestManager::ProgressCameraRide()
{
if (CurrentUpdate < DurationInUpdates)
{
float CurrentTime = 1.0f * CurrentUpdate / CameraRideSecondsToUpdates;
float CurrentTime = 1.0f * CurrentUpdate / CameraRideTicksToDistancePerSecond;
FVector Location = SplineComponent->GetLocationAtTime(CurrentTime, ESplineCoordinateSpace::World);
FRotator Rotation = SplineComponent->GetRotationAtTime(CurrentTime, ESplineCoordinateSpace::World);
Rotation.Pitch = 0;
......
......@@ -54,11 +54,14 @@ public:
/**
* Only relevant when MakeCameraRideProgressionConstantBetweenTicks = true.
* The conversion rate of how many ticks the camera should update to equal the distance traveled during 1 second.
* This value is the amount of ticks required to cover the distance which the camera would travel per second with the default
* USplineComponent values.
* Higher number = slower camera speed
* Lower number = higher camera speed
*/
UPROPERTY(EditAnywhere, Category="Point Of Interest Manager",
meta = (EditCondition = "MakeCameraRideProgressionConstantBetweenTicks"))
int CameraRideSecondsToUpdates = 60;
int CameraRideTicksToDistancePerSecond = 60;
protected:
UPROPERTY(EditAnywhere)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment