Generates a random city using the meshes provided. 更多...
#include <CityMapGenerator.h>
Public 成员函数 | |
Constructor and destructor | |
ACityMapGenerator (const FObjectInitializer &ObjectInitializer) | |
~ACityMapGenerator () | |
Overriden from UObject | |
virtual void | PreSave (const ITargetPlatform *TargetPlatform) override |
Public 成员函数 继承自 ACityMapMeshHolder | |
ACityMapMeshHolder (const FObjectInitializer &ObjectInitializer) | |
Initializes the mesh holders. | |
Private 成员函数 | |
Overriden from ACityMapMeshHolder | |
virtual void | UpdateMap () override |
Here does nothing, implement in derived classes. | |
Map construction and update related methods | |
void | UpdateSeeds () |
Update the random seeds. Generate random if no fixed seed is used. | |
void | GenerateGraph () |
Regenerate the DCEL. | |
void | GenerateRoads () |
Add the road meshes to the scene based on the current DCEL. | |
void | GenerateRoadMap () |
Generate the road map image and save to disk if requested. | |
Private 属性 | |
Map generation properties | |
uint32 | MapSizeX = 20u |
Size X of the map in map units. | |
uint32 | MapSizeY = 20u |
Size Y of the map in map units. | |
bool | bGenerateRoads = true |
If false, no mesh is added, only the internal representation of road is generated. | |
bool | bUseFixedSeed = true |
If false, a random seed is generated each time. | |
int32 | Seed = 123456789 |
Seed of the random map generated. | |
Other private members | |
TUniquePtr< MapGen::DoublyConnectedEdgeList > | Dcel |
TUniquePtr< MapGen::GraphParser > | DcelParser |
Road map | |
bool | bTriggerRoadMapGeneration = false |
Trigger the generation a the road map image of the current layout (used for off-road and opposite lane invasion detection). | |
uint32 | PixelsPerMapUnit = 50u |
The resolution in pixels per map unit of the road map. | |
bool | bLeftHandTraffic = false |
Whether the road map should be generated based on left-hand traffic. | |
bool | bSaveRoadMapToDisk = true |
If true, the road map encoded as an image is saved to disk. | |
bool | bDrawDebugPixelsToLevel = false |
If true, a debug point is drawn in the level for each pixel of the road map. | |
bool | bGenerateRoadMapOnSave = true |
The road map is re-computed on save so we always store an up-to-date version. | |
bool | bTagForSemanticSegmentation = false |
If true, activate the custom depth pass of each tagged actor in the level. | |
URoadMap * | RoadMap |
URoadMap * | GetRoadMap () |
额外继承的成员函数 | |
Protected 成员函数 继承自 ACityMapMeshHolder | |
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. | |
Generates a random city using the meshes provided.
在文件 CityMapGenerator.h 第 22 行定义.
ACityMapGenerator::ACityMapGenerator | ( | const FObjectInitializer & | ObjectInitializer | ) |
在文件 CityMapGenerator.cpp 第 51 行定义.
引用了 RoadMap.
ACityMapGenerator::~ACityMapGenerator | ( | ) |
在文件 CityMapGenerator.cpp 第 57 行定义.
|
private |
Regenerate the DCEL.
在文件 CityMapGenerator.cpp 第 109 行定义.
引用了 Dcel, DcelParser, MapGen::GraphGenerator::Generate(), MapSizeX, MapSizeY , 以及 Seed.
被这些函数引用 UpdateMap().
|
private |
Generate the road map image and save to disk if requested.
在文件 CityMapGenerator.cpp 第 262 行定义.
引用了 bDrawDebugPixelsToLevel, bLeftHandTraffic, bSaveRoadMapToDisk, bTagForSemanticSegmentation, ACityMapMeshHolder::GetMapScale(), CityMapMeshTag::GetRoadIntersectionSize(), ACityMapMeshHolder::GetTag(), LineTrace(), MapSizeX, MapSizeY, PixelsPerMapUnit, URoadMap::Reset(), RoadMap, URoadMap::SaveAsPNG(), URoadMap::SetPixelAt() , 以及 ATagger::TagActorsInLevel().
被这些函数引用 PreSave() , 以及 UpdateMap().
|
private |
Add the road meshes to the scene based on the current DCEL.
在文件 CityMapGenerator.cpp 第 153 行定义.
引用了 ADD_INTERSECTION, ACityMapMeshHolder::AddInstance(), Dcel, CityMapMeshTag::GetRoadIntersectionSize(), FHalfEdgeCounter::Insert(), MapGen::TIntersection, MapGen::Turn90Deg , 以及 MapGen::XIntersection.
被这些函数引用 UpdateMap().
|
inline |
在文件 CityMapGenerator.h 第 62 行定义.
|
overridevirtual |
在文件 CityMapGenerator.cpp 第 63 行定义.
引用了 bGenerateRoadMapOnSave, GenerateRoadMap() , 以及 RoadMap.
|
overrideprivatevirtual |
Here does nothing, implement in derived classes.
重载 ACityMapMeshHolder .
在文件 CityMapGenerator.cpp 第 83 行定义.
引用了 bGenerateRoads, bTriggerRoadMapGeneration, GenerateGraph(), GenerateRoadMap(), GenerateRoads() , 以及 UpdateSeeds().
|
private |
Update the random seeds. Generate random if no fixed seed is used.
在文件 CityMapGenerator.cpp 第 100 行定义.
引用了 bUseFixedSeed , 以及 Seed.
被这些函数引用 UpdateMap().
|
private |
If true, a debug point is drawn in the level for each pixel of the road map.
在文件 CityMapGenerator.h 第 152 行定义.
被这些函数引用 GenerateRoadMap().
|
private |
The road map is re-computed on save so we always store an up-to-date version.
Uncheck this only for testing purposes as the road map might get out-of-sync with the current road layout.
在文件 CityMapGenerator.h 第 159 行定义.
被这些函数引用 PreSave().
|
private |
If false, no mesh is added, only the internal representation of road is generated.
在文件 CityMapGenerator.h 第 109 行定义.
被这些函数引用 UpdateMap().
|
private |
Whether the road map should be generated based on left-hand traffic.
在文件 CityMapGenerator.h 第 140 行定义.
被这些函数引用 GenerateRoadMap().
|
private |
If true, the road map encoded as an image is saved to disk.
The image is saved to the "Saved" folder of the project.
在文件 CityMapGenerator.h 第 146 行定义.
被这些函数引用 GenerateRoadMap().
|
private |
If true, activate the custom depth pass of each tagged actor in the level.
This pass is necessary for rendering the semantic segmentation. However, it may add a performance penalty since occlusion doesn't seem to be applied to objects having this value active.
在文件 CityMapGenerator.h 第 167 行定义.
被这些函数引用 GenerateRoadMap().
|
private |
Trigger the generation a the road map image of the current layout (used for off-road and opposite lane invasion detection).
在文件 CityMapGenerator.h 第 130 行定义.
被这些函数引用 UpdateMap().
|
private |
If false, a random seed is generated each time.
在文件 CityMapGenerator.h 第 113 行定义.
被这些函数引用 UpdateSeeds().
|
private |
在文件 CityMapGenerator.h 第 179 行定义.
被这些函数引用 GenerateGraph() , 以及 GenerateRoads().
|
private |
在文件 CityMapGenerator.h 第 181 行定义.
被这些函数引用 GenerateGraph().
|
private |
Size X of the map in map units.
The map unit is calculated based in the tile mesh of the road (see Map Scale).
在文件 CityMapGenerator.h 第 97 行定义.
被这些函数引用 GenerateGraph() , 以及 GenerateRoadMap().
|
private |
Size Y of the map in map units.
The map unit is calculated based in the tile mesh of the road (see Map Scale).
在文件 CityMapGenerator.h 第 103 行定义.
被这些函数引用 GenerateGraph() , 以及 GenerateRoadMap().
|
private |
The resolution in pixels per map unit of the road map.
The map unit is calculated based in the tile mesh of the road (see Map Scale).
在文件 CityMapGenerator.h 第 136 行定义.
被这些函数引用 GenerateRoadMap().
|
private |
在文件 CityMapGenerator.h 第 170 行定义.
被这些函数引用 ACityMapGenerator(), GenerateRoadMap() , 以及 PreSave().
|
private |
Seed of the random map generated.
在文件 CityMapGenerator.h 第 117 行定义.
被这些函数引用 GenerateGraph() , 以及 UpdateSeeds().