From 08ffc1aa86fea3c9725357a2c6042547393236fd Mon Sep 17 00:00:00 2001 From: Kris Helwig <helwig@vr.rwth-aachen.de> Date: Fri, 6 Jun 2025 12:33:16 +0200 Subject: [PATCH] refactoring of CameraRideSecondsToUpdates; Documentation updates --- .../RWTHVRQuickStart/Private/PointOfInterestManager.cpp | 6 +++--- Source/RWTHVRQuickStart/Public/PointOfInterestManager.h | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/RWTHVRQuickStart/Private/PointOfInterestManager.cpp b/Source/RWTHVRQuickStart/Private/PointOfInterestManager.cpp index 427c818..fbfa0c7 100644 --- a/Source/RWTHVRQuickStart/Private/PointOfInterestManager.cpp +++ b/Source/RWTHVRQuickStart/Private/PointOfInterestManager.cpp @@ -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; diff --git a/Source/RWTHVRQuickStart/Public/PointOfInterestManager.h b/Source/RWTHVRQuickStart/Public/PointOfInterestManager.h index a534217..4513f9e 100644 --- a/Source/RWTHVRQuickStart/Public/PointOfInterestManager.h +++ b/Source/RWTHVRQuickStart/Public/PointOfInterestManager.h @@ -22,7 +22,7 @@ public: UFUNCTION(CallInEditor, BlueprintCallable) void ResetToPlayerStart(); - + UFUNCTION(CallInEditor, BlueprintCallable, Category="Point Of Interest Manager") void AddPointOfInterest(); @@ -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) -- GitLab