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
| Type | Name | Description |
|---|---|---|
bool | enabled | Default true. |
int32_t | segmentsX | Default 16. |
int32_t | segmentsY | Default 16. |
float | width | Default 2.0f. |
float | length | Default 2.0f. |
float | mass | Default 1.0f. |
float | stretchCompliance | XPBD compliance: 0 = rigid distance constraints; larger = stretchier. Default 0.0f. |
float | bendCompliance | Default 0.005f. |
int32_t | iterations | Default 5. |
float | linearDamping | Default 0.1f. |
float | gravityFactor | Default 1.0f. |
bool | pinFirstEdge | Default true. |
EClothSource | source | Skinned 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_t | submeshIndex | Default 0. |
float | maxDistance | Default 0.3f. |
bool | maskFromVertexColor | Default false. |
float | pressure | Soft 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_t | vertexCount | Default 0. |
float | simMinY | Default 0.0f. |
float | simMaxY | Default 0.0f. |
float | simAvgY | Default 0.0f. |
Constructors
| Signature | Name | Description |
|---|---|---|
ClothComponent() = default | ClothComponent |
Function details
ClothComponent
C++
ClothComponent() = defaultGenerated from Physics/Components/ClothComponent.h via physics.json · Nov 4, 2026Version 1.0.0