class
ClothSystem
Creates one Jolt soft body per Cloth entity (grid + XPBD edge/ shear/bend constraints from SoftBodySharedSettings::CreateConstraints), mirrors world-space vertex bounds into the component every frame, and removes the body when the component or entity goes away. Raw JPH types stay inside Physics.dll (same rule as VehicleSystem).
- Module
- Physics
- Header
#include "Physics/ClothSystem.h"- Namespace
Mowo
Type aliases
| Alias | Description |
|---|---|
using FSkinnedSourceProvider = std::function<bool(EntityID entity, int32_t submesh, FClothSkinnedSource& outSource)> | Skinned-mesh cloth. The providers are installed by the scene: the source one answers once per cloth with the submesh's vertices, the palette one every frame with the animator's pose. Vertices are welded by position for the solver; GetSkinnedVertexPositions hands back one MESH-SPACE position per ORIGINAL vertex, in the source's order, so a render clone can be written straight from it. |
using FSkinPaletteProvider = std::function<bool(EntityID entity, FClothSkinPalette& outPalette)> |
Constructors
| Signature | Name | Description |
|---|---|---|
ClothSystem() | ClothSystem | |
~ClothSystem() override | ~ClothSystem | |
ClothSystem(const ClothSystem&) = delete | ClothSystem |
Public functions
| Returns | Name | Description |
|---|---|---|
ClothSystem& | operator= | |
void | Initialize | |
void | Shutdown | |
void | Update | |
bool | GetVertexPositions | World-space vertex positions (row-major, segmentsY rows of segmentsX). |
void | SetSkinnedSourceProvider | |
void | SetSkinPaletteProvider | |
bool | GetSkinnedVertexPositions | |
bool | IsSkinnedCloth | |
bool | GetSoftBodyVertexPositions | Soft body over a static mesh: WORLD-space positions, one per original vertex (seams welded for the solver, expanded back here). |
bool | IsSoftBody |
Function details
ClothSystem
C++
ClothSystem()~ClothSystem
C++
~ClothSystem() overrideClothSystem
C++
ClothSystem(const ClothSystem&) = deleteoperator=
C++
ClothSystem& operator=(const ClothSystem&) = deleteInitialize
C++
void Initialize(World* world) overrideShutdown
C++
void Shutdown() overrideUpdate
C++
void Update(float deltaTime) overrideGetVertexPositions
C++
bool GetVertexPositions(EntityID entity, std::vector<Vec3>& outPositions) constWorld-space vertex positions (row-major, segmentsY rows of segmentsX). False when the entity has no live cloth body yet.
SetSkinnedSourceProvider
C++
void SetSkinnedSourceProvider(FSkinnedSourceProvider provider)SetSkinPaletteProvider
C++
void SetSkinPaletteProvider(FSkinPaletteProvider provider)GetSkinnedVertexPositions
C++
bool GetSkinnedVertexPositions(EntityID entity, std::vector<Vec3>& outMeshSpace) constIsSkinnedCloth
C++
bool IsSkinnedCloth(EntityID entity) constGetSoftBodyVertexPositions
C++
bool GetSoftBodyVertexPositions(EntityID entity, std::vector<Vec3>& outWorld) constSoft body over a static mesh: WORLD-space positions, one per original vertex (seams welded for the solver, expanded back here).
IsSoftBody
C++
bool IsSoftBody(EntityID entity) constGenerated from Physics/ClothSystem.h via physics.json · Nov 4, 2026Version 1.0.0