CARLA
 
载入中...
搜索中...
未找到
ProceduralBuilding.cpp
浏览该文件的文档.
1// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). This work is licensed under the terms of the MIT license. For a copy, see <https://opensource.org/licenses/MIT>.
2
3
5
6
7// Sets default values
9{
10 // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
11 PrimaryActorTick.bCanEverTick = true;
12
13 SideVisibility.Init(true, 4);
14 CornerVisibility.Init(true, 4);
15 UseWallMesh.Init(false, 4);
16
17 RootSMComp = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("RootComponent"));
18 RootComponent = RootSMComp;
19 RootComponent->SetMobility(EComponentMobility::Static);
20}
21
22UHierarchicalInstancedStaticMeshComponent* AProceduralBuilding::GetHISMComp(
23 const UStaticMesh* SM)
24{
25
26 FString SMName = SM->GetName();
27
28 UHierarchicalInstancedStaticMeshComponent** HISMCompPtr = HISMComps.Find(SMName);
29
30 if(HISMCompPtr) return *HISMCompPtr;
31
32 UHierarchicalInstancedStaticMeshComponent* HISMComp = *HISMCompPtr;
33
34 // If it doesn't exist, create the component
35 HISMComp = NewObject<UHierarchicalInstancedStaticMeshComponent>(this,
36 FName(*FString::Printf(TEXT("HISMComp_%d"), HISMComps.Num())));
37 HISMComp->SetupAttachment(RootComponent);
38 HISMComp->RegisterComponent();
39
40 // Set the mesh that will be used
41 HISMComp->SetStaticMesh(const_cast<UStaticMesh*>(SM));
42
43 // Add to the map
44 HISMComps.Emplace(SMName, HISMComp);
45
46 return HISMComp;
47}
48
50
51 for (UChildActorComponent *ChildComp : ChildActorComps) {
52
53 ChildComp->SetMobility(EComponentMobility::Type::Static);
54 }
55}
56
58{
59 AProceduralBuilding* ProceduralBuilding = nullptr;
60
61 // Look for all the HISMComps
62 TArray<UHierarchicalInstancedStaticMeshComponent*> OtherHISMComps;
63 BP_Building->GetComponents<UHierarchicalInstancedStaticMeshComponent>(OtherHISMComps);
64
65 for(UHierarchicalInstancedStaticMeshComponent* OtherHISMComp : OtherHISMComps)
66 {
67 const UStaticMesh* SM = OtherHISMComp->GetStaticMesh();
68
69 // Create a new HISMComp and set the SM
70 UHierarchicalInstancedStaticMeshComponent* NewHISMComp = GetHISMComp(SM);
71
72 // Create the instances
73 const TArray<FInstancedStaticMeshInstanceData>& PerInstanceSMData = OtherHISMComp->PerInstanceSMData;
74
75 for(const FInstancedStaticMeshInstanceData& InstSMIData : PerInstanceSMData)
76 {
77 FTransform Transform = FTransform(InstSMIData.Transform);
78
79 NewHISMComp->AddInstance(Transform);
80 }
81 }
82
83 // TODO: Look for all ChildActors -> Add new Child
84 TArray<UChildActorComponent*> OtherChildComps;
85 BP_Building->GetComponents<UChildActorComponent>(OtherChildComps);
86
87 for(const UChildActorComponent* OtherChildActor : OtherChildComps)
88 {
89 // Create a new ChildActorComponent
90 UChildActorComponent* ChildActorComp = NewObject<UChildActorComponent>(this,
91 FName(*FString::Printf(TEXT("ChildActorComp_%d"), ChildActorComps.Num() )));
92 ChildActorComp->SetMobility(EComponentMobility::Type::Static);
93 ChildActorComp->SetupAttachment(RootComponent);
94
95 // Set the class that it will use
96 ChildActorComp->SetChildActorClass(OtherChildActor->GetChildActorClass());
97 ChildActorComp->SetRelativeTransform(OtherChildActor->GetRelativeTransform());
98
99 // Spawns the actor referenced by UChildActorComponent
100 ChildActorComp->RegisterComponent();
101
102 AActor* NewChildActor = ChildActorComp->GetChildActor();
103
104#if WITH_EDITOR
105 // Add the child actor to a subfolder of the actor's name
106 NewChildActor->SetFolderPath(FName( *FString::Printf(TEXT("/Buildings/%s"), *GetName())));
107 #endif
108
109 // Look for all the SMComps
110 TArray<UStaticMeshComponent*> NewSMComps;
111 NewChildActor->GetComponents<UStaticMeshComponent>(NewSMComps);
112
113 // Make it invisible on the child actor to avoid duplication with the HISMComp
114 UStaticMeshComponent* PivotSMComp = NewSMComps[0];
115 PivotSMComp->SetVisibility(false, false);
116
117 ChildActorComps.Emplace(ChildActorComp);
118
119 }
120}
121
123{
124 for(UChildActorComponent* ChildActorComp : ChildActorComps)
125 {
126 AActor* ChildActor = ChildActorComp->GetChildActor();
127 TArray<UStaticMeshComponent*> SMComps;
128 ChildActor->GetComponents<UStaticMeshComponent>(SMComps);
129 if(SMComps.Num() > 0)
130 {
131 SMComps[0]->SetVisibility(false, false);
132 }
133 }
134}
135
137 const TSet<int>& InDoorsIndexPosition,
138 const TArray<bool>& InUseWallMesh,
139 int InNumFloors,
140 int InLengthX,
141 int InLengthY,
142 bool InCorners,
143 bool InUseFullBlocks)
144{
145 DoorsIndexPosition = InDoorsIndexPosition;
146 UseWallMesh = InUseWallMesh;
147 NumFloors = InNumFloors;
148 LengthX = InLengthX;
149 LengthY = InLengthY;
150 Corners = InCorners;
151 UseFullBlocks = InUseFullBlocks;
152}
153
155 const TArray<bool>& InSideVisibility,
156 const TArray<bool>& InCornerVisibility,
157 bool InRoofVisibility)
158{
159 SideVisibility = InSideVisibility;
160 CornerVisibility = InCornerVisibility;
161 RoofVisibility = InRoofVisibility;
162}
163
165 const TArray<UStaticMesh*>& InBaseMeshes,
166 const TArray<TSubclassOf<AActor>>& InBaseBPs,
167 const TArray<UStaticMesh*>& InCornerBaseMeshes,
168 const TArray<TSubclassOf<AActor>>& InCornerBaseBPs,
169 const TArray<UStaticMesh*>& InDoorMeshes,
170 const TArray<TSubclassOf<AActor>>& InDoorBPs)
171{
172 BaseMeshes = InBaseMeshes;
173 BaseBPs = InBaseBPs;
174 CornerBaseMeshes = InCornerBaseMeshes;
175 CornerBaseBPs = InCornerBaseBPs;
176 DoorMeshes = InDoorMeshes;
177 DoorBPs = InDoorBPs;
178}
179
181 const TArray<UStaticMesh*>& InBodyMeshes,
182 const TArray<TSubclassOf<AActor>>& InBodyBPs,
183 const TArray<UStaticMesh*>& InCornerBodyMeshes,
184 const TArray<TSubclassOf<AActor>>& InCornerBodyBPs,
185 const TArray<UStaticMesh*>& InWallMeshes,
186 const TArray<TSubclassOf<AActor>>& InWallBPs)
187{
188 BodyMeshes = InBodyMeshes;
189 BodyBPs = InBodyBPs;
190 CornerBodyMeshes = InCornerBodyMeshes;
191 CornerBodyBPs = InCornerBodyBPs;
192 WallMeshes = InWallMeshes;
193 WallBPs = InWallBPs;
194}
195
197 const TArray<UStaticMesh*>& InTopMeshes,
198 const TArray<TSubclassOf<AActor>>& InTopBPs,
199 const TArray<UStaticMesh*>& InCornerTopMeshes,
200 const TArray<TSubclassOf<AActor>>& InCornerTopBPs,
201 const TArray<UStaticMesh*>& InRoofMeshes,
202 const TArray<TSubclassOf<AActor>>& InRoofBPs)
203{
204 TopMeshes = InTopMeshes;
205 TopBPs = InTopBPs;
206 CornerTopMeshes = InCornerTopMeshes;
207 CornerTopBPs = InCornerTopBPs;
208 RoofMeshes = InRoofMeshes;
209 RoofBPs = InRoofBPs;
210}
211
213{
214 Init();
215
216 // Base Floor
219 true,
220 false);
221
222 // Body floors
223 const FloorMeshCollection BodyMeshCollection =
225 for(int i = 0; i < NumFloors; i++)
226 {
227 CreateFloor(BodyMeshCollection, false, true);
228 }
229
230 // Top floor
233 false,
234 false);
235
236 // Roof
237 CreateRoof();
238
239}
240
242{
243 CurrentTransform = FTransform::Identity;
244
245 // Discard previous calculation
246 SidesLength.Reset();
247
248 const TSet <UActorComponent*> Comps = GetComponents();
249
250 // Remove all the instances of each HISMComp
251 for(auto& It : HISMComps)
252 {
253 const FString& MeshName = It.Key;
254 UHierarchicalInstancedStaticMeshComponent* HISMComp = It.Value;
255
256 HISMComp->ClearInstances();
257 }
258 // Empties out the map but preserves all allocations and capacities
259 HISMComps.Reset();
260
261 // Remove all child actors
262 for(UChildActorComponent* ChildActorComp : ChildActorComps)
263 {
264 if(ChildActorComp)
265 {
266 ChildActorComp->DestroyComponent();
267 }
268 }
269 ChildActorComps.Reset();
270
271}
272
274{
275 Reset();
276
278}
279
281 const FloorMeshCollection& MeshCollection,
282 bool IncludeDoors,
283 bool IncludeWalls)
284{
285 float MaxZ = 0.0f;
286
287 // Stores the total length covered. This is needed to place the doors.
288 int SideLengthAcumulator = 0;
289
290 for(int i = 0; i < SidesLength.Num(); i++)
291 {
292 TSet<int> AuxiliarPositions;
293 int SideLength = SidesLength[i];
294 bool MainVisibility = true;
295 bool CornerVisbility = true;
296
297 if (IncludeDoors)
298 {
299 AuxiliarPositions = CalculateDoorsIndexInSide(SideLengthAcumulator, SideLength);
300 }
301 if(IncludeWalls && UseWallMesh[i])
302 {
303 AuxiliarPositions = GenerateWallsIndexPositions(SideLength);
304 }
305
306 CalculateSideVisibilities(i, MainVisibility, CornerVisbility);
307
308 // Update Max Z
309 float SideMaxZ = CreateSide(MeshCollection, AuxiliarPositions, SideLength, MainVisibility, CornerVisbility);
310 MaxZ = (MaxZ < SideMaxZ) ? SideMaxZ : MaxZ;
311
312 // Update the acumulator to calculate doors index in next sides
313 SideLengthAcumulator += SideLength;
314
315 // Update transform rotation for the next side
316 if(!UseFullBlocks)
317 {
318 const FQuat RotationToAdd = FRotator(0.0f, 90.0f, 0.0f).Quaternion();
319 CurrentTransform.ConcatenateRotation(RotationToAdd);
320 }
321 }
322
323 // Update transform for the next floor
324 FVector NewLocation = CurrentTransform.GetTranslation() + FVector(0.0f, 0.0f, MaxZ);
325 CurrentTransform.SetTranslation(NewLocation);
326
327}
328
330{
331 UStaticMesh* SelectedMesh = nullptr;
332 TSubclassOf<AActor> SelectedBP = nullptr;
333 FBox SelectedMeshBounds;
334
335 bool AreRoofMeshesAvailable = (RoofMeshes.Num() > 0) || (RoofBPs.Num() > 0);
336
337 // Hack for top meshes. Perhaps the top part has a little part of the roof
338 FVector BoxSize = LastSelectedMeshBounds.GetSize();
339 BoxSize = FVector(0.0f, -BoxSize.Y, 0.0f);
340
341 CurrentTransform.SetTranslation(CurrentTransform.GetTranslation() + BoxSize);
342
343 if(AreRoofMeshesAvailable)
344 {
345
346 for(int i = 0; i < LengthY; i++)
347 {
348 FVector PivotLocation = CurrentTransform.GetTranslation();
349 for(int j = 0; j < LengthX; j++)
350 {
351 // Choose a roof mesh
352 ChooseGeometryToSpawn(RoofMeshes, RoofBPs, &SelectedMesh, &SelectedBP);
353
354 AddChunck(SelectedMesh, SelectedBP, RoofVisibility, SelectedMeshBounds);
355
356 }
357 // Move the Transform location to the beginning of the next row
358 CurrentTransform.SetTranslation(PivotLocation);
359 UpdateTransformPositionToNextSide(SelectedMeshBounds);
360 }
361 }
362
363
364}
365
367 const FloorMeshCollection& MeshCollection,
368 const TSet<int>& AuxiliarPositions,
369 int SideLength,
370 bool MainVisibility,
371 bool CornerVisbility)
372{
373 const TArray<UStaticMesh*>* MainMeshes = MeshCollection.MainMeshes;
374 const TArray<TSubclassOf<AActor>>* MainBPs = MeshCollection.MainBPs;
375 const TArray<UStaticMesh*>* CornerMeshes = MeshCollection.CornerMeshes;
376 const TArray<TSubclassOf<AActor>>* CornerBPs = MeshCollection.CornerBPs;
377 const TArray<UStaticMesh*>* AuxiliarMeshes = MeshCollection.AuxiliarMeshes;
378 const TArray<TSubclassOf<AActor>>* AuxiliarBPs = MeshCollection.AuxiliarBPs;
379
380 /**
381 * Main part
382 */
383
384 UStaticMesh* SelectedMesh = nullptr;
385 TSubclassOf<AActor> SelectedBP = nullptr;
386 FBox SelectedMeshBounds;
387 float MaxZ = 0.0f;
388
389 // Check to know if there are meshes for the main part available
390 bool AreMainMeshesAvailable = (MainMeshes && (MainMeshes->Num() > 0)) || (MainBPs && (MainBPs->Num() > 0));
391 bool AreAuxMeshesAvailable = (MainMeshes && (MainMeshes->Num() > 0)) || (MainBPs && (MainBPs->Num() > 0));
392
393 for(int i = 0; (i < SideLength) && AreMainMeshesAvailable; i++)
394 {
395 const int* AuxiliarPosition = AuxiliarPositions.Find(i);
396 if(AreAuxMeshesAvailable && AuxiliarPosition)
397 {
398 // Choose an auxiliar mesh
399 ChooseGeometryToSpawn(*AuxiliarMeshes, *AuxiliarBPs, &SelectedMesh, &SelectedBP);
400 }
401 else
402 {
403 // Choose a main mesh
404 ChooseGeometryToSpawn(*MainMeshes, *MainBPs, &SelectedMesh, &SelectedBP);
405 }
406
407 float ChunkZ = AddChunck(SelectedMesh, SelectedBP, MainVisibility, SelectedMeshBounds);
408 MaxZ = (MaxZ < ChunkZ) ? ChunkZ : MaxZ;
409 }
410
411 /**
412 * Corner part
413 */
414 bool AreCornerMeshesAvailable = (CornerMeshes && (CornerMeshes->Num() > 0)) || (CornerBPs && (CornerBPs->Num() > 0));
415 if(Corners && AreCornerMeshesAvailable)
416 {
417 // Choose a corner mesh
418 ChooseGeometryToSpawn(*CornerMeshes, *CornerBPs, &SelectedMesh, &SelectedBP);
419 float ChunkZ = AddChunck(SelectedMesh, SelectedBP, CornerVisbility, SelectedMeshBounds);
420 MaxZ = (MaxZ < ChunkZ) ? ChunkZ : MaxZ;
421
422 // Move the Transform location to the next side of the building
423 // because corners can be in two sides
424 UpdateTransformPositionToNextSide(SelectedMeshBounds);
425 }
426
427 LastSelectedMeshBounds = SelectedMeshBounds;
428
429 return MaxZ;
430}
431
433{
434 // Discard previous calculation
435 SidesLength.Reset();
436
437 if(UseFullBlocks)
438 {
439 // The full block configuration covers all the sides of the floor with one mesh
440 SidesLength.Emplace(1);
441 }
442 else
443 {
444 SidesLength.Emplace(LengthX);
445 SidesLength.Emplace(LengthY);
446 SidesLength.Emplace(LengthX);
447 SidesLength.Emplace(LengthY);
448 }
449
450}
451
452TSet<int> AProceduralBuilding::CalculateDoorsIndexInSide(int StartIndex, int Length)
453{
454 TSet<int> Result;
455 int MaxIndex = StartIndex + Length;
456
457 for(int i : DoorsIndexPosition)
458 {
459 if( StartIndex <= i && i < MaxIndex )
460 {
461 int RelativePostion = i - StartIndex;
462 Result.Emplace(RelativePostion);
463 }
464 }
465 return Result;
466}
467
469{
470 TSet<int> Result;
471 for(int i = 0; i < Length; i++)
472 {
473 Result.Emplace(i);
474 }
475 return Result;
476}
477
478void AProceduralBuilding::CalculateSideVisibilities(int SideIndex, bool& MainVisibility, bool& CornerVisbility)
479{
480 MainVisibility = UseFullBlocks || SideVisibility[SideIndex];
481 CornerVisbility = UseFullBlocks || CornerVisibility[SideIndex];
482}
483
485 const TArray<UStaticMesh*>& InMeshes,
486 const TArray<TSubclassOf<AActor>>& InBPs,
487 UStaticMesh** OutMesh = nullptr,
488 TSubclassOf<AActor>* OutBP = nullptr)
489{
490 int NumMeshes = InMeshes.Num();
491 int NumBPs = InBPs.Num();
492 int Range = NumMeshes + NumBPs;
493
494 int Choosen = FMath::RandRange(0, Range - 1);
495
496 if(Choosen < NumMeshes)
497 {
498 *OutMesh = InMeshes[Choosen];
499 }
500 if(NumMeshes <= Choosen && Choosen < NumBPs)
501 {
502 *OutBP = InBPs[Choosen - NumMeshes];
503 }
504}
505
507 const UStaticMesh* SelectedMesh,
508 const TSubclassOf<AActor> SelectedBP,
509 bool Visible,
510 FBox& OutSelectedMeshBounds)
511{
512 float Result = 0.0f;
513
514 // Static Mesh
515 if(SelectedMesh)
516 {
517 if(Visible)
518 {
519 AddMeshToBuilding(SelectedMesh);
520 }
521 FVector MeshBound = GetMeshSize(SelectedMesh);
522 Result = MeshBound.Z;
523
525 OutSelectedMeshBounds = SelectedMesh->GetBoundingBox();
526 }
527 // BP
528 else if(SelectedBP)
529 {
530 // Create a new ChildActorComponent
531 UChildActorComponent* ChildActorComp = NewObject<UChildActorComponent>(this,
532 FName(*FString::Printf(TEXT("ChildActorComp_%d"), ChildActorComps.Num() )));
533 ChildActorComp->SetMobility(EComponentMobility::Type::Static);
534 ChildActorComp->SetupAttachment(RootComponent);
535
536 // Set the class that it will use
537 ChildActorComp->SetChildActorClass(SelectedBP);
538 ChildActorComp->SetRelativeTransform(CurrentTransform);
539
540 // Spawns the actor referenced by UChildActorComponent
541 ChildActorComp->RegisterComponent();
542
543 AActor* ChildActor = ChildActorComp->GetChildActor();
544
545#if WITH_EDITOR
546 // Add the child actor to a subfolder of the actor's name
547 ChildActor->SetFolderPath(FName( *FString::Printf(TEXT("/Buildings/%s"), *GetName())));
548 #endif
549
550 // Look for all the SMComps
551 TArray<UStaticMeshComponent*> SMComps;
552 UStaticMeshComponent* PivotSMComp = nullptr;
553
554 ChildActor->GetComponents<UStaticMeshComponent>(SMComps);
555
556 // The first mesh on the BP is the pivot to continue creating the floor
557 PivotSMComp = SMComps[0];
558 const UStaticMesh* SM = PivotSMComp->GetStaticMesh();
559
560 if(Visible)
561 {
562 ChildActorComps.Emplace(ChildActorComp);
564 }
565 else
566 {
567 ChildActorComp->DestroyComponent();
568 }
569
570 FVector MeshBound = GetMeshSize(SM);
571 Result = MeshBound.Z;
572
574
575 // Make it invisible on the child actor to avoid duplication with the HISMComp
576 PivotSMComp->SetVisibility(false, false);
577 OutSelectedMeshBounds = SM->GetBoundingBox();
578
579 }
580
581 return Result;
582}
583
584void AProceduralBuilding::AddMeshToBuilding(const UStaticMesh* SM)
585{
586
587 UHierarchicalInstancedStaticMeshComponent* HISMComp = GetHISMComp(SM);
588 HISMComp->AddInstance(CurrentTransform);
589}
590
591FVector AProceduralBuilding::GetMeshSize(const UStaticMesh* SM)
592{
593 FBox Box = SM->GetBoundingBox();
594 return Box.GetSize();
595}
596
598{
599 // Update Current Transform to the right side of the added chunk
600 // Nothing to change if the chunk is the size of a floor
601 if(!UseFullBlocks)
602 {
603 FQuat Rotation = CurrentTransform.GetRotation();
604 FVector ForwardVector = -Rotation.GetForwardVector();
605
606 FVector NewLocation = CurrentTransform.GetTranslation() + ForwardVector * Box.X;
607 CurrentTransform.SetTranslation(NewLocation);
608 }
609}
610
612{
613 // Update Current Transform to the right side of the added chunk
614 // Nothing to change if the chunk is the size of a floor
615 if(!UseFullBlocks)
616 {
617 FQuat Rotation = CurrentTransform.GetRotation();
618 FVector RightVector = -Rotation.GetRightVector();
619 FVector Size = Box.GetSize();
620
621 FVector NewLocation = CurrentTransform.GetTranslation() + RightVector * Size.Y;
622 CurrentTransform.SetTranslation(NewLocation);
623 }
624}
TArray< TSubclassOf< AActor > > RoofBPs
TSet< int > DoorsIndexPosition
Base Parameters
UHierarchicalInstancedStaticMeshComponent * GetHISMComp(const UStaticMesh *SM)
TArray< UStaticMesh * > BaseMeshes
Meshes
TMap< FString, UHierarchicalInstancedStaticMeshComponent * > HISMComps
void CreateFloor(const FloorMeshCollection &MeshCollection, bool IncludeDoors, bool IncludeWalls)
TArray< UStaticMesh * > DoorMeshes
TArray< TSubclassOf< AActor > > CornerBaseBPs
float CreateSide(const FloorMeshCollection &MeshCollection, const TSet< int > &AuxiliarPositions, int SideLength, bool MainVisibility, bool CornerVisbility)
TArray< bool > CornerVisibility
TSet< int > CalculateDoorsIndexInSide(int StartIndex, int Length)
UStaticMeshComponent * RootSMComp
TArray< UChildActorComponent * > ChildActorComps
TArray< UStaticMesh * > WallMeshes
TArray< bool > SideVisibility
Base Parameters | Visibility
TArray< TSubclassOf< AActor > > BaseBPs
void SetBaseMeshes(const TArray< UStaticMesh * > &InBaseMeshes, const TArray< TSubclassOf< AActor > > &InBaseBPs, const TArray< UStaticMesh * > &InCornerBaseMeshes, const TArray< TSubclassOf< AActor > > &InCornerBaseBPs, const TArray< UStaticMesh * > &InDoorMeshes, const TArray< TSubclassOf< AActor > > &InDoorBPs)
TArray< TSubclassOf< AActor > > CornerBodyBPs
void SetBodyMeshes(const TArray< UStaticMesh * > &InBodyMeshes, const TArray< TSubclassOf< AActor > > &InBodyBPs, const TArray< UStaticMesh * > &InCornerBodyMeshes, const TArray< TSubclassOf< AActor > > &InCornerBodyBPs, const TArray< UStaticMesh * > &InWallMeshes, const TArray< TSubclassOf< AActor > > &InWallBPs)
TArray< TSubclassOf< AActor > > WallBPs
TArray< UStaticMesh * > TopMeshes
Meshes | Top
void AddMeshToBuilding(const UStaticMesh *SM)
TArray< UStaticMesh * > RoofMeshes
TArray< UStaticMesh * > CornerBaseMeshes
void CalculateSideVisibilities(int SideIndex, bool &MainVisibility, bool &CornerVisbility)
void UpdateTransformPositionToNextChunk(const FVector &Box)
TArray< TSubclassOf< AActor > > BodyBPs
TArray< UStaticMesh * > CornerBodyMeshes
TArray< TSubclassOf< AActor > > CornerTopBPs
void UpdateTransformPositionToNextSide(const FBox &Box)
void ChooseGeometryToSpawn(const TArray< UStaticMesh * > &InMeshes, const TArray< TSubclassOf< AActor > > &InMainBPs, UStaticMesh **OutMesh, TSubclassOf< AActor > *OutBP)
void SetVisibilityParameters(const TArray< bool > &InSideVisibility, const TArray< bool > &InCornerVisibility, bool InRoofVisibility)
TArray< UStaticMesh * > CornerTopMeshes
float AddChunck(const UStaticMesh *SelectedMesh, const TSubclassOf< AActor > SelectedBP, bool Visible, FBox &OutSelectedMeshBounds)
TSet< int > GenerateWallsIndexPositions(int Length)
TArray< UStaticMesh * > BodyMeshes
Meshes | Body
void SetTopMeshes(const TArray< UStaticMesh * > &InTopMeshes, const TArray< TSubclassOf< AActor > > &InTopBPs, const TArray< UStaticMesh * > &InCornerTopMeshes, const TArray< TSubclassOf< AActor > > &InCornerTopBPs, const TArray< UStaticMesh * > &InRoofMeshes, const TArray< TSubclassOf< AActor > > &InRoofBPs)
void SetBaseParameters(const TSet< int > &InDoorsIndexPosition, const TArray< bool > &InUseWallMesh, int InNumFloors, int InLengthX, int InLengthY, bool InCorners, bool InUseFullBlocks)
TArray< TSubclassOf< AActor > > DoorBPs
FVector GetMeshSize(const UStaticMesh *SM)
TArray< TSubclassOf< AActor > > TopBPs
void ConvertOldBP_ToNativeCodeObject(AActor *BP_Building)
Vector3D GetRightVector() const
Definition Rotation.h:56
Vector3D GetForwardVector() const
Definition Rotation.h:52
TArray< UStaticMesh * > * CornerMeshes
TArray< UStaticMesh * > * MainMeshes
TArray< UStaticMesh * > * AuxiliarMeshes
TArray< TSubclassOf< AActor > > * MainBPs
TArray< TSubclassOf< AActor > > * CornerBPs
TArray< TSubclassOf< AActor > > * AuxiliarBPs