Space Plunder
Loading...
Searching...
No Matches
ARoomActor Class Reference

#include <RoomActor.h>

Inheritance diagram for ARoomActor:
IDungeonRoom

Public Member Functions

 ARoomActor ()
 

Protected Member Functions

virtual void BeginPlay () override
 
bool GetShouldRoomSpawnDoor (const FRandomStream &Stream) const
 
bool GetCanHaveWindow () const
 
void HideRoof ()
 
FRandomStream GetRandomStream () const
 
bool GetIsRandomStreamSet () const
 
virtual USceneComponent * GetExitsRootComponent () const override
 
virtual USceneComponent * GetOverlapsRootComponent () const override
 
virtual USceneComponent * GetAISpawnsRootComponent () const override
 
virtual USceneComponent * GetWeaponSpawnsRootComponent () const override
 
virtual USceneComponent * GetLootSpawnsRootComponent () const override
 
virtual USceneComponent * GetDoorsRootComponent () const override
 
virtual int32 GetNumOfExits () const override
 
virtual FBox GetRoomBounds () const override
 
virtual EDungeonRoomType GetRoomType () const override
 
virtual bool GetShouldRoomSpawnDoorAtEntry (const FRandomStream &Stream) const override
 
virtual void AddAttachedRoom (AActor *Actor) override
 
virtual void ToggleAllRoomRoofs (const bool bForceHide) override
 
virtual void SetRandomStream (const FRandomStream &Stream) override
 
virtual void SetDynamicMaterial (UMaterialInterface *Material) override
 
virtual void SetActive (const bool bActive) override
 
virtual void SetOptimizationLevel (const int32 Level) override
 
void OnOptimizationLevelChanged (const int32 Level, const int32 PreviousLevel)
 
int32 GetOptimizationLevel () const
 
virtual void SetReady () override
 
void OnRoomReady ()
 
bool GetIsRoomReady () const
 
virtual void Activate ()
 
virtual void Deactivate ()
 
void ToggleLights (const bool bTurnOn) const
 
void TogglePhysicsObjects (const bool bSimulatePhysics, const bool bVisible) const
 
void TogglePhysicsObjectsSimulation (const bool bSimulatePhysics) const
 
void TogglePhysicsObjectsVisibility (const bool bVisible) const
 
void ToggleGeometry (const bool bVisible) const
 
void ToggleDecorations (const bool bVisible) const
 
bool GetCanBeWindow (UStaticMeshComponent *WallMesh) const
 

Protected Attributes

EDungeonRoomType RoomType = EDungeonRoomType::Hallway
 
bool bShouldDoorSpawn = true
 
bool bRandomDoorSpawn = false
 
float RandomWeight = 0.5f
 
bool bCheckForWindow = false
 
float WindowTraceDistance = 2000.0f
 
USceneComponent * DefaultRootComponent
 
USceneComponent * ExitsRootComponent
 
USceneComponent * OverlapsRootComponent
 
USceneComponent * AISpawnsRootComponent
 
USceneComponent * WeaponSpawnsRootComponent
 
USceneComponent * LootSpawnsRootComponent
 
USceneComponent * DoorsRootComponent
 
USceneComponent * LightsRootComponent
 
USceneComponent * GeometryRootComponent
 
USceneComponent * WallsRootComponent
 
USceneComponent * RoofRootComponent
 
USceneComponent * FloorRootComponent
 
USceneComponent * DecorationsRootComponent
 
USceneComponent * PropsRootComponent
 
UBoxComponent * BoundsComponent
 
bool bDebuggingMode = false
 
TArray< ARoomActor * > AttachedRooms
 
TArray< AActor * > DoorActors
 

Private Member Functions

void GetLightComponents ()
 
void GetPropComponents ()
 

Private Attributes

bool bReady = false
 
bool bRandomStreamSet = false
 
FRandomStream RandomStream
 
int32 Seed = 0
 
bool bShouldHideRoof = false
 
int32 OptimizationLevel = 0
 
int32 PreviousOptimizationLevel = 0
 
TArray< ULightComponent * > Lights
 
TArray< UStaticMeshComponent * > Props
 

Constructor & Destructor Documentation

