Holds the static meshes and instances necessary for building a city map. More...
#include <CityMapMeshHolder.h>
Inheritance diagram for ACityMapMeshHolder:
Collaboration diagram for ACityMapMeshHolder:Public Member Functions | |
| ACityMapMeshHolder (const FObjectInitializer &ObjectInitializer) | |
| Initializes the mesh holders. More... | |
Protected Member Functions | |
| void | AddInstance (ECityMapMeshTag Tag, uint32 X, uint32 Y) |
| Add an instance of a mesh with a given tile location. More... | |
| void | AddInstance (ECityMapMeshTag Tag, uint32 X, uint32 Y, float Angle) |
| Add an instance of a mesh with a given tile location and rotation. More... | |
| void | AddInstance (ECityMapMeshTag Tag, FTransform Transform) |
| Add an instance of a mesh with a given transform. More... | |
| float | GetMapScale () const |
| UStaticMesh * | GetStaticMesh (ECityMapMeshTag Tag) |
| Return the static mesh corresponding to Tag. More... | |
| const UStaticMesh * | GetStaticMesh (ECityMapMeshTag Tag) const |
| Return the static mesh corresponding to Tag. More... | |
| ECityMapMeshTag | GetTag (const UStaticMesh &StaticMesh) const |
| Return the tag corresponding to StaticMesh. More... | |
| FVector | GetTileLocation (uint32 X, uint32 Y) const |
| Return the 3D world location (relative to this actor) of the given 2D tile. More... | |
| virtual void | OnConstruction (const FTransform &Transform) override |
| Initializes the instantiators. More... | |
| virtual void | PostInitializeComponents () override |
| void | SetStaticMesh (ECityMapMeshTag Tag, UStaticMesh *Mesh) |
| Set the static mesh associated with Tag. More... | |
Private Member Functions | |
| void | DeletePieces () |
| Clear all instances of the static mesh actors. More... | |
| virtual void | UpdateMap () |
| Here does nothing, implement in derived classes. More... | |
| void | UpdateMapScale () |
| Set the scale to the dimensions of the base mesh. More... | |
Private Attributes | |
| float | MapScale = 1.0f |
| USceneComponent * | SceneRootComponent |
| TMap< ECityMapMeshTag, UStaticMesh * > | StaticMeshes |
| TMap< UStaticMesh *, ECityMapMeshTag > | TagMap |
Holds the static meshes and instances necessary for building a city map.
Definition at line 20 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 26 of file CityMapMeshHolder.cpp.
References CityMapMeshTag::FromUInt(), NUMBER_OF_TAGS, SceneRootComponent, and StaticMeshes.
Here is the call graph for this function:
|
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 120 of file CityMapMeshHolder.cpp.
References GetTileLocation().
Referenced by AddInstance(), and ACityMapGenerator::GenerateRoads().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 125 of file CityMapMeshHolder.cpp.
References AddInstance(), and GetTileLocation().
Here is the call graph for this function:
|
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 132 of file CityMapMeshHolder.cpp.
References UCarlaSettings::CARLA_ROAD_TAG, and GetStaticMesh().
Here is the call graph for this function:
|
private |
Clear all instances of the static mesh actors.
Definition at line 154 of file CityMapMeshHolder.cpp.
References UCarlaSettings::CARLA_ROAD_TAG.
Referenced by PostInitializeComponents().
Here is the caller graph for this function:
|
inlineprotected |
Definition at line 49 of file CityMapMeshHolder.h.
Referenced by ACityMapGenerator::GenerateRoadMap().
Here is the caller graph for this function:
|
protected |
Return the static mesh corresponding to Tag.
Definition at line 104 of file CityMapMeshHolder.cpp.
References StaticMeshes.
Referenced by AddInstance(), and UpdateMapScale().
Here is the caller graph for this function:
|
protected |
Return the static mesh corresponding to Tag.
Definition at line 109 of file CityMapMeshHolder.cpp.
References StaticMeshes.
|
protected |
Return the tag corresponding to StaticMesh.
Definition at line 114 of file CityMapMeshHolder.cpp.
References TagMap.
Referenced by ACityMapGenerator::GenerateRoadMap().
Here is the caller graph for this function:
|
protected |
Return the 3D world location (relative to this actor) of the given 2D tile.
Definition at line 91 of file CityMapMeshHolder.cpp.
References MapScale.
Referenced by AddInstance().
Here is the caller graph for this function:
|
overrideprotectedvirtual |
Initializes the instantiators.
Definition at line 50 of file CityMapMeshHolder.cpp.
|
overrideprotectedvirtual |
Definition at line 56 of file CityMapMeshHolder.cpp.
References DeletePieces(), IsValid(), UpdateMap(), and UpdateMapScale().
Here is the call graph for this function:
|
protected |
Set the static mesh associated with Tag.
Definition at line 96 of file CityMapMeshHolder.cpp.
References StaticMeshes, and TagMap.
|
privatevirtual |
Here does nothing, implement in derived classes.
Reimplemented in ACityMapGenerator.
Definition at line 152 of file CityMapMeshHolder.cpp.
Referenced by PostInitializeComponents().
Here is the caller graph for this function:
|
private |
Set the scale to the dimensions of the base mesh.
Definition at line 177 of file CityMapMeshHolder.cpp.
References CityMapMeshTag::GetBaseMeshTag(), GetStaticMesh(), MapScale, and CityMapMeshTag::ToString().
Referenced by PostInitializeComponents().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 110 of file CityMapMeshHolder.h.
Referenced by GetTileLocation(), and UpdateMapScale().
|
private |
Definition at line 107 of file CityMapMeshHolder.h.
Referenced by ACityMapMeshHolder().
|
private |
Definition at line 113 of file CityMapMeshHolder.h.
Referenced by ACityMapMeshHolder(), GetStaticMesh(), and SetStaticMesh().
|
private |
Definition at line 116 of file CityMapMeshHolder.h.
Referenced by GetTag(), and SetStaticMesh().
1.8.13