Aollero/terramechanics actors and rois preview (#5867)

* Show and hide detailed noise

* Heightmap material updated for previous commit

* Addition of soil type query code to terramechanics component

* Bug creating vegetation and teramechanics actors fixed

* Terrain Rois Presets

Co-authored-by: bernat <bernatx@gmail.com>
This commit is contained in:
adrian-ollero 2022-10-25 17:37:26 +02:00 committed by GitHub
parent 7682d2e7f6
commit 5bf409765c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 5 deletions

View File

@ -12,6 +12,7 @@
#include "CollisionQueryParams.h"
#include "Carla/MapGen/LargeMapManager.h"
#include "Carla/Game/CarlaStatics.h"
#include "Carla/MapGen/SoilTypeManager.h"
#include "carla/rpc/String.h"
#include "HAL/PlatformFilemanager.h"
#include "HAL/RunnableThread.h"
@ -1997,6 +1998,24 @@ void UCustomTerrainPhysicsComponent::RunNNPhysicsSimulation(
WheelLinVel3.GetData(), WheelAngVel3.GetData()};
const FVehicleControl& VehicleControl = Vehicle->GetVehicleControl();
ASoilTypeManager* SoilTypeManagerActor = Cast<ASoilTypeManager>(UGameplayStatics::GetActorOfClass(GetWorld(), ASoilTypeManager::StaticClass()));
if(SoilTypeManagerActor)
{
FSoilTerramechanicsProperties TerramechanicsProperties =
SoilTypeManagerActor->GetTerrainPropertiesAtGlobalLocation(WheelPosition0);
switch(TerramechanicsProperties.TerrainType){
case ESoilTerramechanicsType::DESERT:
SoilType = 0;
break;
case ESoilTerramechanicsType::FOREST:
SoilType = 1;
break;
default:
SoilType = 0;
}
}
carla::learning::Inputs NNInput {Wheel0,Wheel1,Wheel2,Wheel3,
VehicleControl.Steer, VehicleControl.Throttle, VehicleControl.Brake,
SoilType, NNVerbose};

View File

@ -8,19 +8,20 @@
"terrainGeneralHeight": 0.80000001192092896,
"terrainGeneralMinHeight": 0,
"terrainGeneralMaxHeight": 0.57999998331069946,
"terrainGeneralInvert": 0.44999998807907104,
"terrainOverallSeed": 8917.5087890625,
"terrainGeneralInvert": 0.10000000149011612,
"terrainOverallSeed": 2702.71923828125,
"terrainOverallScale": 58,
"terrainOverallSlope": 7.9000000953674316,
"terrainOverallHeight": 2.7000000476837158,
"terrainOverallMinHeight": 0,
"terrainOverallMaxHeight": 1,
"terrainOverallInvert": 0.20000000298023224,
"terrainDetailedSeed": 1948.3016357421875,
"terrainOverallInvert": 0.60000002384185791,
"terrainDetailedSeed": 9199.1943359375,
"terrainDetailedScale": 21,
"terrainDetailedSlope": 0.30000001192092896,
"terrainDetailedHeight": 2.5,
"terrainDetailedMinHeight": 0,
"terrainDetailedMaxHeight": 1,
"terrainDetailedInvert": 0.25
"terrainDetailedInvert": 0.5,
"bShowDetailedNoise": true
}

View File

@ -178,6 +178,9 @@ struct CARLATOOLS_API FMapGeneratorWidgetState
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="MapGenerator|JsonLibrary")
float TerrainDetailedInvert;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="MapGenerator|JsonLibrary")
bool bShowDetailedNoise;
};
USTRUCT(BlueprintType)