CARLA
Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
FSparseHighDetailMap Class Reference

#include <CustomTerrainPhysicsComponent.h>

+ Collaboration diagram for FSparseHighDetailMap:

Public Member Functions

void Clear ()
 
 FSparseHighDetailMap (float ParticleDiameter=0.02f, float Depth=0.4f)
 
float GetHeight (FDVector Position)
 
std::vector< uint64_t > GetIntersectingTiles (const FOrientedBox &OBox)
 
std::vector< uint64_t > GetLoadedTilesInRange (FDVector Position, float Radius)
 
std::vector< FParticle * > GetParticlesInBox (const FOrientedBox &OBox)
 
std::vector< FParticle * > GetParticlesInRadius (FDVector Position, float Radius)
 
std::vector< FParticle * > GetParticlesInTileRadius (FDVector Position, float Radius)
 
FDenseTileGetTile (uint32_t Tile_X, uint32_t Tile_Y)
 
FDenseTileGetTile (FDVector Position)
 
FDenseTileGetTile (uint64_t TileId)
 
uint64_t GetTileId (uint32_t Tile_X, uint32_t Tile_Y)
 
uint64_t GetTileId (uint64_t TileId)
 
uint64_t GetTileId (FDVector Position)
 
std::vector< uint64_t > GetTileIdInCache ()
 
std::vector< uint64_t > GetTileIdInMap ()
 
FDVector GetTilePosition (uint64_t TileId)
 
FDVector GetTilePosition (uint32_t Tile_X, uint32_t Tile_Y)
 
float GetTileSize () const
 
FIntVector GetVectorTileId (FDVector Position)
 
FIntVector GetVectorTileId (uint64_t TileId)
 
void Init (uint32 NewTextureSize, float NewAffectedRadius, float ParticleDiameter, float Depth, float NewFloorHeight)
 
void InitializeMap (UHeightMapDataAsset *DataAsset, FDVector Origin, FDVector MapSize, float Size, float ScaleZ)
 
FDenseTileInitializeRegion (uint32_t Tile_X, uint32_t Tile_Y)
 
FDenseTileInitializeRegion (uint64_t TileId)
 
FDenseTileInitializeRegionInCache (uint64_t TileId)
 
void LockMutex ()
 
void SaveMap ()
 
void UnLockMutex ()
 
void Update (FVector Position, float RadiusX, float RadiusY)
 
void UpdateHeightMap (UHeightMapDataAsset *DataAsset, FDVector Origin, FDVector MapSize, float Size, float ScaleZ)
 
void UpdateMaps (FDVector Position, float RadiusX, float RadiusY, float CacheRadiusX, float CacheRadiusY)
 

Public Attributes

std::unordered_map< uint64_t, FDenseTileCacheMap
 
FCriticalSection Lock_Particles
 
std::unordered_map< uint64_t, FDenseTileMap
 
FString SavePath
 

Private Attributes

float AffectedRadius = 0.0f
 
FDVector Extension
 
float FloorHeight = 0.0f
 
FHeightMapData Heightmap
 
FCriticalSection Lock_CacheMap
 
FCriticalSection Lock_GetTile
 
FCriticalSection Lock_Map
 
FCriticalSection Lock_Position
 
float ParticleSize = 0.02f
 
FVector PositionToUpdate
 
float TerrainDepth = 0.4f
 
uint32 TextureSize = 0
 
FDVector Tile0Position
 
float TileSize = 1.f
 
std::unordered_map< uint64_t, FDenseTileTilesToWrite
 

Friends

struct FTilesWorker
 

Detailed Description

Definition at line 111 of file CustomTerrainPhysicsComponent.h.

Constructor & Destructor Documentation

◆ FSparseHighDetailMap()

FSparseHighDetailMap::FSparseHighDetailMap ( float  ParticleDiameter = 0.02f,
float  Depth = 0.4f 
)
inline

Definition at line 116 of file CustomTerrainPhysicsComponent.h.

Member Function Documentation

◆ Clear()

void FSparseHighDetailMap::Clear ( void  )

Definition at line 749 of file CustomTerrainPhysicsComponent.cpp.

◆ GetHeight()

float FSparseHighDetailMap::GetHeight ( FDVector  Position)
inline

Definition at line 158 of file CustomTerrainPhysicsComponent.h.

