Road map of the level. 更多...
#include <RoadMap.h>
Public 成员函数 | |
FRoadMapPixelData | GetDataAt (const FVector &WorldLocation) const |
Clamps value if lies outside map limits. | |
FRoadMapPixelData | GetDataAt (uint32 PixelX, uint32 PixelY) const |
Retrieve the data stored at a given pixel. | |
uint32 | GetHeight () const |
uint32 | GetWidth () const |
FVector | GetWorldLocation (uint32 PixelX, uint32 PixelY) const |
Return the world location of a given pixel. | |
FRoadMapIntersectionResult | Intersect (const FTransform &BoxTransform, const FVector &BoxExtent, float ChecksPerCentimeter) const |
Intersect actor bounds with map. | |
void | Reset (uint32 Width, uint32 Height, float PixelsPerCentimeter, const FTransform &WorldToMap, const FVector &MapOffset) |
Resets current map an initializes an empty map of the given size. | |
bool | SaveAsPNG (const FString &Folder, const FString &MapName) const |
Save the current map as PNG with the pixel data encoded as color. | |
void | SetPixelAt (uint32 PixelX, uint32 PixelY, ECityMapMeshTag Tag, const FTransform &Transform, bool bInvertDirection=false) |
URoadMap (const FObjectInitializer &ObjectInitializer) | |
Creates a valid empty map (every point is off-road). | |
Private 成员函数 | |
int32 | GetIndex (uint32 PixelX, uint32 PixelY) const |
bool | IsValid () const |
Private 属性 | |
uint32 | Height |
Height of the map in pixels. | |
FVector | MapOffset |
Offset of the map in map coordinates. | |
float | PixelsPerCentimeter |
Number of pixels per centimeter. | |
TArray< uint16 > | RoadMapData |
uint32 | Width |
Width of the map in pixels. | |
FTransform | WorldToMap |
World-to-map transform. | |
Road map of the level.
Contains information in 2D of which areas are road and lane directions.
URoadMap::URoadMap | ( | const FObjectInitializer & | ObjectInitializer | ) |
Creates a valid empty map (every point is off-road).
在文件 RoadMap.cpp 第 71 行定义.
引用了 RoadMapData , 以及 FRoadMapPixelData::Value.
FRoadMapPixelData URoadMap::GetDataAt | ( | const FVector & | WorldLocation | ) | const |
Clamps value if lies outside map limits.
在文件 RoadMap.cpp 第 210 行定义.
引用了 ClampFloatToUInt(), GetDataAt(), Height, IsValid(), MapOffset, PixelsPerCentimeter, Width , 以及 WorldToMap.
|
inline |
Retrieve the data stored at a given pixel.
引用了 GetIndex(), IsValid() , 以及 RoadMapData.
被这些函数引用 GetDataAt() , 以及 Intersect().
|
inline |
|
inlineprivate |
|
inline |
FVector URoadMap::GetWorldLocation | ( | uint32 | PixelX, |
uint32 | PixelY ) const |
Return the world location of a given pixel.
在文件 RoadMap.cpp 第 201 行定义.
引用了 MapOffset, PixelsPerCentimeter , 以及 WorldToMap.
FRoadMapIntersectionResult URoadMap::Intersect | ( | const FTransform & | BoxTransform, |
const FVector & | BoxExtent, | ||
float | ChecksPerCentimeter ) const |
Intersect actor bounds with map.
Bounds box is projected to the map and checked against it for possible intersections with off-road areas and opposite lanes.
在文件 RoadMap.cpp 第 219 行定义.
引用了 GetDataAt(), FRoadMapIntersectionResult::OffRoad , 以及 FRoadMapIntersectionResult::OppositeLane.
|
inlineprivate |
void URoadMap::Reset | ( | uint32 | Width, |
uint32 | Height, | ||
float | PixelsPerCentimeter, | ||
const FTransform & | WorldToMap, | ||
const FVector & | MapOffset ) |
Resets current map an initializes an empty map of the given size.
在文件 RoadMap.cpp 第 83 行定义.
引用了 Height, MapOffset, PixelsPerCentimeter, RoadMapData, Width , 以及 WorldToMap.
被这些函数引用 ACityMapGenerator::GenerateRoadMap().
bool URoadMap::SaveAsPNG | ( | const FString & | Folder, |
const FString & | MapName ) const |
Save the current map as PNG with the pixel data encoded as color.
在文件 RoadMap.cpp 第 251 行定义.
引用了 FRoadMapPixelData::EncodeAsColor(), GetHeight(), GetWidth(), Height, IsValid(), MapOffset, PixelsPerCentimeter, RoadMapData, FPixelReader::SavePixelsToDisk(), Width , 以及 WorldToMap.
被这些函数引用 ACityMapGenerator::GenerateRoadMap().
void URoadMap::SetPixelAt | ( | uint32 | PixelX, |
uint32 | PixelY, | ||
ECityMapMeshTag | Tag, | ||
const FTransform & | Transform, | ||
bool | bInvertDirection = false ) |
在文件 RoadMap.cpp 第 98 行定义.
引用了 FRoadMapPixelData::Encode(), carla::geom::Rotation::GetForwardVector(), GetIndex() , 以及 RoadMapData.
被这些函数引用 ACityMapGenerator::GenerateRoadMap().
|
private |
Height of the map in pixels.
被这些函数引用 GetDataAt(), GetHeight(), IsValid(), Reset() , 以及 SaveAsPNG().
|
private |
Offset of the map in map coordinates.
被这些函数引用 GetDataAt(), GetWorldLocation(), Reset() , 以及 SaveAsPNG().
|
private |
Number of pixels per centimeter.
被这些函数引用 GetDataAt(), GetWorldLocation(), Reset() , 以及 SaveAsPNG().
|
private |
被这些函数引用 GetDataAt(), IsValid(), Reset(), SaveAsPNG(), SetPixelAt() , 以及 URoadMap().
|
private |
Width of the map in pixels.
被这些函数引用 GetDataAt(), GetIndex(), GetWidth(), IsValid(), Reset() , 以及 SaveAsPNG().
|
private |
World-to-map transform.
被这些函数引用 GetDataAt(), GetWorldLocation(), Reset() , 以及 SaveAsPNG().