RapyutaSimulationPlugins
|
Base actor class for all Rapyuta Sim actors: More...
#include <RRBaseActor.h>
Public Member Functions | |
ARRBaseActor () | |
Construct a new ARRBaseActor object. More... | |
ARRBaseActor (const FObjectInitializer &ObjectInitializer) | |
Construct a new ARRBaseActor object. More... | |
void | SetupDefaultBase () |
Initialize default components being configurable in child BP classes. More... | |
void | SetEntityModelName (const FString &InEntityModelName) |
bool | IsDataSynthEntity () const |
template<typename TActorSpawnInfo > | |
bool | InitializeWithSpawnInfo (const TActorSpawnInfo &InActorInfo) |
ACTOR INTIALIZING GENERAL INFO (Unique name, mesh list, material list, etc.) More... | |
virtual bool | Initialize () |
Set #GameMode #GameState #GameSingleton #PlayerController. More... | |
virtual bool | HasInitialized (bool bIsLogged=false) const |
virtual void | Reset () |
Rest. Calls #ActorInfo::ClearMeshInfo. More... | |
void | SetTickEnabled (bool bInIsTickEnabled) |
Use URRUObjectUtils::SetupActorTick. More... | |
virtual void | GetLifetimeReplicatedProps (TArray< FLifetimeProperty > &OutLifetimeProps) const override |
Returns the properties used for network replication, this needs to be overridden by all actor classes with native. More... | |
Public Attributes | |
TSharedPtr< FRRActorSpawnInfo > | ActorInfo = nullptr |
ARRGameState * | RRGameState = nullptr |
Pointer for convinience. Since this pointer can be nullptr, you need null check before using. More... | |
URRGameSingleton * | RRGameSingleton = nullptr |
Pointer for convinience. Since this pointer can be nullptr, you need null check before using. More... | |
ARRGameMode * | RRGameMode = nullptr |
Pointer for convinience. Since this pointer can be nullptr, you need null check before using. More... | |
ARRPlayerController * | RRPlayerController = nullptr |
Pointer for convinience. Since this pointer can be nullptr, you need null check before using. More... | |
int8 | SceneInstanceId = URRActorCommon::DEFAULT_SCENE_INSTANCE_ID |
URRActorCommon * | ActorCommon = nullptr |
FString | EntityUniqueName |
Actually Object's Name is also unique as noted by UE, but we just do not want to rely on it. More... | |
FString | EntityModelName |
FTimerHandle | GenericTimerHandle |
Static Public Attributes | |
static TMap< UClass *, TUniquePtr< std::once_flag > > | OnceFlagList |
[std::once_flag] also applies even in case of consecutive PIE runs, More... | |
static std::once_flag | OnceFlag |
Used for class having single-branch child classes (linear inheritance tree) More... | |
static int8 | SSceneInstanceId |
Protected Member Functions | |
virtual void | PreInitializeComponents () override |
Set #GameMode #GameState #GameSingleton #PlayerController. More... | |
virtual void | PrintSimConfig () const |
Print class members' values configured in RapyutaSimSettings.ini. More... | |
virtual void | DoGlobalConfig () |
Globally config custom setups (eg. Exec() cmds) applied for all instances of this class. More... | |
Base actor class for all Rapyuta Sim actors:
[ActorCommon] of the Scene instance it belongs to.
ARRBaseActor::ARRBaseActor | ( | ) |
Construct a new ARRBaseActor object.
UE has a very special way of having [AActor] instantiated, in which
default object is always created as the editor is loaded up.
Hence, it's recommended not to put particular Actor's content instantiation or initialization inside ctor,
especially if those contents (eg child mesh components) rely on sim's global resources, which are initialized later during
sim start-up!
Please put them in [Initialize()] instead!
ARRBaseActor::ARRBaseActor | ( | const FObjectInitializer & | ObjectInitializer | ) |
Construct a new ARRBaseActor object.
ObjectInitializer |
|
inlineprotectedvirtual |
Globally config custom setups (eg. Exec() cmds) applied for all instances of this class.
|
overridevirtual |
Returns the properties used for network replication, this needs to be overridden by all actor classes with native.
replicated properties
OutLifetimeProps | Output lifetime properties |
Reimplemented in ARRBaseRobot, ARobotVehicle, and ATurtlebotBurgerVehicle.
|
virtual |
Reimplemented in ARRMeshActor.
|
virtual |
Set #GameMode #GameState #GameSingleton #PlayerController.
(NOTE) This method, if being called, could only go with a RRGameMode-inheriting game mode setup!
Currently, ARRROS2GameMode & ARRGameMode are separate ones.
& Maps of ARRROS2GameMode do NOT YET have actors invoking this method.
It is up to the Child class, [Initialize()] could be run inside [BeginPlay()] or some place else in advance!
ALSO, DUE TO BEING VIRTUAL, CANNOT BE MERGED WITH [InitializeWithSpawnInfo()]
Reimplemented in ARRSceneDirector, ARRCamera, and ARRMeshActor.
|
inline |
ACTOR INTIALIZING GENERAL INFO (Unique name, mesh list, material list, etc.)
NOTE: This allows child actor to create custom ActorSpawnInfo of its own
TActorSpawnInfo |
InActorInfo |
|
inline |
|
overrideprotectedvirtual |
Set #GameMode #GameState #GameSingleton #PlayerController.
Reimplemented in ARRBaseRobot, ATurtlebotBurgerVehicle, and ARobotVehicle.
|
inlineprotectedvirtual |
Print class members' values configured in RapyutaSimSettings.ini.
Reimplemented in ARRCamera.
|
virtual |
Rest. Calls #ActorInfo::ClearMeshInfo.
Reimplemented in ARRMeshActor.
|
inline |
void ARRBaseActor::SetTickEnabled | ( | bool | bInIsTickEnabled | ) |
Use URRUObjectUtils::SetupActorTick.
bInIsTickEnabled |
void ARRBaseActor::SetupDefaultBase | ( | ) |
Initialize default components being configurable in child BP classes.
Could only be called in constructor.
URRActorCommon* ARRBaseActor::ActorCommon = nullptr |
TSharedPtr<FRRActorSpawnInfo> ARRBaseActor::ActorInfo = nullptr |
FString ARRBaseActor::EntityModelName |
FString ARRBaseActor::EntityUniqueName |
Actually Object's Name is also unique as noted by UE, but we just do not want to rely on it.
Instead, we use [EntityUniqueName] to make the robot id control more indpendent of ue internal name handling.
Reasons:
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ExposeOnSpawn = "true"), Replicated)
FTimerHandle ARRBaseActor::GenericTimerHandle |
|
static |
Used for class having single-branch child classes (linear inheritance tree)
|
static |
[std::once_flag] also applies even in case of consecutive PIE runs,
thus if running in PIE and the called function is required to run again each time (though still once per PIE) then,
another (context-specific) method (without using [static res]) should be considered!
Used for class having multiple-branch child classes (multiple-branch inheritance tree)
ARRGameMode* ARRBaseActor::RRGameMode = nullptr |
Pointer for convinience. Since this pointer can be nullptr, you need null check before using.
URRGameSingleton* ARRBaseActor::RRGameSingleton = nullptr |
Pointer for convinience. Since this pointer can be nullptr, you need null check before using.
ARRGameState* ARRBaseActor::RRGameState = nullptr |
Pointer for convinience. Since this pointer can be nullptr, you need null check before using.
ARRPlayerController* ARRBaseActor::RRPlayerController = nullptr |
Pointer for convinience. Since this pointer can be nullptr, you need null check before using.
int8 ARRBaseActor::SceneInstanceId = URRActorCommon::DEFAULT_SCENE_INSTANCE_ID |
|
static |