Agrarsense
|
#include <AssetLibrary.h>
Static Public Member Functions | |
static AActor * | SpawnFoliage (EFoliageTypes FoliageType, FTransform Transform, FString ActorName="", FString ActorID="", bool RandomZRotation=true, bool SnapToGround=true) |
static AVehicle * | SpawnVehicle (EVehicleTypes VehicleType, FTransform SpawnTransform, const FString &ActorName, const FString &ActorID, bool SnapAboveGround=false, float AboveOffset=150.0f, bool DestroyOverlappingActors=false) |
static AActor * | SpawnProp (EPropTypes PropType, FTransform Transform, FString ActorName="", FString ActorID="", bool RandomZRotation=false, bool SnapToGround=false) |
static AWalker * | SpawnWalker (FWalkerParameters Parameters, const FString &ActorName="", const FString &ActorID="", bool StartAutomatically=true) |
static UPropActorAssetMapDataAsset * | GetPropActorAssetMapDataAsset () |
static EPropTypes | GetRandomPropType () |
static TArray< AInstancedActor * > | GetAllAddedPropActors () |
static UFoliageActorAssetMapDataAsset * | GetFoliageActorAssetMapDataAsset () |
static EFoliageTypes | GetRandomFoliageType () |
static TArray< AInstancedActor * > | GetAllAddedFoliageActors () |
static TArray< FVehicleData > | GetSpawnedVehicles () |
static void | DestroyAllWalkers () |
static TArray< AWalker * > | GetAllWalkers () |
static UWalkerActorAssetMapDataAsset * | GetWalkerActorAssetMapDataAsset () |
Static Private Member Functions | |
static AActor * | TrySpawnActor (TSubclassOf< AActor > ActorClass, FTransform &Transform, FString ActorName, FString ActorID, bool SnapToGround, bool RandomZRotation, ESpawnActorCollisionHandlingMethod CollisionMethod=ESpawnActorCollisionHandlingMethod::Undefined) |
static void | DestroyOverlappingActorsSphere (AActor *SpawnedActor) |
static void | SetupVehicleDataAsset () |
static void | SetupFoliageDataAsset () |
static void | SetupPropDataAsset () |
static void | SetupWalkerDataAsset () |
Static Private Attributes | |
static TWeakObjectPtr< UVehicleActorAssetMapDataAsset > | VehicleDataAsset |
static TArray< FVehicleData > | SpawnedVehicles |
static TWeakObjectPtr< UFoliageActorAssetMapDataAsset > | FoliageActorAssetMapDataAsset |
static TMap< EFoliageTypes, FString > | FoliageTypeMap |
static TArray< FInstancedActorData > | AddedFoliageActors |
static TArray< EFoliageTypes > | FoliageKeys |
static TWeakObjectPtr< UPropActorAssetMapDataAsset > | PropActorAssetMapDataAsset |
static TArray< FInstancedActorData > | SpawnedPropActors |
static TMap< EPropTypes, FString > | PropTypeMap |
static TArray< EPropTypes > | PropKeys |
static TWeakObjectPtr< UWalkerActorAssetMapDataAsset > | WalkerActorAssetMapDataAsset |
static TArray< TWeakObjectPtr< AWalker > > | SpanwedWalkers |
Library for spawning Vehicles, Foliage, Props and Walkers assets into the World.
Definition at line 53 of file AssetLibrary.h.
|
static |
Destroy all Walkers from the World.
Definition at line 425 of file AssetLibrary.cpp.
References GetAllWalkers(), SimulatorLog::Log(), and Walker.
Referenced by UROSCommands::HandleDestroyAllWalkers().
|
staticprivate |
Definition at line 266 of file AssetLibrary.cpp.
Referenced by SpawnVehicle().
|
static |
Retrieve a list of all added foliage actors within this Foliage Factory.
Definition at line 333 of file AssetLibrary.cpp.
References FInstancedActorData::Actor, and AddedFoliageActors.
Referenced by UROSCommands::HandleExportFoliage().
|
static |
Retrieve a list of all added Prop actors within this Prop Factory.
Definition at line 375 of file AssetLibrary.cpp.
References FInstancedActorData::Actor, and SpawnedPropActors.
Referenced by UROSCommands::HandleExportProps().
|
static |
Get All Walkers from the World.
Definition at line 403 of file AssetLibrary.cpp.
References SpanwedWalkers.
Referenced by DestroyAllWalkers(), and UROSCommands::HandleExportWalkers().
|
static |
Definition at line 312 of file AssetLibrary.cpp.
References FoliageActorAssetMapDataAsset, and SetupFoliageDataAsset().
|
static |
Definition at line 354 of file AssetLibrary.cpp.
References PropActorAssetMapDataAsset, and SetupPropDataAsset().
|
static |
Definition at line 319 of file AssetLibrary.cpp.
References FoliageKeys, NONE, and SetupFoliageDataAsset().
|
static |
Definition at line 361 of file AssetLibrary.cpp.
References NONE, PropKeys, and SetupPropDataAsset().
|
static |
Retrieves an array of spawned vehicles.
Definition at line 302 of file AssetLibrary.cpp.
References SpawnedVehicles, and FVehicleData::Vehicle.
Referenced by UROSCommands::HandleExportVehicles().
|
static |
Definition at line 396 of file AssetLibrary.cpp.
References SetupWalkerDataAsset(), and WalkerActorAssetMapDataAsset.
|
staticprivate |
Definition at line 458 of file AssetLibrary.cpp.
References FOLIAGE_ASSET_PATH, FoliageActorAssetMapDataAsset, FoliageKeys, and FoliageTypeMap.
Referenced by GetFoliageActorAssetMapDataAsset(), GetRandomFoliageType(), and SpawnFoliage().
|
staticprivate |
Definition at line 477 of file AssetLibrary.cpp.
References PROP_ASSET_PATH, PropActorAssetMapDataAsset, PropKeys, PropTypeMap, and SpawnedPropActors.
Referenced by GetPropActorAssetMapDataAsset(), GetRandomPropType(), and SpawnProp().
|
staticprivate |
Definition at line 448 of file AssetLibrary.cpp.
References VEHICLE_ASSET_PATH, and VehicleDataAsset.
Referenced by SpawnVehicle().
|
staticprivate |
Definition at line 497 of file AssetLibrary.cpp.
References WALKER_ASSET_PATH, and WalkerActorAssetMapDataAsset.
Referenced by GetWalkerActorAssetMapDataAsset(), and SpawnWalker().
|
static |
Spawns a foliage actor at the specified transform. Returns a pointer to the spawned actor or nullptr.
Definition at line 51 of file AssetLibrary.cpp.
References FActorAsset::Actor, UActorAssetDataAsset::ActorAsset, FoliageActorAssetMapDataAsset, SetupFoliageDataAsset(), Transform, and TrySpawnActor().
Referenced by USimulatorJsonParser::ParsePropOrFoliage().
|
static |
Spawns a prop at the specified location. Returns a pointer to the spawned actor or nullptr.
Definition at line 125 of file AssetLibrary.cpp.
References FActorAsset::Actor, FInstancedActorData::Actor, UActorAssetDataAsset::ActorAsset, PropActorAssetMapDataAsset, PropTypeMap, AInstancedActor::SetTypeAndModel(), SetupPropDataAsset(), SpawnedPropActors, Transform, and TrySpawnActor().
Referenced by USimulatorJsonParser::ParsePropOrFoliage().
|
static |
Spawns a vehicle at the specified transform. Returns a pointer to the spawned vehicle or nullptr.
Definition at line 70 of file AssetLibrary.cpp.
References FActorAsset::Actor, UActorAssetDataAsset::ActorAsset, UEnumUtilities::ConvertVehicleTypeToString(), DestroyOverlappingActorsSphere(), Drone, SetupVehicleDataAsset(), UPhysicsUtilities::SnapActorAboveGround(), SpawnedVehicles, TrySpawnActor(), Vehicle, FVehicleData::Vehicle, VehicleDataAsset, and FVehicleData::VehicleType.
Referenced by USimulatorJsonParser::ParseVehicle().
|
static |
Spawns a walker based on the provided parameters. Returns a pointer to the spawned walker or nullptr.
Definition at line 160 of file AssetLibrary.cpp.
References FActorAsset::Actor, UActorAssetDataAsset::ActorAsset, UEnumUtilities::ConvertWalkerTypeToString(), FollowPath, SimulatorLog::Log(), FWalkerParameters::Points, SetupWalkerDataAsset(), SpanwedWalkers, TrySpawnActor(), Walker, FWalkerParameters::WalkerAction, WalkerActorAssetMapDataAsset, and FWalkerParameters::WalkerType.
Referenced by USimulatorJsonParser::SpawnWalker().
|
staticprivate |
Definition at line 205 of file AssetLibrary.cpp.
References UPhysicsUtilities::SnapActorToGround(), and Transform.
Referenced by SpawnFoliage(), SpawnProp(), SpawnVehicle(), and SpawnWalker().
|
staticprivate |
Definition at line 176 of file AssetLibrary.h.
Referenced by GetAllAddedFoliageActors().
|
staticprivate |
Definition at line 174 of file AssetLibrary.h.
Referenced by GetFoliageActorAssetMapDataAsset(), SetupFoliageDataAsset(), and SpawnFoliage().
|
staticprivate |
Definition at line 177 of file AssetLibrary.h.
Referenced by GetRandomFoliageType(), and SetupFoliageDataAsset().
|
staticprivate |
Definition at line 175 of file AssetLibrary.h.
Referenced by SetupFoliageDataAsset().
|
staticprivate |
Definition at line 180 of file AssetLibrary.h.
Referenced by GetPropActorAssetMapDataAsset(), SetupPropDataAsset(), and SpawnProp().
|
staticprivate |
Definition at line 183 of file AssetLibrary.h.
Referenced by GetRandomPropType(), and SetupPropDataAsset().
|
staticprivate |
Definition at line 182 of file AssetLibrary.h.
Referenced by SetupPropDataAsset(), and SpawnProp().
|
staticprivate |
Definition at line 187 of file AssetLibrary.h.
Referenced by GetAllWalkers(), and SpawnWalker().
|
staticprivate |
Definition at line 181 of file AssetLibrary.h.
Referenced by GetAllAddedPropActors(), SetupPropDataAsset(), and SpawnProp().
|
staticprivate |
Definition at line 171 of file AssetLibrary.h.
Referenced by GetSpawnedVehicles(), and SpawnVehicle().
|
staticprivate |
Definition at line 170 of file AssetLibrary.h.
Referenced by SetupVehicleDataAsset(), and SpawnVehicle().
|
staticprivate |
Definition at line 186 of file AssetLibrary.h.
Referenced by GetWalkerActorAssetMapDataAsset(), SetupWalkerDataAsset(), and SpawnWalker().