RapyutaSimulationPlugins
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes | Friends | List of all members
URRActorCommon Class Reference

Scene instance's common object which houses Plugin-specific dynamic properties and implement objects-related API (Spawning, teleporting, etc.) More...

#include <RRActorCommon.h>

Inheritance diagram for URRActorCommon:
Inheritance graph
[legend]
Collaboration diagram for URRActorCommon:
Collaboration graph
[legend]

Public Member Functions

 URRActorCommon ()
 
virtual void PrintSimConfig () const
 Print sim config vars in INI. More...
 
virtual void OnStartSim ()
 Callback on ARRGameState::StartSim() for this scene instance. More...
 
virtual void OnBeginPlay ()
 Callback on ARRGameState::BeginPlay() for this scene instance. More...
 
virtual void OnEndPlay (const EEndPlayReason::Type EndPlayReason)
 Callback on ARRGameState::EndPlay() for this scene instance. More...
 
virtual bool HasInitialized (bool bIsLogged=false) const
 Whether this scene instance's common object has been initialized. More...
 
virtual void SetupEnvironment ()
 Setup the scene instance's environment. More...
 
int32 GenerateUniqueDepthStencilValue ()
 Generate a new unique custom depth stencil value for a mesh actor's Segmentation mask. More...
 

Static Public Member Functions

static URRActorCommonGetActorCommon (int8 InSceneInstanceId=URRActorCommon::DEFAULT_SCENE_INSTANCE_ID, UClass *ActorCommonClass=nullptr, UObject *Outer=nullptr)
 
static void OnPostWorldCleanup (UWorld *InWorld, bool, bool)
 Callback for world cleanup end. More...
 
static FORCEINLINE uint64 GetNextSceneId ()
 

Public Attributes

int8 SceneInstanceId = DEFAULT_SCENE_INSTANCE_ID
 Each scene instance house a series of scene, in which operations are performed. More...
 
FVector SceneInstanceLocation = FVector::ZeroVector
 Location of the current scene instance this ActorCommon belongs to. More...
 
uint64 CurrentSceneId = 0
 Current scene id. More...
 
AActor * SceneFloor = nullptr
 Main environment actor if pre-setup in the level. More...
 
AActor * SceneWall = nullptr
 Main floor actor if pre-setup in the level. More...
 
ARRCameraSceneCamera = nullptr
 Main camera actor used in the scene instance. More...
 
TArray< ALight * > MainLights
 
FOnMeshActorFullyCreated OnMeshActorFullyCreated
 Move the common main environment to another scene instance. More...
 
int32 LatestCustomDepthStencilValue = 0
 

Static Public Attributes

static constexpr int8 DEFAULT_SCENE_INSTANCE_ID = 0
 
static constexpr const TCHAR * SCRIPT_INI_PATH = TEXT("/Script/RapyutaSimulationPlugins.RRActorCommon")
 
static std::once_flag OnceFlag
 
static constexpr const TCHAR * SPACE_STR = TEXT(" ")
 
static constexpr const TCHAR * DELIMITER_STR = TEXT(",")
 
static constexpr const TCHAR * UNDERSCORE_STR = TEXT("_")
 
static constexpr const char * NAN_STR = "NaN"
 
static const std::string QUOTED_NAN_STR
 
static constexpr const char * NONE_STR = "None"
 
static constexpr const char * NULL_STR = "Null"
 
static const std::string QUOTED_NULL_STR
 
static constexpr const char * DOUBLE_QUOTE_CHAR = "\""
 
static constexpr int32 SIM_SCENE_COMPLETION_TIMEOUT_SECS = 10
 
static constexpr int8 IMAGE_BIT_DEPTH_INT8 = 8
 
static constexpr int8 IMAGE_BIT_DEPTH_FLOAT16 = 16
 
static constexpr int8 IMAGE_BIT_DEPTH_FLOAT32 = 32
 
static constexpr const TCHAR * MAP_ORIGIN_TAG = TEXT("map_origin")
 
static constexpr const TCHAR * MAP_ROS_FRAME_ID = TEXT("map")
 
static uint64 SLatestSceneId
 Generate a new scene id. More...
 
static constexpr int16 MAX_CUSTOM_DEPTH_STENCIL_VALUES_NUM = 76
 
static constexpr int8 DEFAULT_CUSTOM_DEPTH_STENCIL_VALUE_VOID = 0
 