◆ ARoomActor()

ARoomActor::ARoomActor ( )
16{
17 PrimaryActorTick.bCanEverTick = false;
18 DefaultRootComponent = CreateDefaultSubobject<USceneComponent>("Root");
19 RootComponent = DefaultRootComponent;
20 ExitsRootComponent = CreateDefaultSubobject<USceneComponent>("Exits");
21 ExitsRootComponent->SetupAttachment(RootComponent);
22 OverlapsRootComponent = CreateDefaultSubobject<USceneComponent>("Overlaps");
23 OverlapsRootComponent->SetupAttachment(RootComponent);
24 AISpawnsRootComponent = CreateDefaultSubobject<USceneComponent>("AI Spawns");
25 AISpawnsRootComponent->SetupAttachment(RootComponent);
26 WeaponSpawnsRootComponent = CreateDefaultSubobject<USceneComponent>("Weapon Spawns");
27 WeaponSpawnsRootComponent->SetupAttachment(RootComponent);
28 LootSpawnsRootComponent = CreateDefaultSubobject<USceneComponent>("Loot Spawns");
29 LootSpawnsRootComponent->SetupAttachment(RootComponent);
30 DoorsRootComponent = CreateDefaultSubobject<USceneComponent>("Doors");
31 DoorsRootComponent->SetupAttachment(RootComponent);
32
33
34 GeometryRootComponent = CreateDefaultSubobject<USceneComponent>("Geometry");
35 GeometryRootComponent->SetupAttachment(RootComponent);
36 WallsRootComponent = CreateDefaultSubobject<USceneComponent>("Walls");
38 RoofRootComponent = CreateDefaultSubobject<USceneComponent>("Roof");
40 FloorRootComponent = CreateDefaultSubobject<USceneComponent>("Floors");
42 DecorationsRootComponent = CreateDefaultSubobject<USceneComponent>("Decorations");
44 PropsRootComponent = CreateDefaultSubobject<USceneComponent>("Props");
46
47 LightsRootComponent = CreateDefaultSubobject<USceneComponent>("Lights");
48 LightsRootComponent->SetupAttachment(RootComponent);
49 BoundsComponent = CreateDefaultSubobject<UBoxComponent>("Bounds");
50 BoundsComponent->SetupAttachment(RootComponent);
51
52 bReplicates = true;
53 SetActorTickEnabled(false);
54}
USceneComponent * ExitsRootComponent
Definition RoomActor.h:67
USceneComponent * GeometryRootComponent
Definition RoomActor.h:85
USceneComponent * WallsRootComponent
Definition RoomActor.h:87
USceneComponent * FloorRootComponent
Definition RoomActor.h:91
USceneComponent * DoorsRootComponent
Definition RoomActor.h:80
USceneComponent * LightsRootComponent
Definition RoomActor.h:83
UBoxComponent * BoundsComponent
Definition RoomActor.h:100
USceneComponent * AISpawnsRootComponent
Definition RoomActor.h:72
USceneComponent * WeaponSpawnsRootComponent
Definition RoomActor.h:74
USceneComponent * OverlapsRootComponent
Definition RoomActor.h:69
USceneComponent * RoofRootComponent
Definition RoomActor.h:89
USceneComponent * DecorationsRootComponent
Definition RoomActor.h:94
USceneComponent * PropsRootComponent
Definition RoomActor.h:97
USceneComponent * DefaultRootComponent
Definition RoomActor.h:65
USceneComponent * LootSpawnsRootComponent
Definition RoomActor.h:76

Member Function Documentation

◆ Activate()

void ARoomActor::Activate ( )
protectedvirtual
222{
223 ToggleLights(true);
224 TogglePhysicsObjects(true, true);
225 ToggleGeometry(true);
226 ToggleDecorations(true);
227}
void ToggleGeometry(const bool bVisible) const
Definition RoomActor.cpp:264
void ToggleDecorations(const bool bVisible) const
Definition RoomActor.cpp:270
void TogglePhysicsObjects(const bool bSimulatePhysics, const bool bVisible) const
Definition RoomActor.cpp:243
void ToggleLights(const bool bTurnOn) const
Definition RoomActor.cpp:237

◆ AddAttachedRoom()

void ARoomActor::AddAttachedRoom ( AActor * Actor)
overrideprotectedvirtual

Implements IDungeonRoom.

103{
104 TRACE_CPUPROFILER_EVENT_SCOPE(ARoomActor::AddAttachedRoom);
105 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons);
106 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons_Rooms);
107 if(Actor == nullptr){return;}
108 ARoomActor* RoomActor = Cast<ARoomActor>(Actor);
109 if(RoomActor == nullptr){return;}
110 AttachedRooms.Add(RoomActor);
111}
Definition RoomActor.h:14
virtual void AddAttachedRoom(AActor *Actor) override
Definition RoomActor.cpp:102
TArray< ARoomActor * > AttachedRooms
Definition RoomActor.h:200

◆ BeginPlay()

void ARoomActor::BeginPlay ( )
overrideprotectedvirtual
58{
59 TRACE_CPUPROFILER_EVENT_SCOPE(ARoomActor::BeginPlay);
60 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons);
61 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons_Rooms);
62 Super::BeginPlay();
65 // if(bGetRandomStreamAtBegin && bRandomStreamSet == false)
66 // {
67 // const IProceduralGM* ProceduralGM = Cast<IProceduralGM>(UGameplayStatics::GetGameMode(this));
68 // if(ProceduralGM != nullptr)
69 // {
70 // RandomStream = ProceduralGM->GetRandomSeed();
71 // Seed = RandomStream.GetCurrentSeed();
72 // }
73 // }
74}
void GetLightComponents()
Definition RoomActor.cpp:295
void GetPropComponents()
Definition RoomActor.cpp:311
virtual void BeginPlay() override
Definition RoomActor.cpp:57

◆ Deactivate()

void ARoomActor::Deactivate ( )
protectedvirtual
230{
231 ToggleLights(false);
232 TogglePhysicsObjects(false, false);
233 ToggleGeometry(false);
234 ToggleDecorations(false);
235}

◆ GetAISpawnsRootComponent()

virtual USceneComponent * ARoomActor::GetAISpawnsRootComponent ( ) const
inlineoverrideprotectedvirtual

Implements IDungeonRoom.

131{return AISpawnsRootComponent;};

◆ GetCanBeWindow()

bool ARoomActor::GetCanBeWindow ( UStaticMeshComponent * WallMesh) const
protected
277{
278 WallMesh;
279 FVector StartLocation = WallMesh->GetComponentLocation();
280 FVector EndLocation = StartLocation + (StartLocation * WindowTraceDistance);
281 EDrawDebugTrace::Type DrawDebug = EDrawDebugTrace::None;
282 if(bDebuggingMode){DrawDebug = EDrawDebugTrace::ForDuration;}
283 TArray<AActor*> ActorsToIgnore;
284 FHitResult Hit;
285 const bool bHit = UKismetSystemLibrary::LineTraceSingle(this, StartLocation, EndLocation,
286 UEngineTypes::ConvertToTraceType(ECC_Visibility), false,
287 ActorsToIgnore, DrawDebug, Hit, true);
288 if(bHit)
289 {
290 return false;
291 }
292 return true;
293}
float WindowTraceDistance
Definition RoomActor.h:58
bool bDebuggingMode
Definition RoomActor.h:195

◆ GetCanHaveWindow()

bool ARoomActor::GetCanHaveWindow ( ) const
protected
77{
78
79 return false;
80}

◆ GetDoorsRootComponent()

virtual USceneComponent * ARoomActor::GetDoorsRootComponent ( ) const
inlineoverrideprotectedvirtual

Implements IDungeonRoom.

134{return DoorsRootComponent;};

◆ GetExitsRootComponent()

virtual USceneComponent * ARoomActor::GetExitsRootComponent ( ) const
inlineoverrideprotectedvirtual

Implements IDungeonRoom.

129{return ExitsRootComponent;};

◆ GetIsRandomStreamSet()

bool ARoomActor::GetIsRandomStreamSet ( ) const
inlineprotected
39{return bRandomStreamSet;};
bool bRandomStreamSet
Definition RoomActor.h:214

◆ GetIsRoomReady()

bool ARoomActor::GetIsRoomReady ( ) const
inlineprotected
169{return bReady;};
bool bReady
Definition RoomActor.h:211

◆ GetLightComponents()

void ARoomActor::GetLightComponents ( )
private
296{
297 TRACE_CPUPROFILER_EVENT_SCOPE(ARoomActor::GetLightComponents);
298 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons);
299 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons_Rooms);
300 if(LightsRootComponent == nullptr){UE_LOG(LogRoomActor, Warning, TEXT("ARoomActor::GetLightComponents LightsRootComponent Null"));return;}
301 TArray<USceneComponent*> AllChildrenComponents;
302 LightsRootComponent->GetChildrenComponents(true, AllChildrenComponents);
303 for(const auto ChildComponent : AllChildrenComponents)
304 {
305 ULightComponent* LightComponent = Cast<ULightComponent>(ChildComponent);
306 if(LightComponent == nullptr){UE_LOG(LogRoomActor, Warning, TEXT("ARoomActor::GetLightComponents %s is not a Light On %s"), *ChildComponent->GetReadableName(), *GetHumanReadableName());continue;}
307 Lights.AddUnique(LightComponent);
308 }
309}
TArray< ULightComponent * > Lights
Definition RoomActor.h:229

◆ GetLootSpawnsRootComponent()

virtual USceneComponent * ARoomActor::GetLootSpawnsRootComponent ( ) const
inlineoverrideprotectedvirtual

Implements IDungeonRoom.

◆ GetNumOfExits()

int32 ARoomActor::GetNumOfExits ( ) const
overrideprotectedvirtual

Implements IDungeonRoom.

91{
92 return ExitsRootComponent->GetNumChildrenComponents();
93}

◆ GetOptimizationLevel()

int32 ARoomActor::GetOptimizationLevel ( ) const
inlineprotected
163{return OptimizationLevel;}
int32 OptimizationLevel
Definition RoomActor.h:223

◆ GetOverlapsRootComponent()

virtual USceneComponent * ARoomActor::GetOverlapsRootComponent ( ) const
inlineoverrideprotectedvirtual

Implements IDungeonRoom.

130{return OverlapsRootComponent;};

◆ GetPropComponents()

void ARoomActor::GetPropComponents ( )
private
312{
313 TRACE_CPUPROFILER_EVENT_SCOPE(ARoomActor::GetPropComponents);
314 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons);
315 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons_Rooms);
316 if(PropsRootComponent == nullptr){UE_LOG(LogRoomActor, Warning, TEXT("ARoomActor::GetPropComponents PropsRootComponent Null"));return;}
317 TArray<USceneComponent*> AllChildrenComponents;
318 PropsRootComponent->GetChildrenComponents(true, AllChildrenComponents);
319 for(const auto ChildComponent : AllChildrenComponents)
320 {
321 UStaticMeshComponent* StaticMeshComponent = Cast<UStaticMeshComponent>(ChildComponent);
322 if(StaticMeshComponent == nullptr){UE_LOG(LogRoomActor, Warning, TEXT("ARoomActor::GetPropComponents %s is not a Static Mesh On %s"), *ChildComponent->GetReadableName(), *GetHumanReadableName());continue;}
323 Props.AddUnique(StaticMeshComponent);
324 }
325}
TArray< UStaticMeshComponent * > Props
Definition RoomActor.h:231

◆ GetRandomStream()

FRandomStream ARoomActor::GetRandomStream ( ) const
inlineprotected
37{return RandomStream;};
FRandomStream RandomStream
Definition RoomActor.h:216

◆ GetRoomBounds()

FBox ARoomActor::GetRoomBounds ( ) const
overrideprotectedvirtual

Implements IDungeonRoom.

97{
98 if(BoundsComponent == nullptr){return FBox();}
99 return BoundsComponent->Bounds.GetBox();
100}

◆ GetRoomType()

virtual EDungeonRoomType ARoomActor::GetRoomType ( ) const
inlineoverrideprotectedvirtual

Implements IDungeonRoom.

138{return RoomType;};
EDungeonRoomType RoomType
Definition RoomActor.h:42

◆ GetShouldRoomSpawnDoor()

bool ARoomActor::GetShouldRoomSpawnDoor ( const FRandomStream & Stream) const
protected

◆ GetShouldRoomSpawnDoorAtEntry()

virtual bool ARoomActor::GetShouldRoomSpawnDoorAtEntry ( const FRandomStream & Stream) const
inlineoverrideprotectedvirtual

Implements IDungeonRoom.

bool GetShouldRoomSpawnDoor(const FRandomStream &Stream) const

◆ GetWeaponSpawnsRootComponent()

virtual USceneComponent * ARoomActor::GetWeaponSpawnsRootComponent ( ) const
inlineoverrideprotectedvirtual

Implements IDungeonRoom.

◆ HideRoof()

void ARoomActor::HideRoof ( )
protected
83{
84 TRACE_CPUPROFILER_EVENT_SCOPE(ARoomActor::HideRoof);
85 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons);
86 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons_Rooms);
88}
virtual void ToggleAllRoomRoofs(const bool bForceHide) override
Definition RoomActor.cpp:113
void HideRoof()
Definition RoomActor.cpp:82

◆ OnOptimizationLevelChanged()

void ARoomActor::OnOptimizationLevelChanged ( const int32 Level,
const int32 PreviousLevel )
protected

◆ OnRoomReady()

void ARoomActor::OnRoomReady ( )
protected

◆ SetActive()

void ARoomActor::SetActive ( const bool bActive)
overrideprotectedvirtual

Implements IDungeonRoom.

207{
208 TRACE_CPUPROFILER_EVENT_SCOPE(ARoomActor::SetActive);
209 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons);
210 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons_Rooms);
211 if(bActive)
212 {
213 Activate();
214 }
215 else
216 {
217 Deactivate();
218 }
219}
virtual void Deactivate()
Definition RoomActor.cpp:229
virtual void SetActive(const bool bActive) override
Definition RoomActor.cpp:206
virtual void Activate()
Definition RoomActor.cpp:221

◆ SetDynamicMaterial()

void ARoomActor::SetDynamicMaterial ( UMaterialInterface * Material)
overrideprotectedvirtual

Implements IDungeonRoom.

140{
141 TRACE_CPUPROFILER_EVENT_SCOPE(ARoomActor::SetDynamicMaterial);
142 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons);
143 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons_Rooms);
144 TArray<USceneComponent*> ChildrenMeshes;
145 GeometryRootComponent->GetChildrenComponents(true, ChildrenMeshes);
146 for(const auto Child : ChildrenMeshes)
147 {
148 if(Child == nullptr){continue;}
149 UStaticMeshComponent* MeshChild = Cast<UStaticMeshComponent>(Child);
150 if(MeshChild == nullptr){continue;}
151 const FName MaterialSlotName = MeshChild->GetMaterialSlotNames()[0];
152 if(bDebuggingMode){UE_LOG(LogRoomActor, Warning, TEXT("ARoomActor::SetDynamicMaterial Material Slot Name: %s"), *MaterialSlotName.ToString());}
153 MeshChild->SetMaterial(0, Material);
154 }
155}
virtual void SetDynamicMaterial(UMaterialInterface *Material) override
Definition RoomActor.cpp:139

◆ SetOptimizationLevel()

void ARoomActor::SetOptimizationLevel ( const int32 Level)
overrideprotectedvirtual

Implements IDungeonRoom.

158{
159 TRACE_CPUPROFILER_EVENT_SCOPE(ARoomActor::SetOptimizationLevel);
160 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons);
161 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons_Rooms);
164 switch (OptimizationLevel)
165 {
166 case 0: // Everything on
167 ToggleGeometry(true);
168 ToggleLights(true);
169 TogglePhysicsObjects(true, true);
170 ToggleDecorations(true);
171 break;
172 case 1: // Physics Sim off, Decorations Off
173 ToggleGeometry(true);
174 ToggleLights(true);
175 TogglePhysicsObjects(false, true);
176 ToggleDecorations(false);
177 break;
178 case 2: // Physics Objects gone, Lights Gone
179 ToggleGeometry(true);
180 ToggleLights(false);
181 TogglePhysicsObjects(false, false);
182 ToggleDecorations(false);
183 break;
184 case 3: // All Geometry gone
185 default:
186 ToggleGeometry(false);
187 ToggleLights(false);
188 TogglePhysicsObjects(false, false);
189 ToggleDecorations(false);
190 break;
191 }
192
194}
void OnOptimizationLevelChanged(const int32 Level, const int32 PreviousLevel)
int32 PreviousOptimizationLevel
Definition RoomActor.h:225
virtual void SetOptimizationLevel(const int32 Level) override
Definition RoomActor.cpp:157

