RapyutaSimulationPlugins
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
URRProceduralMeshComponent Class Reference

Procedural mesh components. this class is used to spawn robot and object from ROS 2 service. More...

#include <RRProceduralMeshComponent.h>

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

Public Member Functions

 URRProceduralMeshComponent (const FObjectInitializer &ObjectInitializer)
 Construct a new URRProceduralMeshComponent object. More...
 
FString GetBodySetupModelName () const
 
void Initialize (bool bIsStaticBody, bool bInIsPhysicsEnabled)
 CustomDepthStencil will be actively set by stakeholders or ARRMeshActor if needs be. More...
 
bool InitializeMesh (const FString &InMeshFileName)
 Initialize mesh. initialization is different based on mesh type, ERRShapeType, which can be get from URRGameSingleton::GetShapeTypeFromMeshName. More...
 
void SetMeshSize (const FVector &InSize)
 Create primitive-shape mesh based on ShapeType. More...
 
FVector GetSize () const
 
FVector GetExtent () const
 
void LockSelf ()
 
void HideSelf (bool IsHidden)
 
void SetCollisionModeAvailable (bool bIsOn, bool bIsHitEventEnabled=false)
 
void EnableOverlapping (bool bOverlapEventEnabled)
 
bool IsMeshDataValid () const
 
bool GetMeshData (FRRMeshData &OutMeshData, bool bFromBuffer)
 
void GetLocalBounds (FVector &OutMinBounds, FVector &OutMaxBounds)
 

Public Attributes

FString MeshUniqueName
 
ERRShapeType ShapeType = ERRShapeType::NONE
 
FOnMeshCreationDone OnMeshCreationDone
 
FTransform OriginRelativeTransform = FTransform::Identity
 
bool bIsStationary = false
 

Protected Member Functions

virtual bool ShouldCreatePhysicsState () const override
 

Private Member Functions

bool CreateMeshBody (const FRRMeshData &InMeshData)
 Create Mesh Body Setup from FRRMeshData. More...
 
void CreateMeshSection (const TArray< FRRMeshNodeData > &InMeshSectionData)
 
void FinalizeMeshBodyCreation (UBodySetup *InBodySetup, const FString &InBodySetupModelName)
 

Private Attributes

FTimerHandle CollisionCookingTimerHandle
 
FTimerHandle BodySetupTimerHandle
 

Detailed Description

Procedural mesh components. this class is used to spawn robot and object from ROS 2 service.

See also
UProceduralMeshComponent

UCLASS()

Constructor & Destructor Documentation

◆ URRProceduralMeshComponent()

URRProceduralMeshComponent::URRProceduralMeshComponent ( const FObjectInitializer &  ObjectInitializer)

Construct a new URRProceduralMeshComponent object.

This Initializer-based ctor is used due to [UProceduralMeshComponent] still having it.

The collision cooking is critical for sweeping movement to work after spawning Proc mesh actor.

Due to [FinishPhysicsAsyncCook] being not virtual and private, it is unable to catch [FOnAsyncPhysicsCookFinished] event

Thus we could only rely on [UBodySetup::bCreatedPhysicsMeshes]

Parameters
ObjectInitializer

Member Function Documentation

◆ CreateMeshBody()

bool URRProceduralMeshComponent::CreateMeshBody ( const FRRMeshData InMeshData)
private

Create Mesh Body Setup from FRRMeshData.

This function is hooked up from an async task running in GameThread

Parameters
InMeshData
Returns
true
false

◆ CreateMeshSection()

void URRProceduralMeshComponent::CreateMeshSection ( const TArray< FRRMeshNodeData > &  InMeshSectionData)
private

◆ EnableOverlapping()

void URRProceduralMeshComponent::EnableOverlapping ( bool  bOverlapEventEnabled)

◆ FinalizeMeshBodyCreation()

void URRProceduralMeshComponent::FinalizeMeshBodyCreation ( UBodySetup *  InBodySetup,
const FString &  InBodySetupModelName 
)
private

◆ GetBodySetupModelName()

FString URRProceduralMeshComponent::GetBodySetupModelName ( ) const
inline

◆ GetExtent()

FVector URRProceduralMeshComponent::GetExtent ( ) const
inline

◆ GetLocalBounds()

void URRProceduralMeshComponent::GetLocalBounds ( FVector &  OutMinBounds,
FVector &  OutMaxBounds 
)
inline

◆ GetMeshData()

bool URRProceduralMeshComponent::GetMeshData ( FRRMeshData OutMeshData,
bool  bFromBuffer 
)

◆ GetSize()

FVector URRProceduralMeshComponent::GetSize ( ) const
inline

◆ HideSelf()

void URRProceduralMeshComponent::HideSelf ( bool  IsHidden)
inline

◆ Initialize()

void URRProceduralMeshComponent::Initialize ( bool  bIsStaticBody,
bool  bInIsPhysicsEnabled 
)

CustomDepthStencil will be actively set by stakeholders or ARRMeshActor if needs be.

Parameters
bIsStaticBody
bInIsPhysicsEnabled

◆ InitializeMesh()

bool URRProceduralMeshComponent::InitializeMesh ( const FString &  InMeshFileName)

Initialize mesh. initialization is different based on mesh type, ERRShapeType, which can be get from URRGameSingleton::GetShapeTypeFromMeshName.

Uses URRThreadUtils::DoAsyncTaskInThread and URRThreadUtils::DoTaskInGameThread to load Mesh

If ShapeType is not ERRShapeType::MESH i.e. primitive-shape, initialization is done by SetMeshSize

Parameters
InMeshFileName
Returns
true
false

◆ IsMeshDataValid()

bool URRProceduralMeshComponent::IsMeshDataValid ( ) const

◆ LockSelf()

void URRProceduralMeshComponent::LockSelf ( )
inline

◆ SetCollisionModeAvailable()

void URRProceduralMeshComponent::SetCollisionModeAvailable ( bool  bIsOn,
bool  bIsHitEventEnabled = false 
)

◆ SetMeshSize()

void URRProceduralMeshComponent::SetMeshSize ( const FVector &  InSize)

Create primitive-shape mesh based on ShapeType.

Parameters
InSize

◆ ShouldCreatePhysicsState()

virtual bool URRProceduralMeshComponent::ShouldCreatePhysicsState ( ) const
inlineoverrideprotectedvirtual

Member Data Documentation

◆ bIsStationary

bool URRProceduralMeshComponent::bIsStationary = false

◆ BodySetupTimerHandle

FTimerHandle URRProceduralMeshComponent::BodySetupTimerHandle
private

◆ CollisionCookingTimerHandle

FTimerHandle URRProceduralMeshComponent::CollisionCookingTimerHandle
private

◆ MeshUniqueName

FString URRProceduralMeshComponent::MeshUniqueName

◆ OnMeshCreationDone

FOnMeshCreationDone URRProceduralMeshComponent::OnMeshCreationDone

◆ OriginRelativeTransform

FTransform URRProceduralMeshComponent::OriginRelativeTransform = FTransform::Identity

◆ ShapeType

ERRShapeType URRProceduralMeshComponent::ShapeType = ERRShapeType::NONE

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