Agrarsense
|
#include <SensorFactory.h>
Static Private Member Functions | |
template<typename T > | |
static T * | SpawnSensor (const FSensorSpawnParameters &SpawnParameters, bool SpawnSensorModel=true) |
static void | SetSensorIdentifierAndNameWithFallbacks (ASensor *Sensor, const FString &SensorIdentifier, const FString &SensorName) |
static ASensorModel * | SpawnModelClassForSensor (ASensor *attachTo) |
static ASensorModel * | SpawnModelClass (TSubclassOf< ASensorModel > ModelClass, ASensor *AttachTo) |
static void | Initialize () |
static UWorld * | GetGameWorld () |
Gets the current game world from the viewport. More... | |
Static Private Attributes | |
static TWeakObjectPtr< USensorMapDataAsset > | SensorMapDataAsset |
SensorFactory is a UBlueprintFunctionLibrary based class in charge of spawning sensors. Sensors should only be spawned through this class to ensure proper setup (settings params, spawning visual model etc). Note. This only works during runtime, don't call these functions in Editor without play mode on.
Definition at line 68 of file SensorFactory.h.
|
staticprivate |
Gets the current game world from the viewport.
Definition at line 279 of file SensorFactory.cpp.
Referenced by SpawnModelClass(), and SpawnSensor().
|
static |
Definition at line 52 of file SensorFactory.cpp.
References Initialize(), and SensorMapDataAsset.
Referenced by SpawnModelClassForSensor().
|
staticprivate |
Initialize the factory. Should be called before using data or calling functions
Definition at line 29 of file SensorFactory.cpp.
References SensorMapDataAsset.
Referenced by GetSensorMapDataAsset().
|
staticprivate |
Set sensor name and identifier but fallback to default values if sensor name and/or sensor identifier are empty.
sensor | Sensor which name and identifier to change |
sensorIdentifier | Sensor new identifier (empty identifier not accepted) |
sensorName | Sensor new name (empty name not accepted) |
Definition at line 188 of file SensorFactory.cpp.
References UEnumUtilities::ConvertSensorTypeToString(), ASensor::GetSensorIdentifier(), ASensor::GetSensorType(), ASensor::SetSensorIdentifier(), and ASensor::SetSensorName().
Referenced by SpawnSensor().
|
static |
Spawn new Camera sensor. BlueprintCallable.
FSensorSpawnParameters | Spawnparameters |
FCameraBaseParameters | FCameraBaseParameters parameters struct |
Definition at line 68 of file SensorFactory.cpp.
References ACamera::Init().
|
static |
Spawn new Collision sensor. BlueprintCallable.
FSensorSpawnParameters | Spawnparameters |
Definition at line 131 of file SensorFactory.cpp.
References ACollisionSensor::Init(), FSensorSpawnParameters::Parent, and FSensorSpawnParameters::SimulateSensor.
Referenced by AVehicle::BeginPlay().
|
static |
Spawn new Camera sensor. BlueprintCallable.
FSensorSpawnParameters | Spawnparameters |
FCameraBaseParameters | FCameraBaseParameters parameters struct |
Definition at line 86 of file SensorFactory.cpp.
References ADepthCamera::DepthInit(), and FSensorSpawnParameters::SimulateSensor.
|
static |
Spawn new Camera sensor. BlueprintCallable.
FSensorSpawnParameters | Spawnparameters |
FCameraBaseParameters | FCameraBaseParameters parameters struct |
Definition at line 113 of file SensorFactory.cpp.
References ADVSCamera::DVSInit(), and FSensorSpawnParameters::SimulateSensor.
|
static |
Spawn new Instance Segmentation Camera sensor. BlueprintCallable.
FSensorSpawnParameters | Spawnparameters |
FCameraBaseParameters | FCameraBaseParameters parameters struct |
Definition at line 104 of file SensorFactory.cpp.
References AInstanceSegmentationCamera::Init().
|
static |
Spawn new Lidar sensor. BlueprintCallable.
FSensorSpawnParameters | Spawnparameters |
FLidarParameters | FLidarParameters parameters struct |
Definition at line 59 of file SensorFactory.cpp.
References ALidar::Init().
|
staticprivate |
Spawn sensor visual model (3D model) class attaching it to the given sensor actor.
ModelClass | ASensorModel class for the sensor's model's class |
AttachTo | Attach to this sensor |
Definition at line 252 of file SensorFactory.cpp.
References GetGameWorld(), ASensorModel::InitAfterSpawn(), ASensorModel::SetAttachedToSensor(), and ASensor::SetSensorModel().
Referenced by SpawnModelClassForSensor().
|
staticprivate |
Spawn sensor model (3D model) class attaching it to the given actor
attachTo | Sensor to attach to |
Definition at line 217 of file SensorFactory.cpp.
References USensorMapDataAsset::GetAssetDataBySensorType(), GetSensorMapDataAsset(), ASensor::GetSensorType(), USensorDataAsset::ModelClass, and SpawnModelClass().
Referenced by SpawnSensor().
|
static |
Spawn new Overlap sensor. BlueprintCallable. This is spawned by default on every vehicle
FSensorSpawnParameters | Spawnparameters |
FOverlapSensorParameters* | Overlap sensor parameters |
Definition at line 150 of file SensorFactory.cpp.
References AOverlapSensor::Init().
Referenced by ASpectator::BeginPlay(), APIDDrone::BeginPlay(), AVehicle::BeginPlay(), and APIDDrone::ChangeDroneParameters().
|
static |
Spawn new Radar sensor. BlueprintCallable.
FSensorSpawnParameters | Spawnparameters |
FRadarParameters | FRadarParameters parameters struct |
Definition at line 122 of file SensorFactory.cpp.
References ARadar::Init(), and FSensorSpawnParameters::SimulateSensor.
|
static |
Spawn new Camera sensor. BlueprintCallable.
FSensorSpawnParameters | Spawnparameters |
FCameraBaseParameters | FCameraBaseParameters parameters struct |
Definition at line 95 of file SensorFactory.cpp.
References ASemanticSegmentationCamera::Init(), and FSensorSpawnParameters::SimulateSensor.
|
staticprivate |
Definition at line 160 of file SensorFactory.cpp.
References GetGameWorld(), FSensorSpawnParameters::Parent, FSensorSpawnParameters::SensorIdentifier, FSensorSpawnParameters::SensorName, SetSensorIdentifierAndNameWithFallbacks(), SpawnModelClassForSensor(), and FSensorSpawnParameters::Transform.
|
static |
Spawn new Camera sensor. BlueprintCallable.
FSensorSpawnParameters | Spawnparameters |
FCameraBaseParameters | FCameraBaseParameters parameters struct |
Definition at line 77 of file SensorFactory.cpp.
References FSensorSpawnParameters::SimulateSensor, and AThermalCamera::ThermalInit().
|
static |
Spawn new Tranform sensor. BlueprintCallable. This is spawned by default on every vehicle
FSensorSpawnParameters | Spawnparameters |
FTransformSensorParameters | Transform sensor parameters |
Definition at line 140 of file SensorFactory.cpp.
References ATransformSensor::Init(), FTransformSensorParameters::OwningActor, and FSensorSpawnParameters::SimulateSensor.
Referenced by ASensor::BeginPlay(), APIDDrone::BeginPlay(), AVehicle::BeginPlay(), and AWalker::BeginPlay().
|
staticprivate |
Sensor map data asset to hold sensor specific base data
Definition at line 226 of file SensorFactory.h.
Referenced by GetSensorMapDataAsset(), and Initialize().