static TArray< int32 > StaticCustomDepthStencilList
 This list contains Static Objects' [CustomDepthStencilValue]s that are assigned once and never change during Sim run! More...
 

Static Private Attributes

static TMap< int8, URRActorCommon * > SActorCommonList
 

Friends

class URRCoreUtils
 !! [ActorCommon] OBJECT COULD ONLY BE ACCESSED FROM BEGINPLAY(), More...
 

Detailed Description

Scene instance's common object which houses Plugin-specific dynamic properties and implement objects-related API (Spawning, teleporting, etc.)

If USE_SCENE_DIRECTOR is disabled, there is only one single ActorCommon being shared among all RRBaseActor.

Note
Mostly responsible for holding handles to URRSceneInstance (Main environment, camera, etc.)

UCLASS(Config = RapyutaSimSettings)

Constructor & Destructor Documentation

◆ URRActorCommon()

URRActorCommon::URRActorCommon ( )

Member Function Documentation

◆ GenerateUniqueDepthStencilValue()

int32 URRActorCommon::GenerateUniqueDepthStencilValue ( )
inline

Generate a new unique custom depth stencil value for a mesh actor's Segmentation mask.

◆ GetActorCommon()

static URRActorCommon* URRActorCommon::GetActorCommon ( int8  InSceneInstanceId = URRActorCommon::DEFAULT_SCENE_INSTANCE_ID,
UClass *  ActorCommonClass = nullptr,
UObject *  Outer = nullptr 
)
static

◆ GetNextSceneId()

static FORCEINLINE uint64 URRActorCommon::GetNextSceneId ( )
inlinestatic

◆ HasInitialized()

virtual bool URRActorCommon::HasInitialized ( bool  bIsLogged = false) const
virtual

Whether this scene instance's common object has been initialized.

Parameters
bIsLoggedWhether to log on uninitialized contents

◆ OnBeginPlay()

virtual void URRActorCommon::OnBeginPlay ( )
inlinevirtual

Callback on ARRGameState::BeginPlay() for this scene instance.

◆ OnEndPlay()

virtual void URRActorCommon::OnEndPlay ( const EEndPlayReason::Type  EndPlayReason)
inlinevirtual

Callback on ARRGameState::EndPlay() for this scene instance.

◆ OnPostWorldCleanup()

static void URRActorCommon::OnPostWorldCleanup ( UWorld *  InWorld,
bool  ,
bool   
)
static

Callback for world cleanup end.

See also
Ref
Parameters
InWorld
bInSessionEndedWhether to notify the viewport that the game session (PIE, Game, etc.) has ended.
bInCleanupResourcesWhether resources should be cleaned up

◆ OnStartSim()

virtual void URRActorCommon::OnStartSim ( )
virtual

Callback on ARRGameState::StartSim() for this scene instance.

◆ PrintSimConfig()

virtual void URRActorCommon::PrintSimConfig ( ) const
virtual

Print sim config vars in INI.

◆ SetupEnvironment()

virtual void URRActorCommon::SetupEnvironment ( )
virtual

Setup the scene instance's environment.

Friends And Related Function Documentation

◆ URRCoreUtils

friend class URRCoreUtils
friend

!! [ActorCommon] OBJECT COULD ONLY BE ACCESSED FROM BEGINPLAY(),

THUS SPECIFC SIM START-UP RELATED CONTENTS & HANDLINGS, WHICH HAPPENS BEFORE BEGINPLAY(), SHOULD BE MOVED TO GameMode or GameInstance.

Member Data Documentation

◆ CurrentSceneId

uint64 URRActorCommon::CurrentSceneId = 0

Current scene id.

UPROPERTY()

◆ DEFAULT_CUSTOM_DEPTH_STENCIL_VALUE_VOID

constexpr int8 URRActorCommon::DEFAULT_CUSTOM_DEPTH_STENCIL_VALUE_VOID = 0
staticconstexpr

◆ DEFAULT_SCENE_INSTANCE_ID

constexpr int8 URRActorCommon::DEFAULT_SCENE_INSTANCE_ID = 0
staticconstexpr

◆ DELIMITER_STR

constexpr const TCHAR* URRActorCommon::DELIMITER_STR = TEXT(",")
staticconstexpr

◆ DOUBLE_QUOTE_CHAR

constexpr const char* URRActorCommon::DOUBLE_QUOTE_CHAR = "\""
staticconstexpr

◆ IMAGE_BIT_DEPTH_FLOAT16

