Select Git revision
PointOfInterestManager.h
PointOfInterestManager.h 2.55 KiB
#pragma once
#include "CoreMinimal.h"
#include "Components/SplineComponent.h"
#include "PointOfInterestManager.generated.h"
DECLARE_LOG_CATEGORY_EXTERN(POIManagerLog, All, All);
class APointOfInterest;
class FCameraRide;
UCLASS(Blueprintable)
class APointOfInterestManager : public AActor
{
GENERATED_BODY()
public:
APointOfInterestManager();
virtual void TickActor(float DeltaTime, enum ELevelTick TickType, FActorTickFunction& ThisTickFunction) override;
UFUNCTION(CallInEditor, BlueprintCallable, Category="Point Of Interest Manager")
void AddPointOfInterest();
UFUNCTION(CallInEditor, BlueprintCallable, Category="Point Of Interest Manager")
void VisitNextPointOfInterest();
UFUNCTION(CallInEditor, BlueprintCallable, Category="Point Of Interest Manager")
void VisitPreviousPointOfInterest();
UFUNCTION(BlueprintCallable, Category="Point Of Interest Manager")
void VisitPointOfInterestByIndex(int index);
UFUNCTION(BlueprintCallable, Category="Point Of Interest Manager")
void VisitPointOfInterest(APointOfInterest* POI) const;
UFUNCTION(CallInEditor, BlueprintCallable, Category="Point Of Interest Manager")
void StartCameraRide();
UFUNCTION(CallInEditor, BlueprintCallable, Category="Point Of Interest Manager")
void StopCameraRide();
UFUNCTION(BlueprintCallable, Category="Point Of Interest Manager")
int GetPointOfInterestCount();
/**
* Whether the camera should progress a constant distance between ticks (true) or a variable distance based on frametimes (false).
* This should be set to true if you expect long/inconsistent frame times or for e.g. PSO gathering.
*/
UPROPERTY(EditAnywhere, Category="Point Of Interest Manager")
bool MakeCameraRideProgressionConstantBetweenTicks = true;
/**
* Only relevant when MakeCameraRideProgressionConstantBetweenTicks = true.
* The conversion rate of how many ticks the camera should update to equal the distance traveled during 1 second.
*/
UPROPERTY(EditAnywhere, Category="Point Of Interest Manager",
meta = (EditCondition = "MakeCameraRideProgressionConstantBetweenTicks"))
int CameraRideSecondsToUpdates = 60;
protected:
UPROPERTY(EditAnywhere)
TArray<APointOfInterest*> POIs;
int CurrentPOIIndex = 0;
private:
UFUNCTION(CallInEditor, BlueprintCallable, Category="Point Of Interest Manager")
void UpdateSpline();
void ProgressCameraRide();
void CameraRideEnded();
USplineComponent* SplineComponent;
UPROPERTY(EditAnywhere, meta=(UIMin = 0.0, UIMax = 500))
float CameraSpeed = 100;
bool IsRidingCamera;
float CameraRideStart, CameraRideEnd;
int DurationInUpdates, CurrentUpdate;
};