RapyutaSimulationPlugins
Static Public Member Functions | List of all members
URRUObjectUtils Class Reference

UObject general utils. More...

#include <RRUObjectUtils.h>

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

Static Public Member Functions

template<typename T >
static FORCEINLINE T * CreateSelfSubobject (UObject *InOuter, const FString &InObjectUniqueName)
 
static FORCEINLINE UObject * CreateSelfSubobject (UObject *InOuter, UClass *InObjectClass, const FString &InObjectUniqueName)
 Use CreateDefaultSubobject or NewObject based on where this method is called. More...
 
template<typename T >
static FORCEINLINE bool HasSubobject (UObject *InParentObj, const FString &InChildName)
 Return true if InParentObj has subobjects with InChildName. More...
 
static FORCEINLINE FString ComposeDynamicResourceName (const FString &InPrefix, const FString &InResourceUniqueName)
 
static void SetupComponentTick (UActorComponent *InComponent, bool bIsTickEnabled)
 
static USceneComponent * SetupDefaultRootComponent (AActor *InActor)
 
template<typename T , typename = TEnableIf<TIsDerivedFrom<T, UPrimitiveComponent>::Value>>
static void ConfigureComponentPhysics (T *InComponent, bool bIsPhysicsEnabled, bool bIsCollisionEnabled, bool bIsOverlapEventEnabled)
 
static void DisableNavImpactAndPhysicsCollision (UPrimitiveComponent *InComponent)
 
static void AttachComponentToComponent (USceneComponent *InChildComp, USceneComponent *InParentComp, const FTransform &InRelativeTransf=FTransform::Identity, const FAttachmentTransformRules &InAttachmentRules=FAttachmentTransformRules::KeepRelativeTransform, const TCHAR *InSocketName=nullptr)
 Use SetupAttachment or AttachToComponent based on where this method is called. More...
 
template<typename T >
static T * CreateChildComponent (AActor *InActor, const FString &InUniqueName, bool bIsPhysicsEnabled=false, bool bIsCollisionEnabled=false, bool bIsOverlapEventEnabled=false)
 Create a Child Component object and attach to InActor and calls ConfigureComponentPhysics. More...
 
template<typename T >
static T * CreateAndAttachChildComponent (AActor *InActor, const FString &InUniqueName, const FTransform &InRelativeTransf=FTransform::Identity, USceneComponent *InParentComp=nullptr, const TCHAR *InAttachSocketName=nullptr)
 
template<typename TMeshComponent >
static FORCEINLINE TMeshComponent * CreateMeshComponent (AActor *InActor, const FString &InObjMeshUniqueName, const FString &InMeshCompUniqueName, const FTransform &InRelativeTransf, bool bInIsOwningActorStationary, bool bInIsPhysicsEnabled, bool bInIsCollisionEnabled, bool bInIsOverlapEventEnabled=false, USceneComponent *InParentComp=nullptr)
 Create a Mesh Component, attach to InActor, set parameters. More...
 
static void SetupActorTick (AActor *InActor, bool bIsTickEnabled, float InTickInterval=0.f)
 
static void RegisterActorComponent (UActorComponent *Comp)
 Uses URRThreadUtils::IsInsideConstructor() to avoid crash by calling RegisterComponents() outside of constructor. More...
 
static AActor * FindEnvironmentActor (UWorld *InWorld)
 
static AActor * FindSkyActor (UWorld *InWorld)
 
static ASkyLight * FindSkyLight (UWorld *InWorld)
 
static AActor * FindFloorActor (UWorld *InWorld)
 
static AActor * FindWallActor (UWorld *InWorld)
 
static TArray< AStaticMeshActor * > FindStaticMeshActorListByMeshSubname (UWorld *InWorld, const FString &InMeshSubname, bool bCreateMaterialInstanceDynamic, const ESearchCase::Type InCaseType=ESearchCase::IgnoreCase)
 
template<typename T >
static TArray< T * > FindActorListByType (UWorld *InWorld)
 
static APostProcessVolume * FindPostProcessVolume (UWorld *InWorld)
 
template<typename T , typename TActorSpawnInfo >
static T * SpawnSimActor (UWorld *InWorld, int8 InSceneInstanceId, const TActorSpawnInfo &InActorSpawnInfo, const ESpawnActorCollisionHandlingMethod CollisionHandlingType=ESpawnActorCollisionHandlingMethod::AlwaysSpawn)
 Spawn a generic actor that is either mesh-based or mesh-free & initialize it with actor spawn info. More...
 
static ARRBaseActorSpawnSimActor (UWorld *InWorld, int8 InSceneInstanceId, UClass *InActorClass, const FString &InEntityModelName, const FString &InActorName=EMPTY_STR, const FTransform &InActorTransform=FTransform::Identity, const ESpawnActorCollisionHandlingMethod InCollisionHandlingType=ESpawnActorCollisionHandlingMethod::AlwaysSpawn, const FRRActorSpawnInfo &InActorSpawnInfo=FRRActorSpawnInfo())
 Spawn a generic actor that is either mesh-based or mesh-free. More...
 
static FORCEINLINE FVector GetRelativeLocFrom (const AActor *InActor, const AActor *InBaseActor)
 
static FORCEINLINE FQuat GetRelativeQuatFrom (const FQuat &InQuat, const AActor *InBaseActor)
 
static FORCEINLINE FQuat GetRelativeQuatFrom (const AActor *InActor, const AActor *InBaseActor)
 
static FORCEINLINE FRotator GetRelativeRotFrom (const AActor *InActor, const AActor *InBaseActor)
 
static FORCEINLINE void SetActorCollisionEnabled (AActor *InActor, bool bInCollisionOn)
 Enable/Disable actor collision. More...
 
static FORCEINLINE FVector GetDirectedExtent (const FVector &InNormal, const FVector &InExtent)
 
static void GetActorCenterAndBoundingBoxVertices (const AActor *InActor, const AActor *InBaseActor, TArray< FVector > *OutCenterAndVertices3D, bool bInIncludeNonColliding=true)
 
template<typename TActor >
static void GetHomoActorGroupCenterAndBoundingBoxVertices (const TArray< TActor * > &InActors, const AActor *InBaseActor, TArray< FVector > *OutCenterAndVertices3D, bool bInIncludeNonColliding=true)
 
static FVector GetActorExtent (AActor *InActor, bool bOnlyCollidingComponents=true, bool bIncludeFromChildActors=false)
 
static FVector GetActorSize (AActor *InActor, bool bOnlyCollidingComponents=true, bool bIncludeFromChildActors=false)
 
static void DrawActorBoundingBox (AActor *InActor)
 
template<typename T >
static FTransform GetHomoActorGroupTransform (const TArray< T * > &InActors)
 
template<typename T >
static FVector GetActorGroupCenter (const TArray< T * > &InActors)
 
template<typename T >
static FVector GetActorGroupListCenter (const TArray< TArray< T * >> &InActorGroups)
 
static bool IsActorOverlapping (AActor *InActor)
 
static bool IsEnvStaticMeshActorsOverlapEventEnabled (UWorld *InWorld)
 
static void SetEnvStaticMeshActorsOverlapEventEnabled (UWorld *InWorld, bool bEnabled)
 
template<typename T >
static void HuddleActors (const TArray< T * > &InActors)
 
static FString GetSegMaskDepthStencilsAsText (AActor *InActor)
 
static bool GetPhysicsActorHandles (FBodyInstance *InBody1, FBodyInstance *InBody2, FPhysicsActorHandle &OutActorRef1, FPhysicsActorHandle &OutActorRef2)
 
static void SetHomoLinearConstraintMotion (FConstraintInstance *InCI, const ELinearConstraintMotion InLinearMotion)
 
static void SetHomoAngularConstraintMotion (FConstraintInstance *InCI, const EAngularConstraintMotion InAngularMotion)
 
static UMaterialInstanceDynamic * CreateMeshCompMaterialInstance (UMeshComponent *InMeshComp, int32 InMaterialIndex, const FString &InMaterialInterfaceName)
 
static int32 GetActorMaterialsNum (AActor *InActor)
 
static UMaterialInstanceDynamic * GetActorBaseMaterial (AActor *InActor, int32 InMaterialIndex=0)
 
static bool ApplyMeshActorMaterialProps (AActor *InActor, const FRRMaterialProperty &InMaterialInfo, bool bApplyManufacturingAlbedo=true)
 
static void ApplyMaterialProps (UMaterialInstanceDynamic *InMaterial, const FRRMaterialProperty &InMaterialInfo, bool bApplyManufacturingAlbedo=true)
 
static bool SetMeshActorColor (AActor *InMeshActor, const FLinearColor &InColor, bool InEmitColor=false)
 
static void RandomizeActorAppearance (AActor *InActor, const FRRTextureData &InTextureData)
 

Detailed Description

UObject general utils.

UCLASS()

Member Function Documentation

◆ ApplyMaterialProps()

static void URRUObjectUtils::ApplyMaterialProps ( UMaterialInstanceDynamic *  InMaterial,
const FRRMaterialProperty InMaterialInfo,
bool  bApplyManufacturingAlbedo = true 
)
static

◆ ApplyMeshActorMaterialProps()

static bool URRUObjectUtils::ApplyMeshActorMaterialProps ( AActor *  InActor,
const FRRMaterialProperty InMaterialInfo,
bool  bApplyManufacturingAlbedo = true 
)
static

◆ AttachComponentToComponent()

static void URRUObjectUtils::AttachComponentToComponent ( USceneComponent *  InChildComp,
USceneComponent *  InParentComp,
const FTransform &  InRelativeTransf = FTransform::Identity,
const FAttachmentTransformRules &  InAttachmentRules = FAttachmentTransformRules::KeepRelativeTransform,
const TCHAR *  InSocketName = nullptr 
)
static

Use SetupAttachment or AttachToComponent based on where this method is called.

Uses URRThreadUtils::IsInsideConstructor.

Parameters
InChildComp
InParentComp
InRelativeTransf
InAttachmentRules
InSocketName
See also
SetupAttachment
AttachToComponent

◆ ComposeDynamicResourceName()

static FORCEINLINE FString URRUObjectUtils::ComposeDynamicResourceName ( const FString &  InPrefix,
const FString &  InResourceUniqueName 
)
inlinestatic

◆ ConfigureComponentPhysics()

template<typename T , typename = TEnableIf<TIsDerivedFrom<T, UPrimitiveComponent>::Value>>
static void URRUObjectUtils::ConfigureComponentPhysics ( T *  InComponent,
bool  bIsPhysicsEnabled,
bool  bIsCollisionEnabled,
bool  bIsOverlapEventEnabled 
)
inlinestatic

◆ CreateAndAttachChildComponent()

template<typename T >
static T* URRUObjectUtils::CreateAndAttachChildComponent ( AActor *  InActor,
const FString &  InUniqueName,
const FTransform &  InRelativeTransf = FTransform::Identity,
USceneComponent *  InParentComp = nullptr,
const TCHAR *  InAttachSocketName = nullptr 
)
inlinestatic

◆ CreateChildComponent()

template<typename T >
static T* URRUObjectUtils::CreateChildComponent ( AActor *  InActor,
const FString &  InUniqueName,
bool  bIsPhysicsEnabled = false,
bool  bIsCollisionEnabled = false,
bool  bIsOverlapEventEnabled = false 
)
inlinestatic

Create a Child Component object and attach to InActor and calls ConfigureComponentPhysics.

Template Parameters
T
Parameters
InActor
InUniqueName
bIsPhysicsEnabled
bIsCollisionEnabled
bIsOverlapEventEnabled
Returns
T*

◆ CreateMeshCompMaterialInstance()

