Skip to content

UMjQuickConvertComponent

Component that enables physically simulated MuJoCo behavior for an Actor.

This component automatically parses the StaticMesh of the owning Actor and creates a corresponding body and collision geoms in the MuJoCo mjSpec. It also synchronizes the Actor's transform with the MuJoCo simulation at runtime.

Attribute Value
Kind Class
UE Macro UCLASS
Inherits UActorComponent
Blueprint Spawnable ✅ Yes

Properties

Public Properties

Property Type Description
ComplexMeshRequired bool Forces complex mesh (convex decomposition) generation for collision.
CoACDThreshold float CoACD decomposition threshold. Lower = more accurate but more convex hulls.
m_debug_meshes bool Draws debug lines for collision geoms in the viewport.
Static bool If true, the body is static (no free joint added).
bDrivenByUnreal bool If true, this body's transform is driven by the Unreal Actor/Component, enabling one-way coupling (Unreal → MuJoCo).
m_geomName2ID TMap<FString, int> Friction parameters (sliding, torsional, rolling). Applied to all geoms created by this component.

ComplexMeshRequired

Forces complex mesh (convex decomposition) generation for collision.

  • Type: bool
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🟢 ReadOnly
  • Category: MuJoCo|Mesh

CoACDThreshold

CoACD decomposition threshold. Lower = more accurate but more convex hulls.

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🟢 ReadOnly
  • Category: MuJoCo|Mesh
  • Notes: Override-enabled (ComplexMeshRequired)

m_debug_meshes

Draws debug lines for collision geoms in the viewport.

  • Type: bool
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🟢 ReadOnly
  • Category: MuJoCo|Debug

Static

If true, the body is static (no free joint added).

  • Type: bool
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🟢 ReadOnly
  • Category: MuJoCo|Physics

bDrivenByUnreal

If true, this body's transform is driven by the Unreal Actor/Component, enabling one-way coupling (Unreal → MuJoCo).

  • Type: bool
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🟢 ReadOnly
  • Category: MuJoCo|Physics

m_geomName2ID

Friction parameters (sliding, torsional, rolling). Applied to all geoms created by this component.

  • Type: TMap
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🟢 ReadOnly
  • Category: MuJoCo|Debug

Functions

Public Functions

General

Function Returns Description
UMjQuickConvertComponent() Sets default values for this component's properties.
GetBodyName() FString Returns proper body name.
Setup() void Initializes the component, parsing meshes and adding to spec.
PostSetup() void Finalizes setup after compilation.
TickComponent() void Called every frame.
UMjQuickConvertComponent

Sets default values for this component's properties.

  • Signature: UMjQuickConvertComponent()
GetBodyName

Returns proper body name.

  • Signature: GetBodyName()
  • Returns: FString
Setup

Initializes the component, parsing meshes and adding to spec.

  • Signature: Setup(mjSpec* spec, mjVFS* vfs)
PostSetup

Finalizes setup after compilation.

  • Signature: PostSetup(mjModel* model, mjData* data)
TickComponent

Called every frame.

  • Signature: TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)

Protected Functions

General

Function Returns Description
BeginPlay() void Called when the game starts.
EndPlay() void Called when the game ends.
BeginPlay

Called when the game starts.

  • Signature: BeginPlay()
EndPlay

Called when the game ends.

  • Signature: EndPlay(const EEndPlayReason::Type EndPlayReason)