Skip to main content

Physics in Unreal

The SuperDexPhysics plugin runs one SuperDex Physics scene per game instance and lets you author it with ordinary Unreal actors and components. Its editor module, SuperDexPhysicsEditor, imports the models and prefabs you build in SuperDex Studio, and the SuperDexRoboticsEditor module of the SuperDexRobotics plugin imports bots, scenes, and IK configurations.

This page covers what gets imported, which settings control the simulation, and which components make up a scene. For loading a whole scene file at runtime instead, see Runtime Scene Loading.

Importers​

Drag a file into the Content Browser, or use Import. Each file type becomes an Unreal asset that keeps its source path, so Reimport picks up changes made in Studio. Reimporting a prefab regenerates its components under the same names, so its constraints, which find components by name, still connect. A prefab may contain only rigid bodies, or combine rigid and soft bodies, articulations, and nested prefabs. A rigid-body prefab does not require a bot, IK configuration, or teleoperation setup; import it and place the resulting Blueprint or use the generated Map.

Source fileImported asNotes
.mochi.h5 (.h5, .hdf5)Mochi Model (MM_<name>)Volumetric or surface model with its baked SDF. Reimport keeps the asset, so references to it stay intact.
.superdex_prefab, .mochi_prefab, .mochi_sceneSuperDex Prefab plus a generated Blueprint or MapYou pick Blueprint or Map when you import. Render meshes (.glb), Mochi models, contact and material params, and articulations are generated next to the prefab. Nested prefabs are imported as their own Blueprints.
.superdex_bot, .superdex_bot_archiveSuperDex Bot (SDB_<name>)Render meshes, collision models, and, for skinned bots, a skeleton and skeletal mesh. Drag the bot into a level to place a SuperDexBotActor.
.superdex_scene, .superdex_scene_archiveSuperDex Scene (SDS_<name>) plus a generated Blueprint or MapThe base scene is imported as a prefab Blueprint and each bot as a SuperDex Bot placed with a SuperDexBotComponent. Spawnable prefabs and bots are imported but not placed.
.superdex_ikSuperDex Bot IK ConfigSee Tutorial: Roboperator from a Studio IK Config.

Blueprint or Map? A Blueprint import gives you one actor with a component per simulated actor, which you can place several times or spawn at runtime. A Map import gives you a level with one actor per simulated actor, plus a MochiSceneSettingsActor that carries the prefab's gravity, solver params, and layer contact filters. Blueprints cannot hold that settings actor, so a Blueprint import drops scene settings (the importer warns about it).

What the importers do not bring over

The importers log a warning and skip what Unreal cannot represent yet:

  • Prefabs: soft skinned actors, rod constraints, the render models and initial poses of rod actors, pose controllers, contact pair params overrides, initial velocities, flow on soft actors, soft actors with inertia or stress disabled, and actor contact filters other than symmetric filters between two links of one articulation.
  • Scenes: bot controllers and scene-level sensors. Add controllers to the placed bots in Unreal instead.

Rod actors import as MochiRodMeshComponents. Shell components exist in Unreal (see Components), but no importer creates them; you add them by hand.

Where imported assets go​

By default an import lands in the folder you dropped it into. Under Project Settings > Plugins > SuperDex Physics > Editor, turn on Organize Prefabs In Root Folder to mirror the source directory layout relative to the nearest .superdex_root marker file under Prefab Root Folder (default /Game/Prefabs). Prefab Map Template sets the level that new Map imports start from (by default the engine's Basic level template).

Settings​

Project settings​

Project Settings > Plugins > SuperDex Physics (UMochiPhysicsSettings, saved to DefaultGame.ini) holds the project-wide defaults:

SettingPurpose
SimulationSpaceThe axes and scale the simulation, the debugger, and exported scenes use. Defaults to SuperDex space (+X forward, +Y left, +Z up, meters). Unreal authoring is unaffected.
NumWorkerThreadsWorker threads for the simulation; <= 0 lets SuperDex Physics choose.
bForceSingleIslandSimulate everything in one island. For debugging; slower.
bEnablePhysicsDebuggerConnectionStart the SuperDex Physics debugger server when the plugin starts (ignored in Shipping builds).
DefaultSceneSettingsThe scene settings used by any level without a MochiSceneSettingsActor (fields below).

Per-level scene settings​

Place a Mochi Scene Settings Actor (AMochiSceneSettingsActor) in a level to override the defaults for that level. It starts out with the project's values. Its SceneSettings are:

The MochiSceneSettingsActor Details panel with gravity, step parameters, solver and contact-matrix assets, pause, and debug-draw settings.
One actor supplies the level's simulation settings and references reusable parameter assets.
FieldPurpose
GravityVectorGravity in m/s², in Unreal axes.
StepParamsHow the scene steps on the simulation thread, e.g. bUseFixedTimeStep and FixedTimeStepSeconds.
SolverParamsA Mochi Solver Params asset.
ContactMatrixA Mochi Contact Matrix asset: which contact layers collide.
bStartPausedStart the simulation paused.
bOverrideSimulationSpace, SimulationSpaceUse a different simulation space for this level only.
bEnableDebugDraw, DebugDrawFlags, DebugDraw_Line_Length_MultiplierDraw contacts, forces, and other debug geometry in the viewport.

The Blueprint function library MochiPhysicsFunctionLibrary changes some of these while the game runs: SetMochiGravity, SetMochiContactMatrixEntry, SetPaused, and ToggleMochiDebugDraw, among others.

Settings assets​

Solver, contact, and material parameters are assets, so many components can share one. Create them from the Content Browser's Add menu; the importers also generate them from Studio prefabs. The plugin ships defaults in /SuperDexPhysics/Params/: MSP_Default, MCP_Default, MMP_Default, and MCM_Default.

AssetUsed byMain fields
Mochi Solver ParamsScene settingsNonLinearSolverParams, LinearSolverParams, IntegrationMethod, ExperimentalEvalParams
Mochi Contact MatrixScene settingsMatrix: entries of LayerA, LayerB, bEnabled, bSymmetric
Mochi Contact ParamsEvery simulated componentPenalty contact (PenaltyCoefficient, PenaltyThresholdDist, PenaltyExtraPadding, PenaltySmoothingHalfDistance) and friction (CoulombFrictionCoefficient, ViscousFrictionCoefficient, FrictionFalloffVel, NormalViscousDampingCoefficient)
Mochi Material ParamsRigid and soft componentsMaterialType, YoungsModulus, PoissonRatio, Density, damping coefficients
Mochi Shell Material ParamsShell componentsMembrane and bending stiffness, area density. Apply Estimate to Shell Material derives them from 3D material values and a thickness.
Mochi Rod Material ParamsRod componentsLinear density, axial, torsional, and flexural stiffness
Mochi Model Material ModifierSoft componentsPer-element material overrides

Contact layers are plain names. Components default to GenericObject; LeftHand and RightHand are the other predefined layers.

Articulated joint friction is separate from contact friction. The joint's dry-friction model uses Presliding Displacement (meters or radians), the displacement at which it reaches its static peak, rather than the old joint Falloff Vel field. Revisit older joint-friction tuning instead of reusing a velocity value as a displacement. See Joint Friction for the model and parameter meanings. This does not rename the contact-parameter asset's FrictionFalloffVel field.

Components​

Every simulated object is a component. A component creates its SuperDex Physics actor at Begin Play, and the Unreal component follows the simulated result each frame. Its properties are in the SuperDex Physics Details category and its subcategories, such as Constraint. Each one takes a ContactParams asset and a Layer, and with bEnableContacts set it raises OnMochiComponentBeginContact, OnMochiComponentContact, and OnMochiComponentEndContact.

ComponentSimulatesKey properties
MochiRigidMeshComponentA rigid body (a Static Mesh Component)Model (Mochi Model), or bUseStaticMeshAsMochiModel to collide the static mesh itself; bIsStatic, ColliderType, MaterialParams, bOverrideMass/Mass, FreezeConstraints
MochiImplicitShapeComponentA static plane or sphereShape (Plane or Sphere), SphereRadius in centimeters
MochiSoftMeshComponentA volumetric soft bodyModel, MaterialParams, ColliderType, bUseContactSkin, MaterialModifiers
MochiShellMeshComponentA thin shell (cloth-like surface)Model, ShellMaterialParams, ColliderType
MochiRodMeshComponentA rod (cable-like curve)Model, RodMaterialParams, ColliderType, PointCloudRadius
MochiArticulationComponentAn articulated mechanismArticulation (a Mochi Articulation asset, generated from prefab articulations), ArticulationController
MochiRigidJointConstraintComponent, MochiRigidPivotConstraintComponent, MochiArticulationJointConstraintComponent, MochiSoftNodeConstraintComponent, MochiRodConstraintComponent, MochiNodeBoundaryConditionComponentJoints, pivots, and node attachments between componentsImported from prefab constraints where supported
MochiForceVisualizerComponentNothing: draws contact forces
SuperDexBotComponent (SuperDexRobotics)A SuperDex botBot, InitialPose, BotControllerClass, bAutoSpawn, LayerOverride
The selected ceramic plate in the BP_plate Blueprint viewport, outlined in orange with its transform gizmo.
The plate Blueprint's rigid mesh component.
The plate component's Details panel, showing MM_plate, GenericObject contact layer, material and contact parameter assets, and static, gravity, contact, and freeze settings.
The Mochi model and physics parameters are configured independently of the visible static mesh and render material.

See Also​