3#include "IVSmokeHoleRequestComponent.h"
6#include "IVSmokeHoleGeneratorComponent.h"
7#include "IVSmokeHolePreset.h"
8#include "GameFramework/Pawn.h"
9#include "GameFramework/PlayerController.h"
11UIVSmokeHoleRequestComponent::UIVSmokeHoleRequestComponent()
13 SetIsReplicatedByDefault(
true);
20void UIVSmokeHoleRequestComponent::RequestPenetrationHole(AActor* Caller, AActor* IVSmokeVoxelVolume,
const FVector3f& BulletOrigin,
const FVector3f& BulletDirection,
UIVSmokeHolePreset* BulletPreset)
24 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestPenetrationHole] Caller is null"));
28 if (!IVSmokeVoxelVolume)
30 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestPenetrationHole] IVSmokeVoxelVolume is null"));
36 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestPenetrationHole] BulletPreset is null"));
43 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestPenetrationHole] Generator not found on IVSmokeVoxelVolume"));
48 if (Generator->GetOwner() && Generator->GetOwner()->HasAuthority())
55 APawn* InstigatorPawn = Caller->GetInstigator();
58 InstigatorPawn = Cast<APawn>(Caller);
63 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestPenetrationHole] InstigatorPawn not found"));
67 APlayerController* PC = Cast<APlayerController>(InstigatorPawn->GetController());
70 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestPenetrationHole] PlayerController not found"));
77 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestPenetrationHole] RequestComponent not found on PlayerController"));
81 Requester->Internal_RequestPenetrationHole(Generator, BulletOrigin, BulletDirection, BulletPreset);
84void UIVSmokeHoleRequestComponent::RequestExplosionHole(AActor* Caller, AActor* IVSmokeVoxelVolume,
const FVector3f& ExplosionOrigin,
UIVSmokeHolePreset* ExplosionPreset)
88 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestExplosionHole] Caller is null"));
92 if (!IVSmokeVoxelVolume)
94 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestExplosionHole] IVSmokeVoxelVolume is null"));
100 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestExplosionHole] ExplosionPreset is null"));
107 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestExplosionHole] Generator not found on IVSmokeVoxelVolume"));
112 if (Generator->GetOwner() && Generator->GetOwner()->HasAuthority())
119 APawn* InstigatorPawn = Caller->GetInstigator();
122 InstigatorPawn = Cast<APawn>(Caller);
127 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestExplosionHole] InstigatorPawn not found"));
131 APlayerController* PC = Cast<APlayerController>(InstigatorPawn->GetController());
134 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestExplosionHole] PlayerController not found"));
141 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestExplosionHole] RequestComponent not found on PlayerController"));
145 Requester->Internal_RequestExplosionHole(Generator, ExplosionOrigin, ExplosionPreset);
148void UIVSmokeHoleRequestComponent::RequestDynamicHole(
150 AActor* IVSmokeVoxelVolume,
156 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestDynamicHole] Caller is null"));
160 if (!IVSmokeVoxelVolume)
162 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestDynamicHole] IVSmokeVoxelVolume is null"));
168 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestDynamicHole] DynamicPreset is null"));
175 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestDynamicHole] Generator not found on IVSmokeVoxelVolume"));
180 if (Generator->GetOwner() && Generator->GetOwner()->HasAuthority())
187 APawn* InstigatorPawn = Cast<APawn>(Caller);
190 InstigatorPawn = Caller->GetInstigator();
195 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestDynamicHole] InstigatorPawn not found"));
199 APlayerController* PC = Cast<APlayerController>(InstigatorPawn->GetController());
202 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestDynamicHole] PlayerController not found"));
209 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestDynamicHole] RequestComponent not found on PlayerController"));
213 Requester->Internal_RequestDynamicHole(Generator, Caller, DynamicPreset);
222 if (!IVSmokeHoleGeneratorComponent)
224 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestPenetrationHole] IVSmokeHoleGeneratorComponent is null"));
230 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestPenetrationHole] Preset is null"));
234 if (Preset->
HoleType != EIVSmokeHoleType::Penetration)
236 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestPenetrationHole] Preset type mismatch"));
245 if (!IVSmokeHoleGeneratorComponent)
247 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestExplosionHole] IVSmokeHoleGeneratorComponent is null"));
253 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestExplosionHole] Preset is null"));
257 if (Preset->
HoleType != EIVSmokeHoleType::Explosion)
259 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestExplosionHole] Preset type mismatch"));
268 if (!IVSmokeHoleGeneratorComponent)
270 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestDynamicHole] IVSmokeHoleGeneratorComponent is null"));
276 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestDynamicHole] Preset is null"));
280 if (Preset->
HoleType != EIVSmokeHoleType::Dynamic)
282 UE_LOG(LogIVSmoke, Warning, TEXT(
"[UIVSmokeHoleRequestComponent::RequestDynamicHole] Preset type mismatch"));
Component that generates hole texture for volumetric smoke. Provides public API for penetration and e...
void CreateExplosionHole(const FVector3f &Origin, const uint8 PresetID)
void CreatePenetrationHole(const FVector3f &Origin, const FVector3f &Direction, const uint8 PresetID)
void RegisterTrackDynamicHole(AActor *TargetActor, const uint8 PresetID)
FORCEINLINE uint8 GetPresetID() const
EIVSmokeHoleType HoleType
Handles network routing for hole requests. This component enables clients to request holes on VoxelVo...