constexpr int8 URRActorCommon::IMAGE_BIT_DEPTH_FLOAT16 = 16
staticconstexpr

◆ IMAGE_BIT_DEPTH_FLOAT32

constexpr int8 URRActorCommon::IMAGE_BIT_DEPTH_FLOAT32 = 32
staticconstexpr

◆ IMAGE_BIT_DEPTH_INT8

constexpr int8 URRActorCommon::IMAGE_BIT_DEPTH_INT8 = 8
staticconstexpr

◆ LatestCustomDepthStencilValue

int32 URRActorCommon::LatestCustomDepthStencilValue = 0

◆ MainLights

TArray<ALight*> URRActorCommon::MainLights

◆ MAP_ORIGIN_TAG

constexpr const TCHAR* URRActorCommon::MAP_ORIGIN_TAG = TEXT("map_origin")
staticconstexpr

◆ MAP_ROS_FRAME_ID

constexpr const TCHAR* URRActorCommon::MAP_ROS_FRAME_ID = TEXT("map")
staticconstexpr

◆ MAX_CUSTOM_DEPTH_STENCIL_VALUES_NUM

constexpr int16 URRActorCommon::MAX_CUSTOM_DEPTH_STENCIL_VALUES_NUM = 76
staticconstexpr

◆ NAN_STR

constexpr const char* URRActorCommon::NAN_STR = "NaN"
staticconstexpr

◆ NONE_STR

constexpr const char* URRActorCommon::NONE_STR = "None"
staticconstexpr

◆ NULL_STR

constexpr const char* URRActorCommon::NULL_STR = "Null"
staticconstexpr

◆ OnceFlag

std::once_flag URRActorCommon::OnceFlag
static

◆ OnMeshActorFullyCreated

FOnMeshActorFullyCreated URRActorCommon::OnMeshActorFullyCreated

Move the common main environment to another scene instance.

Callback on a mesh actor being fully created in the scene

◆ QUOTED_NAN_STR

const std::string URRActorCommon::QUOTED_NAN_STR
static

◆ QUOTED_NULL_STR

const std::string URRActorCommon::QUOTED_NULL_STR
static

◆ SActorCommonList

TMap<int8, URRActorCommon*> URRActorCommon::SActorCommonList
staticprivate

◆ SceneCamera

ARRCamera* URRActorCommon::SceneCamera = nullptr

Main camera actor used in the scene instance.

UPROPERTY()

◆ SceneFloor

AActor* URRActorCommon::SceneFloor = nullptr

Main environment actor if pre-setup in the level.

UPROPERTY()

◆ SceneInstanceId

int8 URRActorCommon::SceneInstanceId = DEFAULT_SCENE_INSTANCE_ID

Each scene instance house a series of scene, in which operations are performed.

UPROPERTY()

◆ SceneInstanceLocation

FVector URRActorCommon::SceneInstanceLocation = FVector::ZeroVector

Location of the current scene instance this ActorCommon belongs to.

UPROPERTY()

◆ SceneWall

AActor* URRActorCommon::SceneWall = nullptr

Main floor actor if pre-setup in the level.

Main wall actor if pre-setup in the level

UPROPERTY()

◆ SCRIPT_INI_PATH

constexpr const TCHAR* URRActorCommon::SCRIPT_INI_PATH = TEXT("/Script/RapyutaSimulationPlugins.RRActorCommon")
staticconstexpr

◆ SIM_SCENE_COMPLETION_TIMEOUT_SECS

constexpr int32 URRActorCommon::SIM_SCENE_COMPLETION_TIMEOUT_SECS = 10
staticconstexpr

◆ SLatestSceneId

uint64 URRActorCommon::SLatestSceneId
static

Generate a new scene id.

Each scene is assigned with a unique id, regardless of which scene instance it belongs

◆ SPACE_STR

constexpr const TCHAR* URRActorCommon::SPACE_STR = TEXT(" ")
staticconstexpr

◆ StaticCustomDepthStencilList

TArray<int32> URRActorCommon::StaticCustomDepthStencilList
static

This list contains Static Objects' [CustomDepthStencilValue]s that are assigned once and never change during Sim run!

Example: Bucket's (DropPlatform is also a static object but its custom depth render is disabled due to not being segmasked)

◆ UNDERSCORE_STR

constexpr const TCHAR* URRActorCommon::UNDERSCORE_STR = TEXT("_")
staticconstexpr

The documentation for this class was generated from the following file: