diff --git a/Source/RWTHVRQuickStart/Private/PointOfInterestManager.cpp b/Source/RWTHVRQuickStart/Private/PointOfInterestManager.cpp index 427c8189c140cedf758c64cedd108cb707c8e4fe..fbfa0c76040baf0f61dd55ed5b071e5817b2e83d 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 a5342173f3f4a4a421e7f0b38d7fe89e4dbbe11b..4513f9ec7363c4dad2816808abab45d2643814f6 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)