References FHeightMapData::Clear(), FTilesWorker::RadiusX, and FTilesWorker::RadiusY.

+ Here is the call graph for this function:

◆ GetIntersectingTiles()

std::vector< uint64_t > FSparseHighDetailMap::GetIntersectingTiles ( const FOrientedBox &  OBox)

Definition at line 451 of file CustomTerrainPhysicsComponent.cpp.

References UEFrameToSI(), and UEFrameToSIDirection().

+ Here is the call graph for this function:

◆ GetLoadedTilesInRange()

std::vector< uint64_t > FSparseHighDetailMap::GetLoadedTilesInRange ( FDVector  Position,
float  Radius 
)

Definition at line 561 of file CustomTerrainPhysicsComponent.cpp.

◆ GetParticlesInBox()

std::vector< FParticle * > FSparseHighDetailMap::GetParticlesInBox ( const FOrientedBox &  OBox)

Definition at line 438 of file CustomTerrainPhysicsComponent.cpp.

Referenced by GetParticlesInTileRadius().

+ Here is the caller graph for this function:

◆ GetParticlesInRadius()

std::vector< FParticle * > FSparseHighDetailMap::GetParticlesInRadius ( FDVector  Position,
float  Radius 
)

Definition at line 349 of file CustomTerrainPhysicsComponent.cpp.

References GetParticlesInTileRadius().

Referenced by GetParticlesInTileRadius(), and FDenseTile::UpdateLocalHeightmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetParticlesInTileRadius()

std::vector< FParticle * > FSparseHighDetailMap::GetParticlesInTileRadius ( FDVector  Position,
float  Radius 
)

Definition at line 375 of file CustomTerrainPhysicsComponent.cpp.

References GetParticlesInBox(), and GetParticlesInRadius().

Referenced by GetParticlesInRadius().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTile() [1/3]

FDenseTile & FSparseHighDetailMap::GetTile ( uint32_t  Tile_X,
uint32_t  Tile_Y 
)

Definition at line 640 of file CustomTerrainPhysicsComponent.cpp.

Referenced by GetTile().

+ Here is the caller graph for this function:

◆ GetTile() [2/3]

FDenseTile & FSparseHighDetailMap::GetTile ( FDVector  Position)

Definition at line 634 of file CustomTerrainPhysicsComponent.cpp.

◆ GetTile() [3/3]

FDenseTile & FSparseHighDetailMap::GetTile ( uint64_t  TileId)

Definition at line 645 of file CustomTerrainPhysicsComponent.cpp.

References GetTile().

+ Here is the call graph for this function:

◆ GetTileId() [1/3]

uint64_t FSparseHighDetailMap::GetTileId ( uint32_t  Tile_X,
uint32_t  Tile_Y 
)

Definition at line 607 of file CustomTerrainPhysicsComponent.cpp.

◆ GetTileId() [2/3]

uint64_t FSparseHighDetailMap::GetTileId ( uint64_t  TileId)

◆ GetTileId() [3/3]

uint64_t FSparseHighDetailMap::GetTileId ( FDVector  Position)

◆ GetTileIdInCache()

std::vector<uint64_t> FSparseHighDetailMap::GetTileIdInCache ( )
inline

Definition at line 195 of file CustomTerrainPhysicsComponent.h.

◆ GetTileIdInMap()

std::vector<uint64_t> FSparseHighDetailMap::GetTileIdInMap ( )
inline

Definition at line 186 of file CustomTerrainPhysicsComponent.h.

◆ GetTilePosition() [1/2]

FDVector FSparseHighDetailMap::GetTilePosition ( uint64_t  TileId)

Definition at line 620 of file CustomTerrainPhysicsComponent.cpp.

◆ GetTilePosition() [2/2]

FDVector FSparseHighDetailMap::GetTilePosition ( uint32_t  Tile_X,
uint32_t  Tile_Y 
)

Definition at line 627 of file CustomTerrainPhysicsComponent.cpp.

References Position, and FHeightMapData::Tile0Position.

◆ GetTileSize()

float FSparseHighDetailMap::GetTileSize ( ) const
inline

Definition at line 131 of file CustomTerrainPhysicsComponent.h.

References Position.

◆ GetVectorTileId() [1/2]

FIntVector FSparseHighDetailMap::GetVectorTileId ( FDVector  Position)

◆ GetVectorTileId() [2/2]

FIntVector FSparseHighDetailMap::GetVectorTileId ( uint64_t  TileId)

Definition at line 680 of file CustomTerrainPhysicsComponent.cpp.

◆ Init()

void FSparseHighDetailMap::Init ( uint32  NewTextureSize,
float  NewAffectedRadius,
float  ParticleDiameter,
float  Depth,
float  NewFloorHeight 
)
inline

Definition at line 119 of file CustomTerrainPhysicsComponent.h.

◆ InitializeMap()

void FSparseHighDetailMap::InitializeMap ( UHeightMapDataAsset DataAsset,
FDVector  Origin,
FDVector  MapSize,
float  Size,
float  ScaleZ 
)

◆ InitializeRegion() [1/2]

FDenseTile & FSparseHighDetailMap::InitializeRegion ( uint32_t  Tile_X,
uint32_t  Tile_Y 
)

Definition at line 687 of file CustomTerrainPhysicsComponent.cpp.

◆ InitializeRegion() [2/2]

FDenseTile & FSparseHighDetailMap::InitializeRegion ( uint64_t  TileId)

Definition at line 693 of file CustomTerrainPhysicsComponent.cpp.

References FDenseTile::InitializeTile().

+ Here is the call graph for this function:

◆ InitializeRegionInCache()

FDenseTile & FSparseHighDetailMap::InitializeRegionInCache ( uint64_t  TileId)

Definition at line 707 of file CustomTerrainPhysicsComponent.cpp.

References FDenseTile::InitializeTile().

+ Here is the call graph for this function:

◆ LockMutex()

void FSparseHighDetailMap::LockMutex ( )
inline

Definition at line 176 of file CustomTerrainPhysicsComponent.h.

◆ SaveMap()

void FSparseHighDetailMap::SaveMap ( )

Definition at line 889 of file CustomTerrainPhysicsComponent.cpp.

References carla::learning::WheelOutput::_particle_forces, UActorBlueprintFunctionLibrary::ActorAttributeToBool(), FDenseTile::bHeightmapNeedToUpdate, FDenseTile::bParticlesZOrderedInitialized, FVehicleControl::Brake, FVehicleControl::bReverse, CMToM, FActorInfo::Description, DESERT, UCarlaEpisode::FindCarlaActor(), FOREST, carla::client::detail::Get(), UCarlaStatics::GetCurrentEpisode(), UCarlaStatics::GetLargeMapManager(), ASoilTypeManager::GetTerrainPropertiesAtGlobalLocation(), ACarlaWheeledVehicle::GetVehicleControl(), ACarlaWheeledVehicle::GetVelocity(), UHeightMapDataAsset::HeightValues, min(), MToCM, FCarlaMapTile::Name, FDenseTile::ParticlesHeightMap, FDenseTile::ParticlesZOrdered, Position, FParticle::Position, SIToUEFrame(), UHeightMapDataAsset::SizeX, UHeightMapDataAsset::SizeY, sort(), FVehicleControl::Steer, FSoilTerramechanicsProperties::TerrainType, carla::learning::test_learning(), FVehicleControl::Throttle, FDenseTile::TilePosition, FDVector::ToFVector(), FDVector::ToString(), UEFrameToSI(), FActorDescription::Variations, Vehicle, FParticle::Velocity, carla::learning::Outputs::wheel0, carla::learning::Outputs::wheel1, carla::learning::Outputs::wheel2, carla::learning::Outputs::wheel3, carla::learning::WheelOutput::wheel_forces_x, carla::learning::WheelOutput::wheel_forces_y, carla::learning::WheelOutput::wheel_forces_z, carla::learning::WheelOutput::wheel_torque_x, carla::learning::WheelOutput::wheel_torque_y, carla::learning::WheelOutput::wheel_torque_z, FHeightMapData::WorldSize, WriteFVector(), FDVector::X, FDVector::Y, and FDVector::Z.

+ Here is the call graph for this function:

◆ UnLockMutex()

void FSparseHighDetailMap::UnLockMutex ( )
inline

Definition at line 181 of file CustomTerrainPhysicsComponent.h.

◆ Update()

