#include <CustomTerrainPhysicsComponent.h>
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) |
FDenseTile & | GetTile (uint32_t Tile_X, uint32_t Tile_Y) |
FDenseTile & | GetTile (FDVector Position) |
FDenseTile & | GetTile (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) |
FDenseTile & | InitializeRegion (uint32_t Tile_X, uint32_t Tile_Y) |
FDenseTile & | InitializeRegion (uint64_t TileId) |
FDenseTile & | InitializeRegionInCache (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, FDenseTile > | CacheMap |
FCriticalSection | Lock_Particles |
std::unordered_map< uint64_t, FDenseTile > | Map |
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, FDenseTile > | TilesToWrite |
Friends | |
struct | FTilesWorker |
Definition at line 111 of file CustomTerrainPhysicsComponent.h.
|
inline |
Definition at line 116 of file CustomTerrainPhysicsComponent.h.
void FSparseHighDetailMap::Clear | ( | void | ) |
Definition at line 749 of file CustomTerrainPhysicsComponent.cpp.
|
inline |
Definition at line 158 of file CustomTerrainPhysicsComponent.h.
References FHeightMapData::Clear(), FTilesWorker::RadiusX, and FTilesWorker::RadiusY.
std::vector< uint64_t > FSparseHighDetailMap::GetIntersectingTiles | ( | const FOrientedBox & | OBox | ) |
Definition at line 451 of file CustomTerrainPhysicsComponent.cpp.
References UEFrameToSI(), and UEFrameToSIDirection().
std::vector< uint64_t > FSparseHighDetailMap::GetLoadedTilesInRange | ( | FDVector | Position, |
float | Radius | ||
) |
Definition at line 561 of file CustomTerrainPhysicsComponent.cpp.
std::vector< FParticle * > FSparseHighDetailMap::GetParticlesInBox | ( | const FOrientedBox & | OBox | ) |
Definition at line 438 of file CustomTerrainPhysicsComponent.cpp.
Referenced by GetParticlesInTileRadius().
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().
std::vector< FParticle * > FSparseHighDetailMap::GetParticlesInTileRadius | ( | FDVector | Position, |
float | Radius | ||
) |
Definition at line 375 of file CustomTerrainPhysicsComponent.cpp.
References GetParticlesInBox(), and GetParticlesInRadius().
Referenced by GetParticlesInRadius().
FDenseTile & FSparseHighDetailMap::GetTile | ( | uint32_t | Tile_X, |
uint32_t | Tile_Y | ||
) |
Definition at line 640 of file CustomTerrainPhysicsComponent.cpp.
Referenced by GetTile().
FDenseTile & FSparseHighDetailMap::GetTile | ( | FDVector | Position | ) |
Definition at line 634 of file CustomTerrainPhysicsComponent.cpp.
FDenseTile & FSparseHighDetailMap::GetTile | ( | uint64_t | TileId | ) |
Definition at line 645 of file CustomTerrainPhysicsComponent.cpp.
References GetTile().
uint64_t FSparseHighDetailMap::GetTileId | ( | uint32_t | Tile_X, |
uint32_t | Tile_Y | ||
) |
Definition at line 607 of file CustomTerrainPhysicsComponent.cpp.
uint64_t FSparseHighDetailMap::GetTileId | ( | uint64_t | TileId | ) |
uint64_t FSparseHighDetailMap::GetTileId | ( | FDVector | Position | ) |
Definition at line 612 of file CustomTerrainPhysicsComponent.cpp.
References FHeightMapData::Tile0Position, FDVector::X, and FDVector::Y.
|
inline |
Definition at line 195 of file CustomTerrainPhysicsComponent.h.
|
inline |
Definition at line 186 of file CustomTerrainPhysicsComponent.h.
FDVector FSparseHighDetailMap::GetTilePosition | ( | uint64_t | TileId | ) |
Definition at line 620 of file CustomTerrainPhysicsComponent.cpp.
FDVector FSparseHighDetailMap::GetTilePosition | ( | uint32_t | Tile_X, |
uint32_t | Tile_Y | ||
) |
Definition at line 627 of file CustomTerrainPhysicsComponent.cpp.
References Position, and FHeightMapData::Tile0Position.
|
inline |
Definition at line 131 of file CustomTerrainPhysicsComponent.h.
References Position.
FIntVector FSparseHighDetailMap::GetVectorTileId | ( | FDVector | Position | ) |
Definition at line 674 of file CustomTerrainPhysicsComponent.cpp.
References FHeightMapData::Tile0Position, FDVector::X, and FDVector::Y.
FIntVector FSparseHighDetailMap::GetVectorTileId | ( | uint64_t | TileId | ) |
Definition at line 680 of file CustomTerrainPhysicsComponent.cpp.
|
inline |
Definition at line 119 of file CustomTerrainPhysicsComponent.h.
void FSparseHighDetailMap::InitializeMap | ( | UHeightMapDataAsset * | DataAsset, |
FDVector | Origin, | ||
FDVector | MapSize, | ||
float | Size, | ||
float | ScaleZ | ||
) |
Definition at line 723 of file CustomTerrainPhysicsComponent.cpp.
References FHeightMapData::Tile0Position, FDVector::X, FDVector::Y, and FDVector::Z.
FDenseTile & FSparseHighDetailMap::InitializeRegion | ( | uint32_t | Tile_X, |
uint32_t | Tile_Y | ||
) |
Definition at line 687 of file CustomTerrainPhysicsComponent.cpp.
FDenseTile & FSparseHighDetailMap::InitializeRegion | ( | uint64_t | TileId | ) |
Definition at line 693 of file CustomTerrainPhysicsComponent.cpp.
References FDenseTile::InitializeTile().
FDenseTile & FSparseHighDetailMap::InitializeRegionInCache | ( | uint64_t | TileId | ) |
Definition at line 707 of file CustomTerrainPhysicsComponent.cpp.
References FDenseTile::InitializeTile().
|
inline |
Definition at line 176 of file CustomTerrainPhysicsComponent.h.
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.
|
inline |
Definition at line 181 of file CustomTerrainPhysicsComponent.h.
void FSparseHighDetailMap::Update | ( | FVector | Position, |
float | RadiusX, | ||
float | RadiusY | ||
) |
Definition at line 848 of file CustomTerrainPhysicsComponent.cpp.
References min().
void FSparseHighDetailMap::UpdateHeightMap | ( | UHeightMapDataAsset * | DataAsset, |
FDVector | Origin, | ||
FDVector | MapSize, | ||
float | Size, | ||
float | ScaleZ | ||
) |
Definition at line 738 of file CustomTerrainPhysicsComponent.cpp.
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.
|
friend |
Definition at line 114 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 219 of file CustomTerrainPhysicsComponent.h.
std::unordered_map<uint64_t, FDenseTile> FSparseHighDetailMap::CacheMap |
Definition at line 206 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 212 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 217 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 214 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 222 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 223 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 221 of file CustomTerrainPhysicsComponent.h.
FCriticalSection FSparseHighDetailMap::Lock_Particles |
Definition at line 208 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 224 of file CustomTerrainPhysicsComponent.h.
std::unordered_map<uint64_t, FDenseTile> FSparseHighDetailMap::Map |
Definition at line 205 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 215 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 220 of file CustomTerrainPhysicsComponent.h.
FString FSparseHighDetailMap::SavePath |
Definition at line 207 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 216 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 218 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 211 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 213 of file CustomTerrainPhysicsComponent.h.
|
private |
Definition at line 210 of file CustomTerrainPhysicsComponent.h.