|
CARLA
|
Holds the static meshes and instances necessary for building a city map. More...
#include <CityMapMeshHolder.h>
Inheritance diagram for ACityMapMeshHolder:Public Member Functions | |
| ACityMapMeshHolder (const FObjectInitializer &ObjectInitializer) | |
| Initializes the mesh holders. | |
Protected Member Functions | |
| void | AddInstance (ECityMapMeshTag Tag, FTransform Transform) |
| Add an instance of a mesh with a given transform. | |
| void | AddInstance (ECityMapMeshTag Tag, uint32 X, uint32 Y) |
| Add an instance of a mesh with a given tile location. | |
| void | AddInstance (ECityMapMeshTag Tag, uint32 X, uint32 Y, float Angle) |
| Add an instance of a mesh with a given tile location and rotation. | |
| float | GetMapScale () const |
| UStaticMesh * | GetStaticMesh (ECityMapMeshTag Tag) |
| Return the static mesh corresponding to Tag. | |
| const UStaticMesh * | GetStaticMesh (ECityMapMeshTag Tag) const |
| Return the static mesh corresponding to Tag. | |
| ECityMapMeshTag | GetTag (const UStaticMesh &StaticMesh) const |
| Return the tag corresponding to StaticMesh. | |
| FVector | GetTileLocation (uint32 X, uint32 Y) const |
| Return the 3D world location (relative to this actor) of the given 2D tile. | |
| virtual void | OnConstruction (const FTransform &Transform) override |
| Initializes the instantiators. | |
| virtual void | PostInitializeComponents () override |
| void | SetStaticMesh (ECityMapMeshTag Tag, UStaticMesh *Mesh) |
| Set the static mesh associated with Tag. | |
Private Member Functions | |
| void | DeletePieces () |
| Clear all instances of the static mesh actors. | |
| virtual void | UpdateMap () |
| Here does nothing, implement in derived classes. | |
| void | UpdateMapScale () |
| Set the scale to the dimensions of the base mesh. | |
Private Attributes | |
| float | MapScale = 1.0f |
| TObjectPtr< USceneComponent > | SceneRootComponent |
| TMap< ECityMapMeshTag, TObjectPtr< UStaticMesh > > | StaticMeshes |
| TMap< TObjectPtr< UStaticMesh >, ECityMapMeshTag > | TagMap |
Holds the static meshes and instances necessary for building a city map.
Definition at line 24 of file CityMapMeshHolder.h.
| ACityMapMeshHolder::ACityMapMeshHolder | ( | const FObjectInitializer & | ObjectInitializer | ) |
Initializes the mesh holders.
It is safe to call SetStaticMesh after this. However, instances cannot be added until OnConstruction is called.
Definition at line 31 of file CityMapMeshHolder.cpp.
References CityMapMeshTag::FromUInt(), NUMBER_OF_TAGS, SceneRootComponent, and StaticMeshes.
|
protected |
Add an instance of a mesh with a given transform.
| Tag | The mesh' tag |
| Transform | Transform that will be applied to the mesh |
Definition at line 137 of file CityMapMeshHolder.cpp.
References UCarlaSettings::CARLA_ROAD_TAG, and GetStaticMesh().
|
protected |
Add an instance of a mesh with a given tile location.
| Tag | The mesh' tag |
| X | Tile coordinate X |
| Y | Tile coordinate Y |
Definition at line 125 of file CityMapMeshHolder.cpp.
References AddInstance(), and GetTileLocation().
Referenced by AddInstance(), AddInstance(), and ACityMapGenerator::GenerateRoads().
|
protected |
Add an instance of a mesh with a given tile location and rotation.
| Tag | The mesh' tag |
| X | Tile coordinate X |
| Y | Tile coordinate Y |
| Angle | Rotation around Z axis |
Definition at line 130 of file CityMapMeshHolder.cpp.
References AddInstance(), and GetTileLocation().
|
private |
Clear all instances of the static mesh actors.
Definition at line 159 of file CityMapMeshHolder.cpp.
References UCarlaSettings::CARLA_ROAD_TAG.
|
inlineprotected |
Definition at line 53 of file CityMapMeshHolder.h.
Referenced by ACityMapGenerator::GenerateRoadMap().
|
protected |
Return the static mesh corresponding to Tag.
Definition at line 109 of file CityMapMeshHolder.cpp.
References StaticMeshes.
Referenced by AddInstance(), and UpdateMapScale().
|
protected |
Return the static mesh corresponding to Tag.
Definition at line 114 of file CityMapMeshHolder.cpp.
References StaticMeshes.
|
protected |
Return the tag corresponding to StaticMesh.
Definition at line 119 of file CityMapMeshHolder.cpp.
References TagMap.
Referenced by ACityMapGenerator::GenerateRoadMap().
|
protected |
Return the 3D world location (relative to this actor) of the given 2D tile.
Definition at line 96 of file CityMapMeshHolder.cpp.
References MapScale.
Referenced by AddInstance(), and AddInstance().
|
overrideprotectedvirtual |
Initializes the instantiators.
Definition at line 55 of file CityMapMeshHolder.cpp.
|
overrideprotectedvirtual |
Definition at line 61 of file CityMapMeshHolder.cpp.
References IsValid(), UpdateMap(), and UpdateMapScale().
|
protected |
Set the static mesh associated with Tag.
Definition at line 101 of file CityMapMeshHolder.cpp.
References StaticMeshes, and TagMap.
|
privatevirtual |
Here does nothing, implement in derived classes.
Reimplemented in ACityMapGenerator.
Definition at line 157 of file CityMapMeshHolder.cpp.
Referenced by PostInitializeComponents().
|
private |
Set the scale to the dimensions of the base mesh.
Definition at line 182 of file CityMapMeshHolder.cpp.
References CityMapMeshTag::GetBaseMeshTag(), GetStaticMesh(), MapScale, and CityMapMeshTag::ToString().
Referenced by PostInitializeComponents().
|
private |
Definition at line 114 of file CityMapMeshHolder.h.
Referenced by GetTileLocation(), and UpdateMapScale().
|
private |
Definition at line 111 of file CityMapMeshHolder.h.
Referenced by ACityMapMeshHolder().
|
private |
Definition at line 117 of file CityMapMeshHolder.h.
Referenced by ACityMapMeshHolder(), GetStaticMesh(), GetStaticMesh(), and SetStaticMesh().
|
private |
Definition at line 120 of file CityMapMeshHolder.h.
Referenced by GetTag(), and SetStaticMesh().