UGKFogOfWarComponent#
Defined in File GKFogOfWarComponent.h
Inheritance Relationships#
Base Type#
public UActorComponent
Class Documentation#
-
class UGKFogOfWarComponent : public UActorComponent#
UGKFogOfWarComponent is used to defines the spec of the actor participating in the fog of war the fog of war itself is computed inside the AGKFogOfWarVolume in a separate thread.
/rst .. note::
A component cannot give and block light at the same time
/endrst
Public Functions
-
UGKFogOfWarComponent()#
Sets default values for this component’s properties.
-
void GetLifetimeReplicatedProps(TArray<FLifetimeProperty> &OutLifetimeProps) const override#
-
class UTexture *GetVisionTexture()#
Returns the render target associated with its faction, only use for debugging the texture cannot be changed to refelect team change
-
class UTexture *GetExplorationTexture()#
Returns the render target associated with its faction, only use for debugging the texture cannot be changed to refelect team change
-
class AGKFogOfWarVolume *GetFogOfWarVolume()#
Returns the fog of war volume this component is associated to.
-
FName GetFaction() const#
Returns current team name.
-
class UMaterialInstanceDynamic *GetFogOfWarMaterial(class UMaterialInterface *BaseMaterial)#
Create a new Dynamic texture with Fog of war parameters populated The material as 3 texture parameters
-
class UMaterialInterface *GetFogOfWarPostprocessMaterial()#
Returns the post process material the actor should use for its camera The material as 3 texture parameters
FoWView
FoWViewUpscaled
FoWExploration
-
void SetCameraPostprocessMaterial(class UCameraComponent *CameraComponent)#
Add the fog of war post process material to a camera.
-
bool RegisterFogComponent()#
Attempts to register the component.
-
bool UnregisterFogComponent()#
Remove the component from the fog of war.
-
FGenericTeamId GetGenericTeamId() const#
Returns the team this component belong too.
-
bool IsVisible(AActor const *Target) const#
Returns true if the target is visible by the team of the component.
-
bool IsVisible(FVector Loc) const#
Returns true if current team can see the target.
-
bool IsVisibleBy(AActor const *Target) const#
Returns true if the current component can be seen by the team’s target.
-
bool IsVisibleBy(FGenericTeamId EnemyTeam) const#
Returns true if the current component can be seen by a given team.
-
void GenerateTransientConeBlock()#
-
bool IsConeBlocked(FIntVector const &Pos)#
-
void OnSighted_Native(FGenericTeamId Team)#
-
void OnOutOfSight_Native(FGenericTeamId Team)#
-
inline bool BecameOutOfSight(FGenericTeamId Seer) const#
-
inline bool BecameSeen(FGenericTeamId Seer) const#
Public Members
-
float InnerRadius#
Vision offset.
-
bool UnobstructedVision#
If true vision will be given around the the actor ignoring all collisions. This method use a material to draw the vision and does not cast rays. This means it is fairly cheap but it comes at the cost of not being able to broadcast sighting events when the field of view is inferior to 360 degree.
-
float LineTickness#
Line Thickness to draw sights, smaller thickness is more precise but requires more rays.
-
int TraceCount#
Number of rays to cast to draw the line of sight.
-
float FieldOfView#
Field of view of the actor, 360 is all around like real time strategy, Humans vision span is about 120 but most of it peripheral vision (i.e super bad), central vision is about 60 degree
-
float Radius#
View max size.
-
bool GivesVision#
if false, the actor will not be reducing the fog around him No sighting event will be broadcasted
-
bool BlocksVision#
if true, other actors will not be able to see through this actor. if false it will indirectly disable
OnSighted
broadcast events as a side effect.
-
bool bOverrideObstacleConfig#
-
FGKObstacleConfig ObstacleConfig#
Configures how the obstacle is drawn
-
FGenericTeamId DefaultTeam#
Default Team used if TeamAgent interface is not used.
-
FGKConeConfiguration ConeConfig#
-
TArray<FIntVector> TransientConeBlock#
-
FOnSightedEventSignature OnSighted#
Called when the component became visible for a given team NOTE: this is only called on the server
-
FOnOutOfSightEventSignature OnOutOfSight#
Called when the component became invisible for a given team NOTE: this is only called on the server
Protected Functions
-
virtual void BeginPlay() override#
Called when the game starts.
-
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override#
Unregister the component.
Protected Attributes
-
bool bWasRegistered#
-
UGKFogOfWarComponent()#