CARLA
StaticMeshCollection.h
Go to the documentation of this file.
1 // Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2 // de Barcelona (UAB).
3 //
4 // This work is licensed under the terms of the MIT license.
5 // For a copy, see <https://opensource.org/licenses/MIT>.
6 
7 #pragma once
8 
9 #include "GameFramework/Actor.h"
10 #include "StaticMeshCollection.generated.h"
11 
12 class UInstancedStaticMeshComponent;
13 
14 /// Holds static mesh instatiators.
15 UCLASS(Abstract)
16 class CARLA_API AStaticMeshCollection : public AActor
17 {
18  GENERATED_BODY()
19 
20 public:
21 
22  AStaticMeshCollection(const FObjectInitializer& ObjectInitializer);
23 
24 protected:
25 
26  uint32 GetNumberOfInstantiators() const
27  {
28  return MeshInstantiators.Num();
29  }
30 
31  void PushBackInstantiator(UStaticMesh *Mesh);
32 
33  void SetStaticMesh(uint32 i, UStaticMesh *Mesh);
34 
35  void AddInstance(uint32 i, const FTransform &Transform);
36 
37  void ClearInstances();
38 
39  /// Clear the instances too.
40  void ClearInstantiators();
41 
42 private:
43 
44  UPROPERTY(Category = "Instanced Static Mesh Collection", VisibleAnywhere)
45  TArray<UInstancedStaticMeshComponent *> MeshInstantiators;
46 };
uint32 GetNumberOfInstantiators() const
Holds static mesh instatiators.
geom::Transform Transform
Definition: rpc/Transform.h:16