void FSparseHighDetailMap::Update ( FVector  Position,
float  RadiusX,
float  RadiusY 
)

Definition at line 848 of file CustomTerrainPhysicsComponent.cpp.

References min().

+ Here is the call graph for this function:

◆ UpdateHeightMap()

void FSparseHighDetailMap::UpdateHeightMap ( UHeightMapDataAsset DataAsset,
FDVector  Origin,
FDVector  MapSize,
float  Size,
float  ScaleZ 
)

Definition at line 738 of file CustomTerrainPhysicsComponent.cpp.

◆ UpdateMaps()

void FSparseHighDetailMap::UpdateMaps ( FDVector  Position,
float  RadiusX,
float  RadiusY,
float  CacheRadiusX,
float  CacheRadiusY 
)

Definition at line 755 of file CustomTerrainPhysicsComponent.cpp.

References WriteFVector(), FDVector::X, and FDVector::Y.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ FTilesWorker

friend struct FTilesWorker
friend

Definition at line 114 of file CustomTerrainPhysicsComponent.h.

Member Data Documentation

◆ AffectedRadius

float FSparseHighDetailMap::AffectedRadius = 0.0f
private

Definition at line 219 of file CustomTerrainPhysicsComponent.h.

◆ CacheMap

std::unordered_map<uint64_t, FDenseTile> FSparseHighDetailMap::CacheMap

Definition at line 206 of file CustomTerrainPhysicsComponent.h.

◆ Extension

FDVector FSparseHighDetailMap::Extension
private

Definition at line 212 of file CustomTerrainPhysicsComponent.h.

◆ FloorHeight

float FSparseHighDetailMap::FloorHeight = 0.0f
private

Definition at line 217 of file CustomTerrainPhysicsComponent.h.

◆ Heightmap

FHeightMapData FSparseHighDetailMap::Heightmap
private

Definition at line 214 of file CustomTerrainPhysicsComponent.h.

◆ Lock_CacheMap

FCriticalSection FSparseHighDetailMap::Lock_CacheMap
private

Definition at line 222 of file CustomTerrainPhysicsComponent.h.

◆ Lock_GetTile

FCriticalSection FSparseHighDetailMap::Lock_GetTile
private

Definition at line 223 of file CustomTerrainPhysicsComponent.h.

◆ Lock_Map

FCriticalSection FSparseHighDetailMap::Lock_Map
private

Definition at line 221 of file CustomTerrainPhysicsComponent.h.

◆ Lock_Particles

FCriticalSection FSparseHighDetailMap::Lock_Particles

Definition at line 208 of file CustomTerrainPhysicsComponent.h.

◆ Lock_Position

FCriticalSection FSparseHighDetailMap::Lock_Position
private

Definition at line 224 of file CustomTerrainPhysicsComponent.h.

◆ Map

std::unordered_map<uint64_t, FDenseTile> FSparseHighDetailMap::Map

Definition at line 205 of file CustomTerrainPhysicsComponent.h.

◆ ParticleSize

float FSparseHighDetailMap::ParticleSize = 0.02f
private

Definition at line 215 of file CustomTerrainPhysicsComponent.h.

◆ PositionToUpdate

FVector FSparseHighDetailMap::PositionToUpdate
private

Definition at line 220 of file CustomTerrainPhysicsComponent.h.

◆ SavePath

FString FSparseHighDetailMap::SavePath

Definition at line 207 of file CustomTerrainPhysicsComponent.h.

◆ TerrainDepth

float FSparseHighDetailMap::TerrainDepth = 0.4f
private

Definition at line 216 of file CustomTerrainPhysicsComponent.h.

◆ TextureSize

uint32 FSparseHighDetailMap::TextureSize = 0
private

Definition at line 218 of file CustomTerrainPhysicsComponent.h.

◆ Tile0Position

FDVector FSparseHighDetailMap::Tile0Position
private

Definition at line 211 of file CustomTerrainPhysicsComponent.h.

◆ TileSize

float FSparseHighDetailMap::TileSize = 1.f
private

Definition at line 213 of file CustomTerrainPhysicsComponent.h.

◆ TilesToWrite

std::unordered_map<uint64_t, FDenseTile> FSparseHighDetailMap::TilesToWrite
private

Definition at line 210 of file CustomTerrainPhysicsComponent.h.


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