◆ SetRandomStream()

void ARoomActor::SetRandomStream ( const FRandomStream & Stream)
overrideprotectedvirtual

If the room needs access to any random Elements

Implements IDungeonRoom.

130{
131 TRACE_CPUPROFILER_EVENT_SCOPE(ARoomActor::SetRandomStream);
132 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons);
133 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons_Rooms);
134 RandomStream = Stream;
135 Seed = RandomStream.GetInitialSeed();
136 bRandomStreamSet = true;
137}
virtual void SetRandomStream(const FRandomStream &Stream) override
Definition RoomActor.cpp:129
int32 Seed
Definition RoomActor.h:218

◆ SetReady()

void ARoomActor::SetReady ( )
overrideprotectedvirtual

Implements IDungeonRoom.

197{
198 bReady = true;
199 OnRoomReady();
201 {
202 //GetCanBeWindow()
203 }
204}
void OnRoomReady()
bool bCheckForWindow
Definition RoomActor.h:55

◆ ToggleAllRoomRoofs()

void ARoomActor::ToggleAllRoomRoofs ( const bool bForceHide)
overrideprotectedvirtual

Implements IDungeonRoom.

114{
115 TRACE_CPUPROFILER_EVENT_SCOPE(ARoomActor::ToggleAllRoomRoofs);
116 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons);
117 SCOPE_CYCLE_COUNTER(STAT_ProceduralDungeons_Rooms);
118 if(RoofRootComponent == nullptr){return;}
119 if(bForceHide)
120 {
121 RoofRootComponent->SetVisibility(false, true);
122 bShouldHideRoof = true;
123 return;
124 }
125 const bool bCurrentVisibility = RoofRootComponent->GetVisibleFlag();
126 RoofRootComponent->SetVisibility(!bCurrentVisibility, true);
127}
bool bShouldHideRoof
Definition RoomActor.h:221

◆ ToggleDecorations()

void ARoomActor::ToggleDecorations ( const bool bVisible) const
protected
271{
272 if(DecorationsRootComponent == nullptr){UE_LOG(LogRoomActor, Warning, TEXT("ARoomActor::ToggleDecorations DecorationsRootComponent Null"));return;}
273 DecorationsRootComponent->SetVisibility(bVisible, true);
274}

◆ ToggleGeometry()

void ARoomActor::ToggleGeometry ( const bool bVisible) const
protected
265{
266 if(GeometryRootComponent == nullptr){UE_LOG(LogRoomActor, Warning, TEXT("ARoomActor::ToggleGeometry GeometryRootComponent Null"));return;}
267 GeometryRootComponent->SetVisibility(bVisible, true);
268}

◆ ToggleLights()

void ARoomActor::ToggleLights ( const bool bTurnOn) const
protected
238{
239 if(LightsRootComponent == nullptr){UE_LOG(LogRoomActor, Warning, TEXT("ARoomActor::ToggleLights LightsRootComponent Null"));return;}
240 LightsRootComponent->SetVisibility(bTurnOn, true);
241}

◆ TogglePhysicsObjects()

void ARoomActor::TogglePhysicsObjects ( const bool bSimulatePhysics,
const bool bVisible ) const
protected
244{
245 TogglePhysicsObjectsSimulation(bSimulatePhysics);
247}
void TogglePhysicsObjectsVisibility(const bool bVisible) const
Definition RoomActor.cpp:258
void TogglePhysicsObjectsSimulation(const bool bSimulatePhysics) const
Definition RoomActor.cpp:249

◆ TogglePhysicsObjectsSimulation()

