CARLA
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
AOpenDriveGenerator::FRoadSurfaceRaster Struct Reference

The authoritative "what is road surface, where, at what height" tool the rest of generation consumes. More...

#include <OpenDriveGenerator.h>

Classes

struct  FCell
 

Public Member Functions

void BuildDistanceFields ()
 Two-pass chamfer distance transform filling DistToDrive/DistToPaved and NearestPavedMinZ.
 
const FCell * CellAtWorld (float X, float Y) const
 
void Initialize (const FBox &Bounds, float InCellSize)
 
bool IsValid () const
 
void RasterizeTriangle (const FVector &A, const FVector &B, const FVector &C, bool bIsDrive)
 Splats one triangle of road ("drive") or sidewalk surface into the grid: conservative 2D rasterization, per-cell-center barycentric z.
 

Public Attributes

TArray< FCell > Cells
 
float CellSize = 250.0f
 
int32 Height = 0
 
float OriginX = 0.0f
 
float OriginY = 0.0f
 
int32 Width = 0
 

Detailed Description

The authoritative "what is road surface, where, at what height" tool the rest of generation consumes.

GenerateRoadMesh rasterizes every road/sidewalk triangle (vertices alone leave unconstrained holes inside lanes – the mesh is dense along s but a full lane wide laterally) into a regular XY grid with barycentric-interpolated surface heights, then a chamfer distance transform gives every cell its distance to the driving footprint and to any pavement, plus the height of the nearest pavement. Terrain generation, furniture placement and the generation QA all query this one structure instead of re-deriving geometry their own (subtly different) ways.

Definition at line 166 of file OpenDriveGenerator.h.

Member Function Documentation

◆ BuildDistanceFields()

void AOpenDriveGenerator::FRoadSurfaceRaster::BuildDistanceFields ( )

◆ CellAtWorld()

const AOpenDriveGenerator::FRoadSurfaceRaster::FCell * AOpenDriveGenerator::FRoadSurfaceRaster::CellAtWorld ( float  X,
float  Y 
) const

◆ Initialize()

void AOpenDriveGenerator::FRoadSurfaceRaster::Initialize ( const FBox &  Bounds,
float  InCellSize 
)

Definition at line 288 of file OpenDriveGenerator.cpp.

References Cells, CellSize, Height, OriginX, OriginY, and Width.

Referenced by AOpenDriveGenerator::GenerateRoadMesh().

◆ IsValid()

bool AOpenDriveGenerator::FRoadSurfaceRaster::IsValid ( ) const
inline

◆ RasterizeTriangle()

void AOpenDriveGenerator::FRoadSurfaceRaster::RasterizeTriangle ( const FVector &  A,
const FVector &  B,
const FVector &  C,
bool  bIsDrive 
)

Member Data Documentation

◆ Cells

TArray<FCell> AOpenDriveGenerator::FRoadSurfaceRaster::Cells

◆ CellSize

float AOpenDriveGenerator::FRoadSurfaceRaster::CellSize = 250.0f

◆ Height

int32 AOpenDriveGenerator::FRoadSurfaceRaster::Height = 0

◆ OriginX

float AOpenDriveGenerator::FRoadSurfaceRaster::OriginX = 0.0f

◆ OriginY

float AOpenDriveGenerator::FRoadSurfaceRaster::OriginY = 0.0f

◆ Width

int32 AOpenDriveGenerator::FRoadSurfaceRaster::Width = 0

The documentation for this struct was generated from the following files: