Skip to content

UMjCapsule

Capsule primitive geometry.

Unreal doesn't ship /Engine/BasicShapes/Capsule, so the visual is assembled from three engine basic shapes: a shaft cylinder and two sphere end caps. Sub-mesh transforms are kept in sync with the component's own relative scale so the gizmo still drives radius (X/Y) and half-length (Z) coherently. Caps use a Z-counter-scale so they stay spherical when the half-length differs from the radius.

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

Properties

Public Properties

Property Type Description
Radius float Capsule radius in MJ metres. Authored via the UE Transform's
HalfLength float Capsule half-length along the component's local Z axis.
VisualizerShaft class UStaticMeshComponent* Internal shaft cylinder.
VisualizerCapTop class UStaticMeshComponent* Internal top cap (positive Z).
VisualizerCapBottom class UStaticMeshComponent* Internal bottom cap (negative Z).
Pos FVector
Quat FQuat
contype int32
conaffinity int32
condim int32
group int32
priority int32
material FString
mass float
density float
solmix float
margin float
gap float
hfield FString
mesh FString
fitscale double
rgba FLinearColor
verride o
m_GeomView GeomView The runtime view of the MuJoCo geom. Valid only after Bind() is called.
Type EMjGeomType
ShellInertia EMjGeomInertia
FluidShape EMjFluidShape
bWasImported bool True when this component was created via ImportFromXml. Lets export
MeshName FString Name of the mesh asset if Type is mesh.
bComplexMeshRequired bool Legacy: use complex collision mesh. Hidden — use "Decompose mesh" button instead.
CoACDThreshold float CoACD decomposition threshold. Lower = more accurate but more hulls. Range [0.01, 1.0].
bIsDecomposedHull bool True if this geom was created by CoACD decomposition of another geom.
bDisabledByDecomposition bool True if this geom's mesh was decomposed into hull sub-geoms.
MjClassName FString Optional MuJoCo class name to inherit defaults from (string fallback).
OverrideMaterial TObjectPtr<UMaterialInterface> Optional Unreal material override for primitive visualizer meshes (Box/Sphere/Cylinder).
DefaultClass UMjDefault* Reference to a UMjDefault component for default class inheritance. Hidden from the

Radius

Capsule radius in MJ metres. Authored via the UE Transform's

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Primitive
  • Notes: Override-enabled (false)

HalfLength

Capsule half-length along the component's local Z axis.

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Primitive
  • Notes: Override-enabled (false)

VisualizerShaft

Internal shaft cylinder.

  • Type: class UStaticMeshComponent*

VisualizerCapTop

Internal top cap (positive Z).

  • Type: class UStaticMeshComponent*

VisualizerCapBottom

Internal bottom cap (negative Z).

  • Type: class UStaticMeshComponent*

Pos

Override-enabled (false)

  • Type: FVector
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom|Spatial Pose

Quat

Override-enabled (false)

  • Type: FQuat
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom|Orientation

contype

Override-enabled (bOverride_contype)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

conaffinity

Override-enabled (bOverride_conaffinity)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

condim

Override-enabled (bOverride_condim)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

group

Override-enabled (bOverride_group)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

priority

Override-enabled (bOverride_priority)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

material

Override-enabled (bOverride_material)

  • Type: FString
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

mass

Override-enabled (bOverride_mass)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

density

Override-enabled (bOverride_density)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

solmix

Override-enabled (bOverride_solmix)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

margin

Override-enabled (bOverride_margin)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

gap

Override-enabled (bOverride_gap)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

hfield

Override-enabled (bOverride_hfield)

  • Type: FString
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

mesh

Override-enabled (bOverride_mesh)

  • Type: FString
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

fitscale

Override-enabled (bOverride_fitscale)

  • Type: double
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

rgba

Override-enabled (bOverride_rgba)

  • Type: FLinearColor
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

verride

Override-enabled (bOverride_fluidcoef)

  • Type: o
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

m_GeomView

The runtime view of the MuJoCo geom. Valid only after Bind() is called.

Type

Override-enabled (bOverride_Type)

  • Type: EMjGeomType
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

ShellInertia

Override-enabled (bOverride_ShellInertia)

  • Type: EMjGeomInertia
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

FluidShape

Override-enabled (bOverride_FluidShape)

  • Type: EMjFluidShape
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

bWasImported

True when this component was created via ImportFromXml. Lets export

  • Type: bool

MeshName

Name of the mesh asset if Type is mesh.

  • Type: FString
  • Editor: 👁 VisibleAnywhere
  • Blueprint: 🟢 ReadOnly
  • Category: MuJoCo|Geom

bComplexMeshRequired

Legacy: use complex collision mesh. Hidden — use "Decompose mesh" button instead.

  • Type: bool
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

CoACDThreshold

CoACD decomposition threshold. Lower = more accurate but more hulls. Range [0.01, 1.0].

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom
  • Notes: Override-enabled (Type)

bIsDecomposedHull

True if this geom was created by CoACD decomposition of another geom.

  • Type: bool

bDisabledByDecomposition

True if this geom's mesh was decomposed into hull sub-geoms.

  • Type: bool
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

MjClassName

Optional MuJoCo class name to inherit defaults from (string fallback).

  • Type: FString
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom

OverrideMaterial

Optional Unreal material override for primitive visualizer meshes (Box/Sphere/Cylinder).

  • Type: TObjectPtr
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom|Visual
  • Notes: Override-enabled (Type)

DefaultClass

Reference to a UMjDefault component for default class inheritance. Hidden from the

  • Type: UMjDefault*
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Geom
  • Notes: Override-enabled (false)

Functions

Public Functions

General

Function Returns Description
GetVisualizerMesh() class UStaticMeshComponent* Returns the shaft cylinder so the overlay/debug-viz paths that grep
SyncUnrealTransformFromMj() void Synchronizes the Unreal Component transform (Scale/Location/Rotation)
SetGeomVisibility() void Sets visibility for this geom and its child visual components.
ApplyOverrideMaterial() void Apply a material to the visual mesh. Override in subclasses with direct member access.
GetMj() GeomView& Semantic accessor for raw MuJoCo data and helper methods.
GetResolvedMaterialName() FString Resolves the codegen-owned material FString through the default class chain. Returns empty if none found.
SizeParamsCount() int32 Number of size parameters explicitly provided in XML.
RegisterToSpec() void Registers this geom to the MuJoCo spec.
GetVisualizerMesh

Returns the shaft cylinder so the overlay/debug-viz paths that grep

  • Signature: GetVisualizerMesh()
  • Returns: class UStaticMeshComponent*
SyncUnrealTransformFromMj

Synchronizes the Unreal Component transform (Scale/Location/Rotation)

  • Signature: SyncUnrealTransformFromMj()
SetGeomVisibility

Sets visibility for this geom and its child visual components.

  • Signature: SetGeomVisibility(bool bNewVisibility)
ApplyOverrideMaterial

Apply a material to the visual mesh. Override in subclasses with direct member access.

  • Signature: ApplyOverrideMaterial(class UMaterialInterface* Material)
GetMj

Semantic accessor for raw MuJoCo data and helper methods.

GetResolvedMaterialName

Resolves the codegen-owned material FString through the default class chain. Returns empty if none found.

  • Signature: GetResolvedMaterialName()
  • Returns: FString
SizeParamsCount

Number of size parameters explicitly provided in XML.

  • Signature: SizeParamsCount()
  • Returns: int32
RegisterToSpec

Registers this geom to the MuJoCo spec.

MuJoCo|Geom

Function Returns Description
DecomposeMesh() void Runs CoACD decomposition on this geom's mesh and creates persistent hull sub-geom components.
RemoveDecomposition() void Removes all hull sub-geoms created by decomposition and re-enables this geom.
DecomposeMesh

Runs CoACD decomposition on this geom's mesh and creates persistent hull sub-geom components.

  • Signature: DecomposeMesh()
  • Blueprint: 🔵 Callable
RemoveDecomposition

Removes all hull sub-geoms created by decomposition and re-enables this geom.

  • Signature: RemoveDecomposition()
  • Blueprint: 🔵 Callable

MuJoCo|Runtime

Function Returns Description
UpdateGlobalTransform() void Updates the Unreal SceneComponent transform to match the MuJoCo simulation state.
GetWorldLocation() FVector Gets the current world location from MuJoCo.
SetFriction() void Sets the sliding friction at runtime.
UpdateGlobalTransform

Updates the Unreal SceneComponent transform to match the MuJoCo simulation state.

  • Signature: UpdateGlobalTransform()
  • Blueprint: 🔵 Callable
GetWorldLocation

Gets the current world location from MuJoCo.

  • Signature: GetWorldLocation()
  • Blueprint: 🔵 Callable
  • Returns: FVector
SetFriction

Sets the sliding friction at runtime.

  • Signature: SetFriction(float NewFriction)
  • Blueprint: 🔵 Callable

Private Functions

General

Function Returns Description
UpdateCapTransforms() void Position + counter-scale the caps so they sit at the shaft endpoints
UpdateCapTransforms

Position + counter-scale the caps so they sit at the shaft endpoints

  • Signature: UpdateCapTransforms()