CARLA
 
载入中...
搜索中...
未找到
所有成员列表
ACityMapGenerator类 参考

Generates a random city using the meshes provided. 更多...

#include <CityMapGenerator.h>

+ 类 ACityMapGenerator 继承关系图:
+ ACityMapGenerator 的协作图:

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::DoublyConnectedEdgeListDcel
 
TUniquePtr< MapGen::GraphParserDcelParser
 

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.
 
URoadMapRoadMap
 
URoadMapGetRoadMap ()
 

额外继承的成员函数

- 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.

注解
At this point it only generates roads and sidewalks.

在文件 CityMapGenerator.h22 行定义.

构造及析构函数说明

◆ ACityMapGenerator()

ACityMapGenerator::ACityMapGenerator ( const FObjectInitializer & ObjectInitializer)

在文件 CityMapGenerator.cpp51 行定义.

引用了 RoadMap.

◆ ~ACityMapGenerator()

ACityMapGenerator::~ACityMapGenerator ( )

在文件 CityMapGenerator.cpp57 行定义.

成员函数说明

◆ GenerateGraph()

void ACityMapGenerator::GenerateGraph ( )
private

Regenerate the DCEL.

在文件 CityMapGenerator.cpp109 行定义.

引用了 Dcel, DcelParser, MapGen::GraphGenerator::Generate(), MapSizeX, MapSizeY , 以及 Seed.

被这些函数引用 UpdateMap().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ GenerateRoadMap()

void ACityMapGenerator::GenerateRoadMap ( )
private

Generate the road map image and save to disk if requested.

在文件 CityMapGenerator.cpp262 行定义.

引用了 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().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ GenerateRoads()

void ACityMapGenerator::GenerateRoads ( )
private

Add the road meshes to the scene based on the current DCEL.

在文件 CityMapGenerator.cpp153 行定义.

引用了 ADD_INTERSECTION, ACityMapMeshHolder::AddInstance(), Dcel, CityMapMeshTag::GetRoadIntersectionSize(), FHalfEdgeCounter::Insert(), MapGen::TIntersection, MapGen::Turn90Deg , 以及 MapGen::XIntersection.

被这些函数引用 UpdateMap().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ GetRoadMap()

URoadMap * ACityMapGenerator::GetRoadMap ( )
inline

在文件 CityMapGenerator.h62 行定义.

◆ PreSave()

void ACityMapGenerator::PreSave ( const ITargetPlatform * TargetPlatform)
overridevirtual

在文件 CityMapGenerator.cpp63 行定义.

引用了 bGenerateRoadMapOnSave, GenerateRoadMap() , 以及 RoadMap.

+ 函数调用图:

◆ UpdateMap()

void ACityMapGenerator::UpdateMap ( )
overrideprivatevirtual

Here does nothing, implement in derived classes.

重载 ACityMapMeshHolder .

在文件 CityMapGenerator.cpp83 行定义.

引用了 bGenerateRoads, bTriggerRoadMapGeneration, GenerateGraph(), GenerateRoadMap(), GenerateRoads() , 以及 UpdateSeeds().

+ 函数调用图:

◆ UpdateSeeds()

void ACityMapGenerator::UpdateSeeds ( )
private

Update the random seeds. Generate random if no fixed seed is used.

在文件 CityMapGenerator.cpp100 行定义.

引用了 bUseFixedSeed , 以及 Seed.

被这些函数引用 UpdateMap().

+ 这是这个函数的调用关系图:

类成员变量说明

◆ bDrawDebugPixelsToLevel

bool ACityMapGenerator::bDrawDebugPixelsToLevel = false
private

If true, a debug point is drawn in the level for each pixel of the road map.

在文件 CityMapGenerator.h152 行定义.

被这些函数引用 GenerateRoadMap().

◆ bGenerateRoadMapOnSave

bool ACityMapGenerator::bGenerateRoadMapOnSave = true
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.h159 行定义.

被这些函数引用 PreSave().

◆ bGenerateRoads

bool ACityMapGenerator::bGenerateRoads = true
private

If false, no mesh is added, only the internal representation of road is generated.

在文件 CityMapGenerator.h109 行定义.

被这些函数引用 UpdateMap().

◆ bLeftHandTraffic

bool ACityMapGenerator::bLeftHandTraffic = false
private

Whether the road map should be generated based on left-hand traffic.

在文件 CityMapGenerator.h140 行定义.

被这些函数引用 GenerateRoadMap().

◆ bSaveRoadMapToDisk

bool ACityMapGenerator::bSaveRoadMapToDisk = true
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.h146 行定义.

被这些函数引用 GenerateRoadMap().

◆ bTagForSemanticSegmentation

bool ACityMapGenerator::bTagForSemanticSegmentation = false
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.h167 行定义.

被这些函数引用 GenerateRoadMap().

◆ bTriggerRoadMapGeneration

bool ACityMapGenerator::bTriggerRoadMapGeneration = false
private

Trigger the generation a the road map image of the current layout (used for off-road and opposite lane invasion detection).

在文件 CityMapGenerator.h130 行定义.

被这些函数引用 UpdateMap().

◆ bUseFixedSeed

bool ACityMapGenerator::bUseFixedSeed = true
private

If false, a random seed is generated each time.

在文件 CityMapGenerator.h113 行定义.

被这些函数引用 UpdateSeeds().

◆ Dcel

TUniquePtr<MapGen::DoublyConnectedEdgeList> ACityMapGenerator::Dcel
private

在文件 CityMapGenerator.h179 行定义.

被这些函数引用 GenerateGraph() , 以及 GenerateRoads().

◆ DcelParser

TUniquePtr<MapGen::GraphParser> ACityMapGenerator::DcelParser
private

在文件 CityMapGenerator.h181 行定义.

被这些函数引用 GenerateGraph().

◆ MapSizeX

uint32 ACityMapGenerator::MapSizeX = 20u
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.h97 行定义.

被这些函数引用 GenerateGraph() , 以及 GenerateRoadMap().

◆ MapSizeY

uint32 ACityMapGenerator::MapSizeY = 20u
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.h103 行定义.

被这些函数引用 GenerateGraph() , 以及 GenerateRoadMap().

◆ PixelsPerMapUnit

uint32 ACityMapGenerator::PixelsPerMapUnit = 50u
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.h136 行定义.

被这些函数引用 GenerateRoadMap().

◆ RoadMap

URoadMap* ACityMapGenerator::RoadMap
private

在文件 CityMapGenerator.h170 行定义.

被这些函数引用 ACityMapGenerator(), GenerateRoadMap() , 以及 PreSave().

◆ Seed

int32 ACityMapGenerator::Seed = 123456789
private

Seed of the random map generated.

在文件 CityMapGenerator.h117 行定义.

被这些函数引用 GenerateGraph() , 以及 UpdateSeeds().


该类的文档由以下文件生成: