update wheels check and added make trigger definitions function

This commit is contained in:
Manish 2019-05-08 11:08:12 +02:00
parent e51e3eb5f0
commit f3d5c6486f
4 changed files with 26 additions and 7 deletions

View File

@ -483,13 +483,21 @@ void UActorBlueprintFunctionLibrary::MakePedestrianDefinitions(
FillActorDefinitionArray(ParameterArray, Definitions, &MakePedestrianDefinition);
}
void UActorBlueprintFunctionLibrary::MakeTriggerDefinitions(
const TArray<FString> &ParameterArray,
TArray<FActorDefinition> &Definitions)
{
FillActorDefinitionArray(ParameterArray, Definitions, &MakeTriggerDefinition);
}
void UActorBlueprintFunctionLibrary::MakeTriggerDefinition(
const FString &Id,
bool &Success,
FActorDefinition &Definition)
{
FillIdAndTags(Definition, TEXT("trigger"), Id);
AddVariationsForTrigger(Definition);
bool Success = CheckActorDefinition(Definition);
Success = CheckActorDefinition(Definition);
check(Success);
}

View File

@ -92,9 +92,15 @@ public:
const TArray<FPedestrianParameters> &ParameterArray,
TArray<FActorDefinition> &Definitions);
UFUNCTION(Category = "Carla Actor", BlueprintCallable)
static void MakeTriggerDefinitions(
const TArray<FString> &ParameterArray,
TArray<FActorDefinition> &Definitions);
UFUNCTION(Category = "Carla Actor", BlueprintCallable)
static void MakeTriggerDefinition(
const FString &Id,
bool &Success,
FActorDefinition &Definition);
UFUNCTION(Category = "Carla Actor", BlueprintCallable)
@ -110,9 +116,9 @@ public:
UFUNCTION()
static void MakeObstacleDetectorDefinitions(
const FString &Type,
const FString &Id,
FActorDefinition &Definition);
const FString &Type,
const FString &Id,
FActorDefinition &Definition);
/// @}
/// ==========================================================================

View File

@ -12,7 +12,7 @@
#include "Carla/Trigger/FrictionTrigger.h"
// =============================================================================
// -- ASensorFactory -----------------------------------------------------------
// -- ATriggerFactory -----------------------------------------------------------
// =============================================================================
TArray<FActorDefinition> ATriggerFactory::GetDefinitions()
@ -22,7 +22,9 @@ TArray<FActorDefinition> ATriggerFactory::GetDefinitions()
TArray<FActorDefinition> TriggerDefinitions;
UActorBlueprintFunctionLibrary::MakeTriggerDefinition(TEXT("friction"), TriggerDefinition);
bool Success;
UActorBlueprintFunctionLibrary::MakeTriggerDefinition(TEXT("friction"), Success, TriggerDefinition);
check(Success);
TriggerDefinitions.Add(TriggerDefinition);
return TriggerDefinitions;

View File

@ -297,7 +297,10 @@ void ACarlaWheeledVehicle::ApplyVehiclePhysicsControl(const FVehiclePhysicsContr
// Wheels Setup
const int PhysicsWheelsNum = PhysicsControl.Wheels.Num();
check(PhysicsWheelsNum == 4);
if (PhysicsWheelsNum != 4) {
UE_LOG(LogCarla, Error, TEXT("Number of WheelPhysicsControl is not 4."));
return;
}
TArray<FWheelSetup> NewWheelSetups;
for (auto i = 0u; i < PhysicsWheelsNum; ++i)