Agrarsense
|
#include <Spectator.h>
Public Member Functions | |
void | TeleportSpectator (const FTransform &Transform) |
void | TeleportToActorLocation (const AActor *Actor) |
void | FollowActor (AActor *Actor, bool DisableInputs=true, const float DistanceToActor=150.0f, const float HeightOffset=10.0f) |
void | TeleportToActorFollowLocation (AActor *Actor, const float DistanceToActor=1500.0f, const float HeightOffset=500.0f) |
void | StopFollowingAnyActor (bool EnableInputs=true) |
void | SetNiagaraComponentVisibility (bool Visible) |
void | SetMaxSpeed (float MaxSpeed=1500.0f) |
float | GetMaxSpeed () |
AActor * | GetTargetActor () |
bool | IsNiagaraComponentVisible () |
bool | IsSpectatorFollowingAnyActor () |
UFloatingPawnMovement * | GetFloatingPawnMovement () |
void | TeleportToLevelTeleportLocation (FLevelTeleportLocation TeleportLocation) |
Public Attributes | |
FFollowTargetChanged | OnFollowTargetChanged |
Protected Member Functions | |
virtual void | BeginPlay () override |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
Protected Attributes | |
UNiagaraComponent * | NiagaraComponent = nullptr |
Private Attributes | |
TWeakObjectPtr< AActor > | Target |
Spectator Actor class for flying (WASD) movement. BP_Spectator blueprint is based on this Actor.
Definition at line 23 of file Spectator.h.
|
overrideprotectedvirtual |
Definition at line 15 of file Spectator.cpp.
References ASensor::HideComponentForAllCameras(), NiagaraComponent, and SetNiagaraComponentVisibility().
|
overrideprotectedvirtual |
Definition at line 34 of file Spectator.cpp.
References NiagaraComponent, and Target.
void ASpectator::FollowActor | ( | AActor * | Actor, |
bool | DisableInputs = true , |
||
const float | DistanceToActor = 150.0f , |
||
const float | HeightOffset = 10.0f |
||
) |
Makes the spectator a child of the given actor and starts following it.
Definition at line 87 of file Spectator.cpp.
References OnFollowTargetChanged, and Target.
UFloatingPawnMovement * ASpectator::GetFloatingPawnMovement | ( | ) |
Get UFloatingPawnMovement from this pawn.
Definition at line 212 of file Spectator.cpp.
Referenced by GetMaxSpeed(), and SetMaxSpeed().
float ASpectator::GetMaxSpeed | ( | ) |
Get FloatingPawnMovement current max speed.
Definition at line 200 of file Spectator.cpp.
References GetFloatingPawnMovement().
Referenced by UAgrarsenseSettings::SetSpectatorMaxSpeed().
|
inline |
Gets the actor that the spectator is currently following.
Definition at line 84 of file Spectator.h.
|
inline |
Checks if spectator niagara component is currently visible.
Definition at line 93 of file Spectator.h.
Referenced by UAgrarsenseSettings::SetShowSpectatorRainAndSnowfall().
|
inline |
Checks if the spectator is currently following any actor.
Definition at line 108 of file Spectator.h.
void ASpectator::SetMaxSpeed | ( | float | MaxSpeed = 1500.0f | ) |
Set FloatingPawnMovement max speed.
Definition at line 191 of file Spectator.cpp.
References GetFloatingPawnMovement().
Referenced by UAgrarsenseSettings::SetSpectatorMaxSpeed().
void ASpectator::SetNiagaraComponentVisibility | ( | bool | Visible | ) |
Set Spectator niagara component visibility (rain/snow fall).
Visible | If true, enables spectator Niagara component. Else disables it. |
Definition at line 183 of file Spectator.cpp.
References NiagaraComponent.
Referenced by BeginPlay(), and UAgrarsenseSettings::SetShowSpectatorRainAndSnowfall().
void ASpectator::StopFollowingAnyActor | ( | bool | EnableInputs = true | ) |
Stops the spectator from following any actor.
EnableInputs | If true, enables spectator inputs after stopping. |
Definition at line 163 of file Spectator.cpp.
References OnFollowTargetChanged, and Target.
Referenced by TeleportSpectator(), and TeleportToLevelTeleportLocation().
void ASpectator::TeleportSpectator | ( | const FTransform & | Transform | ) |
Teleports the spectator to the specified transform.
Definition at line 48 of file Spectator.cpp.
References StopFollowingAnyActor(), and Transform.
Referenced by UROSCommands::HandleTeleportSpectator(), USimulatorJsonParser::TeleportSpectatorOrFollowActorIfField(), and TeleportToActorLocation().
void ASpectator::TeleportToActorFollowLocation | ( | AActor * | Actor, |
const float | DistanceToActor = 1500.0f , |
||
const float | HeightOffset = 500.0f |
||
) |
Teleports the spectator to the follow location of a specific actor
Definition at line 133 of file Spectator.cpp.
void ASpectator::TeleportToActorLocation | ( | const AActor * | Actor | ) |
Teleports the spectator to the location of a specific actor.
Definition at line 78 of file Spectator.cpp.
References TeleportSpectator(), and Transform.
void ASpectator::TeleportToLevelTeleportLocation | ( | FLevelTeleportLocation | TeleportLocation | ) |
Teleport specator to level teleport location
TeleportLocation |
Definition at line 218 of file Spectator.cpp.
References StopFollowingAnyActor(), FLevelTeleportLocation::TeleportLocationTransform, and Transform.
|
protected |
Definition at line 140 of file Spectator.h.
Referenced by BeginPlay(), EndPlay(), and SetNiagaraComponentVisibility().
FFollowTargetChanged ASpectator::OnFollowTargetChanged |
Event triggered when followed actor changed
Definition at line 131 of file Spectator.h.
Referenced by FollowActor(), and StopFollowingAnyActor().
|
private |
Definition at line 144 of file Spectator.h.
Referenced by EndPlay(), FollowActor(), and StopFollowingAnyActor().