void ARoomActor::TogglePhysicsObjectsSimulation ( const bool bSimulatePhysics) const
protected
250{
251 for(UStaticMeshComponent* Prop : Props)
252 {
253 if(Prop == nullptr){continue;}
254 Prop->SetSimulatePhysics(bSimulatePhysics);
255 }
256}

◆ TogglePhysicsObjectsVisibility()

void ARoomActor::TogglePhysicsObjectsVisibility ( const bool bVisible) const
protected
259{
260 if(PropsRootComponent == nullptr){UE_LOG(LogRoomActor, Warning, TEXT("ARoomActor::TogglePhysicsObjectsVisibility PropsRootComponent Null"));return;}
261 PropsRootComponent->SetVisibility(bVisible, true);
262}

Member Data Documentation

◆ AISpawnsRootComponent

USceneComponent* ARoomActor::AISpawnsRootComponent
protected

◆ AttachedRooms

TArray<ARoomActor*> ARoomActor::AttachedRooms
protected

◆ bCheckForWindow

bool ARoomActor::bCheckForWindow = false
protected

◆ bDebuggingMode

bool ARoomActor::bDebuggingMode = false
protected

◆ BoundsComponent

UBoxComponent* ARoomActor::BoundsComponent
protected

◆ bRandomDoorSpawn

bool ARoomActor::bRandomDoorSpawn = false
protected

Should it be random if the door is spawned

◆ bRandomStreamSet

bool ARoomActor::bRandomStreamSet = false
private

◆ bReady

bool ARoomActor::bReady = false
private

◆ bShouldDoorSpawn

bool ARoomActor::bShouldDoorSpawn = true
protected

Should a door spawn at the start of this room, Corridors etc.

◆ bShouldHideRoof

bool ARoomActor::bShouldHideRoof = false
private

◆ DecorationsRootComponent

USceneComponent* ARoomActor::DecorationsRootComponent
protected

◆ DefaultRootComponent

USceneComponent* ARoomActor::DefaultRootComponent
protected

◆ DoorActors

TArray<AActor*> ARoomActor::DoorActors
protected

◆ DoorsRootComponent

USceneComponent* ARoomActor::DoorsRootComponent
protected

◆ ExitsRootComponent

USceneComponent* ARoomActor::ExitsRootComponent
protected

◆ FloorRootComponent

USceneComponent* ARoomActor::FloorRootComponent
protected

◆ GeometryRootComponent

USceneComponent* ARoomActor::GeometryRootComponent
protected

◆ Lights

TArray<ULightComponent*> ARoomActor::Lights
private

◆ LightsRootComponent

USceneComponent* ARoomActor::LightsRootComponent
protected

◆ LootSpawnsRootComponent

USceneComponent* ARoomActor::LootSpawnsRootComponent
protected

◆ OptimizationLevel

int32 ARoomActor::OptimizationLevel = 0
private

◆ OverlapsRootComponent

USceneComponent* ARoomActor::OverlapsRootComponent
protected

◆ PreviousOptimizationLevel

int32 ARoomActor::PreviousOptimizationLevel = 0
private

◆ Props

TArray<UStaticMeshComponent*> ARoomActor::Props
private

◆ PropsRootComponent

USceneComponent* ARoomActor::PropsRootComponent
protected

◆ RandomStream

FRandomStream ARoomActor::RandomStream
private

◆ RandomWeight

float ARoomActor::RandomWeight = 0.5f
protected

Range of weight is 0.0 - 1.0 E. g., Weight = .6 return value = True 60% of the time

◆ RoofRootComponent

USceneComponent* ARoomActor::RoofRootComponent
protected

◆ RoomType

EDungeonRoomType ARoomActor::RoomType = EDungeonRoomType::Hallway
protected

◆ Seed

int32 ARoomActor::Seed = 0
private

◆ WallsRootComponent

USceneComponent* ARoomActor::WallsRootComponent
protected

◆ WeaponSpawnsRootComponent

USceneComponent* ARoomActor::WeaponSpawnsRootComponent
protected

◆ WindowTraceDistance

float ARoomActor::WindowTraceDistance = 2000.0f
protected

How far do we trace to check if a window can be placed


The documentation for this class was generated from the following files: