struct

ClothComponent

Cloth simulation on Jolt's XPBD soft body. The system builds a horizontal segmentsX × segmentsY vertex grid at the entity's world transform (local XZ plane), optionally pins the first row (the local -Z edge), and lets Jolt's solver drape it against the world. Runtime telemetry mirrors the world-space vertex bounds each frame; full positions come from ClothSystem::GetVertexPositions (the future render-mesh slice reads the same API).

Module
Physics
Header
#include "Physics/Components/ClothComponent.h"
Namespace
Mowo
Reflection
Reflected by MowoHeaderTool

Properties

TypeNameDescription
boolenabledDefault true.
int32_tsegmentsXDefault 16.
int32_tsegmentsYDefault 16.
floatwidthDefault 2.0f.
floatlengthDefault 2.0f.
floatmassDefault 1.0f.
floatstretchComplianceXPBD compliance: 0 = rigid distance constraints; larger = stretchier. Default 0.0f.
floatbendComplianceDefault 0.005f.
int32_titerationsDefault 5.
floatlinearDampingDefault 0.1f.
floatgravityFactorDefault 1.0f.
boolpinFirstEdgeDefault true.
EClothSourcesourceSkinned Mesh source: the submesh (0 = the primary) of this entity's mesh renderer becomes the cloth. Every vertex of it is skinned by the animator's pose each frame and may drift up to Max Distance from that skinned position; 0 hard-skins it. With Mask From Vertex Color the red channel scales the distance per vertex, so a painted collar stays put while the hem swings. Grid fields (segments, width, length, pin) are ignored for this source; mass, compliance, iterations and damping apply to both. Default EClothSource::Grid.
int32_tsubmeshIndexDefault 0.
floatmaxDistanceDefault 0.3f.
boolmaskFromVertexColorDefault false.
floatpressureSoft Body source: the submesh (a static mesh) becomes a free soft body — a jelly, a cushion, a ball. Pressure inflates a closed mesh against its own volume (0 = it slumps like cloth); edge stiffness comes from the compliance fields above. Default 1000.0f.
int32_tvertexCountDefault 0.
floatsimMinYDefault 0.0f.
floatsimMaxYDefault 0.0f.
floatsimAvgYDefault 0.0f.

Constructors

SignatureNameDescription
ClothComponent() = defaultClothComponent

Function details

ClothComponent

C++
ClothComponent() = default
Generated from Physics/Components/ClothComponent.h via physics.json · Nov 4, 2026Version 1.0.0