static UMaterialInstanceDynamic* URRUObjectUtils::CreateMeshCompMaterialInstance ( UMeshComponent *  InMeshComp,
int32  InMaterialIndex,
const FString &  InMaterialInterfaceName 
)
static

◆ CreateMeshComponent()

template<typename TMeshComponent >
static FORCEINLINE TMeshComponent* URRUObjectUtils::CreateMeshComponent ( AActor *  InActor,
const FString &  InObjMeshUniqueName,
const FString &  InMeshCompUniqueName,
const FTransform &  InRelativeTransf,
bool  bInIsOwningActorStationary,
bool  bInIsPhysicsEnabled,
bool  bInIsCollisionEnabled,
bool  bInIsOverlapEventEnabled = false,
USceneComponent *  InParentComp = nullptr 
)
inlinestatic

Create a Mesh Component, attach to InActor, set parameters.

Template Parameters
TMeshComponent
Parameters
InActor
InObjMeshUniqueName
InMeshCompUniqueName
InRelativeTransf
bInIsOwningActorStationary
bInIsPhysicsEnabled
bInIsCollisionEnabled
InParentComp
Returns
static TMeshComponent*

◆ CreateSelfSubobject() [1/2]

template<typename T >
static FORCEINLINE T* URRUObjectUtils::CreateSelfSubobject ( UObject *  InOuter,
const FString &  InObjectUniqueName 
)
inlinestatic

◆ CreateSelfSubobject() [2/2]

static FORCEINLINE UObject* URRUObjectUtils::CreateSelfSubobject ( UObject *  InOuter,
UClass *  InObjectClass,
const FString &  InObjectUniqueName 
)
inlinestatic

Use CreateDefaultSubobject or NewObject based on where this method is called.

Uses URRThreadUtils::IsInsideConstructor.

Parameters
InOutertest
InObjectClass
InObjectUniqueName
Returns
static UObject*
See also
CreateDefaultSubobject
NewObject

◆ DisableNavImpactAndPhysicsCollision()

static void URRUObjectUtils::DisableNavImpactAndPhysicsCollision ( UPrimitiveComponent *  InComponent)
inlinestatic

◆ DrawActorBoundingBox()

static void URRUObjectUtils::DrawActorBoundingBox ( AActor *  InActor)
inlinestatic

◆ FindActorListByType()

template<typename T >
static TArray<T*> URRUObjectUtils::FindActorListByType ( UWorld *  InWorld)
inlinestatic

◆ FindEnvironmentActor()

static AActor* URRUObjectUtils::FindEnvironmentActor ( UWorld *  InWorld)
inlinestatic

◆ FindFloorActor()

static AActor* URRUObjectUtils::FindFloorActor ( UWorld *  InWorld)
inlinestatic

◆ FindPostProcessVolume()

static APostProcessVolume* URRUObjectUtils::FindPostProcessVolume ( UWorld *  InWorld)
inlinestatic

◆ FindSkyActor()

static AActor* URRUObjectUtils::FindSkyActor ( UWorld *  InWorld)
inlinestatic

◆ FindSkyLight()

static ASkyLight* URRUObjectUtils::FindSkyLight ( UWorld *  InWorld)
inlinestatic

◆ FindStaticMeshActorListByMeshSubname()

static TArray<AStaticMeshActor*> URRUObjectUtils::FindStaticMeshActorListByMeshSubname ( UWorld *  InWorld,
const FString &  InMeshSubname,
bool  bCreateMaterialInstanceDynamic,
const ESearchCase::Type  InCaseType = ESearchCase::IgnoreCase 
)
inlinestatic

◆ FindWallActor()

static AActor* URRUObjectUtils::FindWallActor ( UWorld *  InWorld)
inlinestatic

◆ GetActorBaseMaterial()

static UMaterialInstanceDynamic* URRUObjectUtils::GetActorBaseMaterial ( AActor *  InActor,
int32  InMaterialIndex = 0 
)
static

◆ GetActorCenterAndBoundingBoxVertices()

static void URRUObjectUtils::GetActorCenterAndBoundingBoxVertices ( const AActor *  InActor,
const AActor *  InBaseActor,
TArray< FVector > *  OutCenterAndVertices3D,
bool  bInIncludeNonColliding = true 
)
static

◆ GetActorExtent()

static FVector URRUObjectUtils::GetActorExtent ( AActor *  InActor,
bool  bOnlyCollidingComponents = true,
bool  bIncludeFromChildActors = false 
)
inlinestatic

◆ GetActorGroupCenter()

template<typename T >
static FVector URRUObjectUtils::GetActorGroupCenter ( const TArray< T * > &  InActors)
inlinestatic

◆ GetActorGroupListCenter()

template<typename T >
static FVector URRUObjectUtils::GetActorGroupListCenter ( const TArray< TArray< T * >> &  InActorGroups)
inlinestatic

◆ GetActorMaterialsNum()

static int32 URRUObjectUtils::GetActorMaterialsNum ( AActor *  InActor)
static

◆ GetActorSize()

static FVector URRUObjectUtils::GetActorSize ( AActor *  InActor,
bool  bOnlyCollidingComponents = true,
bool  bIncludeFromChildActors = false 
)
inlinestatic

◆ GetDirectedExtent()

static FORCEINLINE FVector URRUObjectUtils::GetDirectedExtent ( const FVector &  InNormal,
const FVector &  InExtent 
)
inlinestatic

◆ GetHomoActorGroupCenterAndBoundingBoxVertices()

template<typename TActor >
static void URRUObjectUtils::GetHomoActorGroupCenterAndBoundingBoxVertices ( const TArray< TActor * > &  InActors,
const AActor *  InBaseActor,
TArray< FVector > *  OutCenterAndVertices3D,
bool  bInIncludeNonColliding = true 
)
inlinestatic

◆ GetHomoActorGroupTransform()

template<typename T >
static FTransform URRUObjectUtils::GetHomoActorGroupTransform ( const TArray< T * > &  InActors)
inlinestatic

◆ GetPhysicsActorHandles()

static bool URRUObjectUtils::GetPhysicsActorHandles ( FBodyInstance *  InBody1,
FBodyInstance *  InBody2,
FPhysicsActorHandle &  OutActorRef1,
FPhysicsActorHandle &  OutActorRef2 
)
static

◆ GetRelativeLocFrom()

static FORCEINLINE FVector URRUObjectUtils::GetRelativeLocFrom ( const AActor *  InActor,
const AActor *  InBaseActor 
)
inlinestatic

◆ GetRelativeQuatFrom() [1/2]

static FORCEINLINE FQuat URRUObjectUtils::GetRelativeQuatFrom ( const AActor *  InActor,
const AActor *  InBaseActor 
)
inlinestatic

◆ GetRelativeQuatFrom() [2/2]

static FORCEINLINE FQuat URRUObjectUtils::GetRelativeQuatFrom ( const FQuat &  InQuat,
const AActor *  InBaseActor 
)
inlinestatic

◆ GetRelativeRotFrom()

static FORCEINLINE FRotator URRUObjectUtils::GetRelativeRotFrom ( const AActor *  InActor,
const AActor *  InBaseActor 
)
inlinestatic

◆ GetSegMaskDepthStencilsAsText()

static FString URRUObjectUtils::GetSegMaskDepthStencilsAsText ( AActor *  InActor)
static

◆ HasSubobject()

template<typename T >
static FORCEINLINE bool URRUObjectUtils::HasSubobject ( UObject *  InParentObj,
const FString &  InChildName 
)
inlinestatic

Return true if InParentObj has subobjects with InChildName.

Template Parameters
T
Parameters
InParentObj
InChildName
Returns
static bool

◆ HuddleActors()

template<typename T >
static void URRUObjectUtils::HuddleActors ( const TArray< T * > &  InActors)
inlinestatic

◆ IsActorOverlapping()

static bool URRUObjectUtils::IsActorOverlapping ( AActor *  InActor)
inlinestatic

◆ IsEnvStaticMeshActorsOverlapEventEnabled()

static bool URRUObjectUtils::IsEnvStaticMeshActorsOverlapEventEnabled ( UWorld *  InWorld)
inlinestatic

◆ RandomizeActorAppearance()

static void URRUObjectUtils::RandomizeActorAppearance ( AActor *  InActor,
const FRRTextureData InTextureData 
)
static

◆ RegisterActorComponent()

static void URRUObjectUtils::RegisterActorComponent ( UActorComponent *  Comp)
static

Uses URRThreadUtils::IsInsideConstructor() to avoid crash by calling RegisterComponents() outside of constructor.

UFUNCTION()

◆ SetActorCollisionEnabled()

static FORCEINLINE void URRUObjectUtils::SetActorCollisionEnabled ( AActor *  InActor,
bool  bInCollisionOn 
)
inlinestatic

Enable/Disable actor collision.

Parameters
InActor
bInCollisionOn

◆ SetEnvStaticMeshActorsOverlapEventEnabled()

static void URRUObjectUtils::SetEnvStaticMeshActorsOverlapEventEnabled ( UWorld *  InWorld,
bool  bEnabled 
)
inlinestatic

◆ SetHomoAngularConstraintMotion()

static void URRUObjectUtils::SetHomoAngularConstraintMotion ( FConstraintInstance *  InCI,
const EAngularConstraintMotion  InAngularMotion 
)
static

◆ SetHomoLinearConstraintMotion()

static void URRUObjectUtils::SetHomoLinearConstraintMotion ( FConstraintInstance *  InCI,
const ELinearConstraintMotion  InLinearMotion 
)
static

◆ SetMeshActorColor()

static bool URRUObjectUtils::SetMeshActorColor ( AActor *  InMeshActor,
const FLinearColor &  InColor,
bool  InEmitColor = false 
)
static

◆ SetupActorTick()

static void URRUObjectUtils::SetupActorTick ( AActor *  InActor,
bool  bIsTickEnabled,
float  InTickInterval = 0.f 
)
static

◆ SetupComponentTick()

static void URRUObjectUtils::SetupComponentTick ( UActorComponent *  InComponent,
bool  bIsTickEnabled 
)
static

◆ SetupDefaultRootComponent()

static USceneComponent* URRUObjectUtils::SetupDefaultRootComponent ( AActor *  InActor)
static

◆ SpawnSimActor() [1/2]

template<typename T , typename TActorSpawnInfo >
static T* URRUObjectUtils::SpawnSimActor ( UWorld *  InWorld,
int8  InSceneInstanceId,
const TActorSpawnInfo &  InActorSpawnInfo,
const ESpawnActorCollisionHandlingMethod  CollisionHandlingType = ESpawnActorCollisionHandlingMethod::AlwaysSpawn 
)
inlinestatic

Spawn a generic actor that is either mesh-based or mesh-free & initialize it with actor spawn info.

Template Parameters
T
TActorSpawnInfo
Parameters
InWorld
InSceneInstanceId
InActorSpawnInfo
CollisionHandlingType
Returns
T*

◆ SpawnSimActor() [2/2]

static ARRBaseActor* URRUObjectUtils::SpawnSimActor ( UWorld *  InWorld,
int8  InSceneInstanceId,
UClass *  InActorClass,
const FString &  InEntityModelName,
const FString &  InActorName = EMPTY_STR,
const FTransform &  InActorTransform = FTransform::Identity,
const ESpawnActorCollisionHandlingMethod  InCollisionHandlingType = ESpawnActorCollisionHandlingMethod::AlwaysSpawn,
const FRRActorSpawnInfo InActorSpawnInfo = FRRActorSpawnInfo() 
)
static

Spawn a generic actor that is either mesh-based or mesh-free.

Parameters
InWorld
InSceneInstanceId
InActorClass
InActorName
InActorTransform
InCollisionHandlingType
Returns
ARRBaseActor*

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